Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ public function find(string $name)
$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;
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
Expand Down
24 changes: 0 additions & 24 deletions src/Symfony/Component/Console/Tests/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,30 +728,6 @@ public function testFindHiddenWithExactName()
$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();
Expand Down