8000 feature: take nicolas comment in account · symfony/symfony@cff1c8e · GitHub
[go: up one dir, main page]

Skip to content

Commit cff1c8e

Browse files
author
Amrouche Hamza
committed
feature: take nicolas comment in account
1 parent e44d584 commit cff1c8e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
126126
if ($serviceAlias->isDeprecated()) {
127127
$serviceLine .= ' - <fg=magenta>deprecated</>';
128128
}
129-
} elseif (!$all && !$search) {
129+
} elseif (!$all) {
130+
if ($search) {
131+
$io->text('Non-aliased services are not shown unless the "--all" option is passed, you would better not type-hint on these classes.');
132+
}
130133
continue;
131134
}
132135
$text[] = $serviceLine;

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/DebugAutowiringCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testSearchNotAliasedService()
8383
$tester = new ApplicationTester($application);
8484
$tester->run(['command' => 'debug:autowiring', 'search' => 'redirect']);
8585

86-
$this->assertContains('Symfony\Bundle\FrameworkBundle\Controller\RedirectController', $tester->getDisplay());
86+
$this->assertContains('The non-aliased services are not shown unless the all option is passed, please do not type-hint the classes if possible.', $tester->getDisplay());
8787
$this->assertNotContains('Symfony\Component\Routing\RouterInterface', $tester->getDisplay());
8888
}
8989
}

0 commit comments

Comments
 (0)
0