Skip to content

Commit 39e4600

Browse files
Merge branch '4.4' into 5.1
* 4.4: [Debug] fix test consistently use same types for strict comparisons [PhpUnitBridge] Skip internal classes in CoverageListenerTrait [VarExporter] unserialize() might throw an Exception on php 8. [ErrorHandler] Parse "x not found" errors correctly on php 8. Prevent parsing invalid octal digits as octal numbers remove unnecessary check for existing request [DI] fix ContainerBuilder on PHP8 [Console] Make sure $maxAttempts is an int or null. [VarDumper] Fix caster for invalid SplFileInfo objects on php 8. [Intl] Skip test cases that produce a TypeError on php 8. [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3. [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x add bosnian (bs) translation [Debug] Parse "x not found" errors correctly on php 8.
2 parents 0917371 + 0f707c0 commit 39e4600

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ private function createService(Definition $definition, array &$inlineServices, b
10881088
} else {
10891089
$r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass()));
10901090

1091-
$service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments);
1091+
$service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs(array_values($arguments));
10921092

10931093
if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
10941094
trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name);

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ public function testPrototype()
716716
sort($ids);
717717
$this->assertSame([Prototype\Foo::class, Prototype\Sub\Bar::class, 'service_container'], $ids);
718718

719-
$resources = $container->getResources();
719+
$resources = array_map('strval', $container->getResources());
720720

721721
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
722722
$this->assertContains((string) new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources);
@@ -734,7 +734,6 @@ public function testPrototype()
734734
]
735735
);
736736
$this->assertContains((string) $globResource, $resources);
737-
$resources = array_map('strval', $resources);
738737
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
739738
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
740739
}
@@ -749,7 +748,7 @@ public function testPrototypeExcludeWithArray()
749748
sort($ids);
750749
$this->assertSame([Prototype\Foo::class, Prototype\Sub\Bar::class, 'service_container'], $ids);
751750

752-
$resources = $container->getResources();
751+
$resources = array_map('strval', $container->getResources());
753752

754753
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
755754
$this->assertContains((string) new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype_array.xml'), $resources);
@@ -767,7 +766,6 @@ public function testPrototypeExcludeWithArray()
767766
]
768767
);
769768
$this->assertContains((string) $globResource, $resources);
770-
$resources = array_map('strval', $resources);
771769
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
772770
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
773771
}

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public function testPrototype()
445445
sort($ids);
446446
$this->assertSame([Prototype\Foo::class, Prototype\Sub\Bar::class, 'service_container'], $ids);
447447

448-
$resources = $container->getResources();
448+
$resources = array_map('strval', $container->getResources());
449449

450450
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
451451
$this->assertContains((string) new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml'), $resources);
@@ -462,7 +462,6 @@ public function testPrototype()
462462
]
463463
);
464464
$this->assertContains((string) $globResource, $resources);
465-
$resources = array_map('strval', $resources);
466465
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
467466
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
468467
}

0 commit comments

Comments
 (0)