Skip to content

Commit 6b9ed15

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: [HttpClient] Support for cURL handler objects. [HttpClient] unset activity list when creating CurlResponse Fixed typo in test name add .body wrapper element [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3" [VarDumper] Support for cURL handler objects. Check whether path is file in DataPart::fromPath() [DI][FrameworkBundle] Remove whitelist occurrences Avoid accessibility errors on debug toolbar
2 parents ff3966e + 228fe7f commit 6b9ed15

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

DependencyInjection/Compiler/UnusedTagsPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class UnusedTagsPass implements CompilerPassInterface
2323
{
24-
private $whitelist = [
24+
private $knownTags = [
2525
'annotations.cached_reader',
2626
'auto_alias',
2727
'cache.pool',
@@ -85,11 +85,11 @@ class UnusedTagsPass implements CompilerPassInterface
8585

8686
public function process(ContainerBuilder $container)
8787
{
88-
$tags = array_unique(array_merge($container->findTags(), $this->whitelist));
88+
$tags = array_unique(array_merge($container->findTags(), $this->knownTags));
8989

9090
foreach ($container->findUnusedTags() as $tag) {
91-
// skip whitelisted tags
92-
if (\in_array($tag, $this->whitelist)) {
91+
// skip known tags
92+
if (\in_array($tag, $this->knownTags)) {
9393
continue;
9494
}
9595

Resources/bin/check-unused-tags-whitelist.php renamed to Resources/bin/check-unused-known-tags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515

1616
$target = dirname(__DIR__, 2).'/DependencyInjection/Compiler/UnusedTagsPass.php';
1717
$contents = file_get_contents($target);
18-
$contents = preg_replace('{private \$whitelist = \[(.+?)\];}sm', "private \$whitelist = [\n '".implode("',\n '", UnusedTagsPassUtils::getDefinedTags())."',\n ];", $contents);
18+
$contents = preg_replace('{private \$knownTags = \[(.+?)\];}sm', "private \$knownTags = [\n '".implode("',\n '", UnusedTagsPassUtils::getDefinedTags())."',\n ];", $contents);
1919
file_put_contents($target, $contents);

Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ public function testProcess()
3232
$this->assertSame([sprintf('%s: Tag "kenrel.event_subscriber" was defined on service(s) "foo", "bar", but was never used. Did you mean "kernel.event_subscriber"?', UnusedTagsPass::class)], $container->getCompiler()->getLog());
3333
}
3434

35-
public function testMissingWhitelistTags()
35+
public function testMissingKnownTags()
3636
{
3737
if (\dirname((new \ReflectionClass(ContainerBuilder::class))->getFileName(), 3) !== \dirname(__DIR__, 5)) {
3838
$this->markTestSkipped('Tests are not run from the root symfony/symfony metapackage.');
3939
}
4040

41-
$this->assertSame(UnusedTagsPassUtils::getDefinedTags(), $this->getWhitelistTags(), 'The src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php file must be updated; run src/Symfony/Bundle/FrameworkBundle/Resources/bin/check-unused-tags-whitelist.php.');
41+
$this->assertSame(UnusedTagsPassUtils::getDefinedTags(), $this->getKnownTags(), 'The src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php file must be updated; run src/Symfony/Bundle/FrameworkBundle/Resources/bin/check-unused-known-tags.php.');
4242
}
4343

4444
private function getWhitelistTags(): array
4545
{
4646
// get tags in UnusedTagsPass
4747
$target = \dirname(__DIR__, 3).'/DependencyInjection/Compiler/UnusedTagsPass.php';
4848
$contents = file_get_contents($target);
49-
preg_match('{private \$whitelist = \[(.+?)\];}sm', $contents, $matches);
49+
preg_match('{private \$knownTags = \[(.+?)\];}sm', $contents, $matches);
5050
$tags = array_values(array_filter(array_map(function ($str) {
5151
return trim(preg_replace('{^ +\'(.+)\',}', '$1', $str));
5252
}, explode("\n", $matches[1]))));

0 commit comments

Comments
 (0)