8000 [FrameworkBundle] Use the correct service id for CachePoolPruneComman… · symfony/symfony@32c7ee3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 32c7ee3

Browse files
DemonTPxnicolas-grekas
authored andcommitted
[FrameworkBundle] Use the correct service id for CachePoolPruneCommand in its compiler pass
1 parent 95ceeab commit 32c7ee3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPrunerPass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

14-
use Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand;
1514
use Symfony\Component\Cache\PruneableInterface;
1615
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1716
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -27,7 +26,7 @@ class CachePoolPrunerPass implements CompilerPassInterface
2726
private $cacheCommandServiceId;
2827
private $cachePoolTag;
2928

30-
public function __construct($cacheCommandServiceId = CachePoolPruneCommand::class, $cachePoolTag = 'cache.pool')
29+
public function __construct($cacheCommandServiceId = 'console.command.cache_pool_prune', $cachePoolTag = 'cache.pool')
3130
{
3231
$this->cacheCommandServiceId = $cacheCommandServiceId;
3332
$this->cachePoolTag = $cachePoolTag;

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPrunerPassTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand;
1615
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPrunerPass;
1716
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1817
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
@@ -25,7 +24,7 @@ class CachePoolPrunerPassTest extends TestCase
2524
public function testCompilerPassReplacesCommandArgument()
2625
{
2726
$container = new ContainerBuilder();
28-
$container->register(CachePoolPruneCommand::class)->addArgument(array());
27+
$container->register('console.command.cache_pool_prune')->addArgument(array());
2928
$container->register('pool.foo', FilesystemAdapter::class)->addTag('cache.pool');
3029
$container->register('pool.bar', PhpFilesAdapter::class)->addTag('cache.pool');
3130

@@ -36,7 +35,7 @@ public function testCompilerPassReplacesCommandArgument()
3635
'pool.foo' => new Reference('pool.foo'),
3736
'pool.bar' => new Reference('pool.bar'),
3837
);
39-
$argument = $container->getDefinition(CachePoolPruneCommand::class)->getArgument(0);
38+
$argument = $container->getDefinition('console.command.cache_pool_prune')->getArgument(0);
4039

4140
$this->assertInstanceOf(IteratorArgument::class, $argument);
4241
$this->assertEquals($expected, $argument->getValues());
@@ -64,7 +63,7 @@ public function testCompilePassIsIgnoredIfCommandDoesNotExist()
6463
public function testCompilerPassThrowsOnInvalidDefinitionClass()
6564
{
6665
$container = new ContainerBuilder();
67-
$container->register(CachePoolPruneCommand::class)->addArgument(array());
66+
$container->register('console.command.cache_pool_prune')->addArgument(array());
6867
$container->register('pool.not-found', NotFound::class)->addTag('cache.pool');
6968

7069
$pass = new CachePoolPrunerPass();

0 commit comments

Comments
 (0)
0