Skip to content

[Console] Application update PHPDoc of add and register methods #19389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
17 changes: 10 additions & 7 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function getHelperSet()
}

/**
* Set an input definition set to be used with this application.
* Set an input definition to be used with this application.
*
* @param InputDefinition $definition The input definition
*/
Expand Down Expand Up @@ -335,6 +335,8 @@ public function register($name)
/**
* Adds an array of command objects.
*
* If a Command is not enabled it will not be added.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using @see Application::add() to explain the behaviour of this method ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry @Ener-Getick , I tried but it seems @see is no longer used within the SF community;
#19389 (comment)

*
* @param Command[] $commands An array of commands
*/
public function addCommands(array $commands)
Expand All @@ -348,10 +350,11 @@ public function addCommands(array $commands)
* Adds a command object.
*
* If a command with the same name already exists, it will be overridden.
* If the command is not enabled it will not be added.
*
* @param Command $command A Command object
*
* @return Command The registered command
* @return Command|null The registered command if enabled or null
*/
public function add(Command $command)
{
Expand Down Expand Up @@ -420,9 +423,9 @@ public function has($name)
/**
* Returns an array of all unique namespaces used by currently registered commands.
*
* It does not returns the global namespace which always exists.
* It does not return the global namespace which always exists.
*
* @return array An array of namespaces
* @return string[] An array of namespaces
*/
public function getNamespaces()
{
Expand Down Expand Up @@ -954,7 +957,7 @@ private function getSttyColumns()
/**
* Runs and parses mode CON if it's available, suppressing any error output.
*
* @return string <width>x<height> or null if it could not be parsed
* @return string|null <width>x<height> or null if it could not be parsed
*/
private function getConsoleMode()
{
Expand Down Expand Up @@ -1013,7 +1016,7 @@ public function extractNamespace($name, $limit = null)
* @param string $name The string
* @param array|\Traversable $collection The collection
*
* @return array A sorted array of similar string
* @return string[] A sorted array of similar string
*/
private function findAlternatives($name, $collection)
{
Expand Down Expand Up @@ -1121,7 +1124,7 @@ private function splitStringByWidth($string, $width)
*
* @param string $name The full name of the command
*
* @return array The namespaces of the command
* @return string[] The namespaces of the command
*/
private function extractAllNamespaces($name)
{
Expand Down