diff --git a/src/Symfony/Component/Console/Question/ChoiceQuestion.php b/src/Symfony/Component/Console/Question/ChoiceQuestion.php index d6de09798c..e1da7a8c5e 100644 --- a/src/Symfony/Component/Console/Question/ChoiceQuestion.php +++ b/src/Symfony/Component/Console/Question/ChoiceQuestion.php @@ -23,6 +23,13 @@ class ChoiceQuestion extends Question private $prompt = ' > '; private $errorMessage = 'Value "%s" is invalid'; + /** + * Constructor. + * + * @param string $question The question to ask to the user + * @param array $choices The list of available choices + * @param mixed $default The default answer to return + */ public function __construct($question, array $choices, $default = null) { parent::__construct($question, $default); @@ -100,6 +107,11 @@ class ChoiceQuestion extends Question return $this; } + /** + * Returns the default answer validator. + * + * @return callable + */ private function getDefaultValidator() { $choices = $this->choices; diff --git a/src/Symfony/Component/Console/Question/ConfirmationQuestion.php b/src/Symfony/Component/Console/Question/ConfirmationQuestion.php index 0438640fa4..09ac74ff65 100644 --- a/src/Symfony/Component/Console/Question/ConfirmationQuestion.php +++ b/src/Symfony/Component/Console/Question/ConfirmationQuestion.php @@ -18,6 +18,12 @@ namespace Symfony\Component\Console\Question; */ class ConfirmationQuestion extends Question { + /** + * Constructor. + * + * @param string $question The question to ask to the user + * @param bool $default The default answer to return, true or false + */ public function __construct($question, $default = true) { parent::__construct($question, (bool) $default); @@ -25,6 +31,11 @@ class ConfirmationQuestion extends Question $this->setNormalizer($this->getDefaultNormalizer()); } + /** + * Returns the default answer normalizer. + * + * @return callable + */ private function getDefaultNormalizer() { $default = $this->getDefault(); diff --git a/src/Symfony/Component/Console/Question/Question.php b/src/Symfony/Component/Console/Question/Question.php index 6a7b07f9a1..9f776d5790 100644 --- a/src/Symfony/Component/Console/Question/Question.php +++ b/src/Symfony/Component/Console/Question/Question.php @@ -116,7 +116,7 @@ class Question /** * Gets values for the autocompleter. * - * @return null|array|Traversable + * @return null|array|\Traversable */ public function getAutocompleterValues() { @@ -126,7 +126,7 @@ class Question /** * Sets values for the autocompleter. * - * @param null|array|Traversable $values + * @param null|array|\Traversable $values * * @return Question The current instance * @@ -165,7 +165,7 @@ class Question } /** - * Gets the validator for the question + * Gets the validator for the question. * * @return null|callable */ @@ -211,9 +211,9 @@ class Question /** * Sets a normalizer for the response. * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. + * The normalizer can be a callable (a string), a closure or a class implementing __invoke. * - * @param string|Closure $normalizer + * @param string|\Closure $normalizer * * @return Question The current instance */ @@ -229,7 +229,7 @@ class Question * * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. * - * @return string|Closure + * @return string|\Closure */ public function getNormalizer() {