Skip to content

Commit 6b0fbfb

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: fix typo CS fix [Serializer] Keep stack trace for enum value denormalizer error [Serializer] Fix partial denormalization with missing constructor arguments [Serializer] Moves dummy to fixtures folder
2 parents f99e1a0 + 449f224 commit 6b0fbfb

File tree

13 files changed

+92
-17
lines changed

13 files changed

+92
-17
lines changed

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private static function removeDir($dir)
265265
rmdir($dir);
266266
}
267267

268-
public static function setupBeforeClass(): void
268+
public static function setUpBeforeClass(): void
269269
{
270270
foreach (get_declared_classes() as $class) {
271271
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function testFirewalls()
242242
],
243243
], $listeners);
244244

245-
$this->assertFalse($container->hasAlias(UserCheckerInterface::class, 'No user checker alias is registered when custom user checker services are registered'));
245+
$this->assertFalse($container->hasAlias(UserCheckerInterface::class), 'No user checker alias is registered when custom user checker services are registered');
246246
}
247247

248248
public function testFirewallRequestMatchers()

src/Symfony/Component/Cache/Tests/Adapter/CouchbaseBucketAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CouchbaseBucketAdapterTest extends AdapterTestCase
3333
/** @var \CouchbaseBucket */
3434
protected static $client;
3535

36-
public static function setupBeforeClass(): void
36+
public static function setUpBeforeClass(): void
3737
{
3838
if (!CouchbaseBucketAdapter::isSupported()) {
3939
throw new SkippedTestSuiteError('Couchbase >= 2.6.0 < 3.0.0 is required.');

src/Symfony/Component/Cache/Tests/Adapter/CouchbaseCollectionAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CouchbaseCollectionAdapterTest extends AdapterTestCase
3333
/** @var Collection */
3434
protected static $client;
3535

36-
public static function setupBeforeClass(): void
36+
public static function setUpBeforeClass(): void
3737
{
3838
if (!CouchbaseCollectionAdapter::isSupported()) {
3939
self::markTestSkipped('Couchbase >= 3.0.0 < 4.0.0 is required.');

src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RedisArrayAdapterTest extends AbstractRedisAdapterTestCase
2020
{
2121
public static function setUpBeforeClass(): void
2222
{
23-
parent::setupBeforeClass();
23+
parent::setUpBeforeClass();
2424
if (!class_exists(\RedisArray::class)) {
2525
throw new SkippedTestSuiteError('The RedisArray class is required.');
2626
}

src/Symfony/Component/Lock/Tests/Store/MongoDbStoreFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class MongoDbStoreFactoryTest extends TestCase
2727
{
28-
public static function setupBeforeClass(): void
28+
public static function setUpBeforeClass(): void
2929
{
3030
if (!class_exists(Client::class)) {
3131
throw new SkippedTestSuiteError('The mongodb/mongodb package is required.');

src/Symfony/Component/Lock/Tests/Store/MongoDbStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MongoDbStoreTest extends AbstractStoreTestCase
3030
{
3131
use ExpiringStoreTestTrait;
3232

33-
public static function setupBeforeClass(): void
33+
public static function setUpBeforeClass(): void
3434
{
3535
if (!class_exists(Client::class)) {
3636
throw new SkippedTestSuiteError('The mongodb/mongodb package is required.');

src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,32 +367,32 @@ protected function instantiateObject(array &$data, string $class, array &$contex
367367
} elseif ($allowed && !$ignored && (isset($data[$key]) || \array_key_exists($key, $data))) {
368368
$parameterData = $data[$key];
369369
if (null === $parameterData && $constructorParameter->allowsNull()) {
370-
$params[] = null;
370+
$params[$paramName] = null;
371371
$unsetKeys[] = $key;
372372

373373
continue;
374374
}
375375

376376
try {
377-
$params[] = $this->denormalizeParameter($reflectionClass, $constructorParameter, $paramName, $parameterData, $attributeContext, $format);
377+
$params[$paramName] = $this->denormalizeParameter($reflectionClass, $constructorParameter, $paramName, $parameterData, $attributeContext, $format);
378378
} catch (NotNormalizableValueException $exception) {
379379
if (!isset($context['not_normalizable_value_exceptions'])) {
380380
throw $exception;
381381
}
382382

383383
$context['not_normalizable_value_exceptions'][] = $exception;
384-
$params[] = $parameterData;
384+
$params[$paramName] = $parameterData;
385385
}
386386

387387
$unsetKeys[] = $key;
388388
} elseif (\array_key_exists($key, $context[static::DEFAULT_CONSTRUCTOR_ARGUMENTS][$class] ?? [])) {
389-
$params[] = $context[static::DEFAULT_CONSTRUCTOR_ARGUMENTS][$class][$key];
389+
$params[$paramName] = $context[static::DEFAULT_CONSTRUCTOR_ARGUMENTS][$class][$key];
390390
} elseif (\array_key_exists($key, $this->defaultContext[self::DEFAULT_CONSTRUCTOR_ARGUMENTS][$class] ?? [])) {
391-
$params[] = $this->defaultContext[self::DEFAULT_CONSTRUCTOR_ARGUMENTS][$class][$key];
391+
$params[$paramName] = $this->defaultContext[self::DEFAULT_CONSTRUCTOR_ARGUMENTS][$class][$key];
392392
} elseif ($constructorParameter->isDefaultValueAvailable()) {
393-
$params[] = $constructorParameter->getDefaultValue();
393+
$params[$paramName] = $constructorParameter->getDefaultValue();
394394
} elseif (!($context[self::REQUIRE_ALL_PROPERTIES] ?? $this->defaultContext[self::REQUIRE_ALL_PROPERTIES] ?? false) && $constructorParameter->hasType() && $constructorParameter->getType()->allowsNull()) {
395-
$params[] = null;
395+
$params[$paramName] = null;
396396
} else {
397397
if (!isset($context['not_normalizable_value_exceptions'])) {
398398
$missingConstructorArguments[] = $constructorParameter->name;

src/Symfony/Component/Serializer/Normalizer/BackedEnumNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
7777
return $type::from($data);
7878
} catch (\ValueError $e) {
7979
if (isset($context['has_constructor'])) {
80-
throw new InvalidArgumentException('The data must belong to a backed enumeration of type '.$type);
80+
throw new InvalidArgumentException('The data must belong to a backed enumeration of type '.$type, 0, $e);
8181
}
8282

8383
throw NotNormalizableValueException::createForUnexpectedDataType('The data must belong to a backed enumeration of type '.$type, $data, [$type], $context['deserialization_path'] ?? null, true, 0, $e);

src/Symfony/Component/Serializer/Tests/Php80Dummy.php renamed to src/Symfony/Component/Serializer/Tests/Fixtures/Php80Dummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Serializer\Tests;
12+
namespace Symfony\Component\Serializer\Tests\Fixtures;
1313

1414
final class Php80Dummy
1515
{

0 commit comments

Comments
 (0)