Skip to content

Commit 8dda03e

Browse files
minor #28994 SCA: minor code tweaks (vladimir.reznichenko, kalessil)
This PR was merged into the 3.4 branch. Discussion ---------- SCA: minor code tweaks | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Following tweaks included: - repetitive method calls - greedy regex - unnecessary function calls (simplifications) Commits ------- b12c89d481 SCA: fixed broken tests 42e96ff7a2 SCA: applied code style as per guidelines 8dbd927a33 SCA: minor code tweaks
2 parents 87f0952 + 144525b commit 8dda03e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,9 @@ public function testPrototype()
635635
$resources = $container->getResources();
636636

637637
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
638-
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
639-
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '/*', true), $resources));
640638
$resources = array_map('strval', $resources);
639+
$this->assertContains((string) (new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml')), $resources);
640+
$this->assertContains((string) (new GlobResource($fixturesDir.'Prototype', '/*', true)), $resources);
641641
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
642642
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
643643
}

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ public function testPrototype()
394394
$resources = $container->getResources();
395395

396396
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
397-
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml'), $resources));
398-
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '', true), $resources));
399397
$resources = array_map('strval', $resources);
398+
$this->assertContains((string) (new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml')), $resources);
399+
$this->assertContains((string) (new GlobResource($fixturesDir.'Prototype', '', true)), $resources);
400400
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);
401401
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar', $resources);
402402
}

0 commit comments

Comments
 (0)