Skip to content

Commit 0f707c0

Browse files
minor #38107 [DependencyInjection] consistently use same types for strict comparisons (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] consistently use same types for strict comparisons | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- afc11684e0 consistently use same types for strict comparisons
2 parents 53d3c14 + 1bdf38d commit 0f707c0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Tests/Loader/XmlFileLoaderTest.php

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

678-
$resources = $container->getResources();
678+
$resources = array_map('strval', $container->getResources());
679679

680680
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
681681
$this->assertContains((string) new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources);
@@ -693,7 +693,6 @@ public function testPrototype()
693693
]
694694
);
695695
$this->assertContains((string) $globResource, $resources);
696-
$resources = array_map('strval', $resources);
697696
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
698697
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
699698
}
@@ -708,7 +707,7 @@ public function testPrototypeExcludeWithArray()
708707
sort($ids);
709708
$this->assertSame([Prototype\Foo::class, Prototype\Sub\Bar::class, 'service_container'], $ids);
710709

711-
$resources = $container->getResources();
710+
$resources = array_map('strval', $container->getResources());
712711

713712
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
714713
$this->assertContains((string) new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype_array.xml'), $resources);
@@ -726,7 +725,6 @@ public function testPrototypeExcludeWithArray()
726725
]
727726
);
728727
$this->assertContains((string) $globResource, $resources);
729-
$resources = array_map('strval', $resources);
730728
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
731729
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
732730
}

Tests/Loader/YamlFileLoaderTest.php

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

454-
$resources = $container->getResources();
454+
$resources = array_map('strval', $container->getResources());
455455

456456
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
457457
$this->assertContains((string) new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml'), $resources);
@@ -468,7 +468,6 @@ public function testPrototype()
468468
]
469469
);
470470
$this->assertContains((string) $globResource, $resources);
471-
$resources = array_map('strval', $resources);
472471
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
473472
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
474473
}

0 commit comments

Comments
 (0)