Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  [Serializer] Improve exception message in UnwrappingDenormalizer
  [PropertyInfo] Update DoctrineExtractor for new DBAL 4 BIGINT type
  Update security.nl.xlf
  [Validator] IBAN Check digits should always between 2 and 98
  [Security] Populate translations for trans-unit 20
  add missing plural translation messages
  filter out empty HTTP header parts
  [String] Fix folded in compat mode
  Remove calls to `getMockForAbstractClass()`
  [ErrorHandler] Do not call xdebug_get_function_stack() with xdebug >= 3.0 when not in develop mode
  [Serializer] Fix type for missing property
  add test for JSON response with null as content
  [Filesystem] Fix dumpFile `stat failed` error hitting custom handler
  Return false in isTtySupported() when open_basedir restrictions prevent access to /dev/tty.
  Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder`
  [PhpUnitBridge] Fix `DeprecationErrorHandler` with PhpUnit 10
  • Loading branch information
fabpot committed May 17, 2024
2 parents 7f4acfa + 450011a commit 7c5eebc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function withUnwrapPath(?string $unwrapPath): static
try {
new PropertyPath($unwrapPath);
} catch (InvalidPropertyPathException $e) {
throw new InvalidArgumentException('The "%s" property path is not valid.', previous: $e);
throw new InvalidArgumentException(sprintf('The "%s" property path is not valid.', $unwrapPath), previous: $e);
}

return $this->with(UnwrappingDenormalizer::UNWRAP_PATH, $unwrapPath);
Expand Down
2 changes: 1 addition & 1 deletion Normalizer/AbstractNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ protected function instantiateObject(array &$data, string $class, array &$contex

$exception = NotNormalizableValueException::createForUnexpectedDataType(
sprintf('Failed to create object because the class misses the "%s" property.', $constructorParameter->name),
$data,
null,
[$constructorParameterType],
$attributeContext['deserialization_path'] ?? null,
true
Expand Down
10 changes: 5 additions & 5 deletions Tests/SerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ public function testCollectDenormalizationErrors(?ClassMetadataFactory $classMet
'message' => 'The type of the "string" attribute for class "Symfony\Component\Serializer\Tests\Fixtures\Php74Full" must be one of "string" ("null" given).',
],
[
'currentType' => 'array',
'currentType' => 'null',
'expectedTypes' => [
'unknown',
],
Expand Down Expand Up @@ -1301,7 +1301,7 @@ public function testCollectDenormalizationErrorsWithConstructor(?ClassMetadataFa
'message' => 'The type of the "bool" attribute for class "Symfony\\Component\\Serializer\\Tests\\Fixtures\\Php80WithPromotedTypedConstructor" must be one of "bool" ("string" given).',
],
[
'currentType' => 'array',
'currentType' => 'null',
'expectedTypes' => [
'string',
],
Expand All @@ -1310,7 +1310,7 @@ public function testCollectDenormalizationErrorsWithConstructor(?ClassMetadataFa
'message' => 'Failed to create object because the class misses the "string" property.',
],
[
'currentType' => 'array',
'currentType' => 'null',
'expectedTypes' => [
'int',
],
Expand Down Expand Up @@ -1410,7 +1410,7 @@ public function testCollectDenormalizationErrorsWithEnumConstructor()

$expected = [
[
'currentType' => 'array',
'currentType' => 'null',
'useMessageForUser' => true,
'message' => 'Failed to create object because the class misses the "get" property.',
],
Expand Down Expand Up @@ -1619,7 +1619,7 @@ public function testPartialDenormalizationWithMissingConstructorTypes()

$expected = [
[
'currentType' => 'array',
'currentType' => 'null',
'expectedTypes' => [
'string',
],
Expand Down

0 comments on commit 7c5eebc

Please sign in to comment.