getCurrentPath()) > 0) { $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath())); } else { $property = ''; } return new static(sprintf( 'Expected %s%s, but got %s: %s', $property, $expected_type, gettype($actual_value), json_encode($actual_value) )); } }