Skip to content

Commit 43de2e4

Browse files
Remove unneeded calls to setPublic(false)
1 parent 95e5df3 commit 43de2e4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Tests/DependencyInjection/AddConsoleCommandPassTest.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function testProcessRegistersLazyCommands()
6464
$container = new ContainerBuilder();
6565
$command = $container
6666
->register('my-command', MyCommand::class)
67-
->setPublic(false)
6867
->addTag('console.command', ['command' => 'my:command'])
6968
->addTag('console.command', ['command' => 'my:alias'])
7069
;
@@ -86,7 +85,6 @@ public function testProcessFallsBackToDefaultName()
8685
$container = new ContainerBuilder();
8786
$container
8887
->register('with-default-name', NamedCommand::class)
89-
->setPublic(false)
9088
->addTag('console.command')
9189
;
9290

@@ -104,7 +102,6 @@ public function testProcessFallsBackToDefaultName()
104102
$container = new ContainerBuilder();
105103
$container
106104
->register('with-default-name', NamedCommand::class)
107-
->setPublic(false)
108105
->addTag('console.command', ['command' => 'new-name'])
109106
;
110107

@@ -218,10 +215,10 @@ public function testProcessPrivateServicesWithSameCommand()
218215
$className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
219216

220217
$definition1 = new Definition($className);
221-
$definition1->addTag('console.command')->setPublic(false);
218+
$definition1->addTag('console.command');
222219

223220
$definition2 = new Definition($className);
224-
$definition2->addTag('console.command')->setPublic(false);
221+
$definition2->addTag('console.command');
225222

226223
$container->setDefinition('my-command1', $definition1);
227224
$container->setDefinition('my-command2', $definition2);
@@ -243,7 +240,7 @@ public function testProcessOnChildDefinitionWithClass()
243240
$childId = 'my-child-command';
244241

245242
$parentDefinition = new Definition(/* no class */);
246-
$parentDefinition->setAbstract(true)->setPublic(false);
243+
$parentDefinition->setAbstract(true);
247244

248245
$childDefinition = new ChildDefinition($parentId);
249246
$childDefinition->addTag('console.command')->setPublic(true);
@@ -268,7 +265,7 @@ public function testProcessOnChildDefinitionWithParentClass()
268265
$childId = 'my-child-command';
269266

270267
$parentDefinition = new Definition($className);
271-
$parentDefinition->setAbstract(true)->setPublic(false);
268+
$parentDefinition->setAbstract(true);
272269

273270
$childDefinition = new ChildDefinition($parentId);
274271
$childDefinition->addTag('console.command')->setPublic(true);
@@ -293,7 +290,7 @@ public function testProcessOnChildDefinitionWithoutClass()
293290
$childId = 'my-child-command';
294291

295292
$parentDefinition = new Definition();
296-
$parentDefinition->setAbstract(true)->setPublic(false);
293+
$parentDefinition->setAbstract(true);
297294

298295
$childDefinition = new ChildDefinition($parentId);
299296
$childDefinition->addTag('console.command')->setPublic(true);

0 commit comments

Comments
 (0)