remove abbreviation support for hidden commands
This commit is contained in:
parent
81ae635100
commit
6623ec2131
@ -693,7 +693,7 @@ class Application implements ResetInterface
|
||||
$command = $this->get(reset($commands));
|
||||
|
||||
if ($command->isHidden()) {
|
||||
@trigger_error(sprintf('Command "%s" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.', $command->getName()), E_USER_DEPRECATED);
|
||||
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
|
||||
}
|
||||
|
||||
return $command;
|
||||
|
@ -4,6 +4,7 @@ CHANGELOG
|
||||
5.0.0
|
||||
-----
|
||||
|
||||
* removed support for finding hidden commands using an abbreviation, use the full name instead
|
||||
* removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()`
|
||||
* removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()`
|
||||
* removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()`
|
||||
|
@ -728,30 +728,6 @@ class ApplicationTest extends TestCase
|
||||
$this->assertInstanceOf('FooHiddenCommand', $application->find('afoohidden'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedDeprecation Command "%s:hidden" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.
|
||||
* @dataProvider provideAbbreviationsForHiddenCommands
|
||||
*/
|
||||
public function testFindHiddenWithAbbreviatedName($name)
|
||||
{
|
||||
$application = new Application();
|
||||
|
||||
$application->add(new \FooHiddenCommand());
|
||||
$application->add(new \BarHiddenCommand());
|
||||
|
||||
$application->find($name);
|
||||
}
|
||||
|
||||
public function provideAbbreviationsForHiddenCommands()
|
||||
{
|
||||
return [
|
||||
['foo:hidde'],
|
||||
['afoohidd'],
|
||||
['bar:hidde'],
|
||||
];
|
||||
}
|
||||
|
||||
public function testFindAmbiguousCommandsIfAllAlternativesAreHidden()
|
||||
{
|
||||
$application = new Application();
|
||||
|
Reference in New Issue
Block a user