[Console][Helper] Added missing PHPDoc and fixed some minor typos and grammatical errors

This commit is contained in:
Javier Eguíluz 2011-12-28 10:33:49 +01:00
parent 3ad02bd5f9
commit 855b8af776
3 changed files with 14 additions and 10 deletions

View File

@ -25,11 +25,13 @@ class DialogHelper extends Helper
/**
* Asks a question to the user.
*
* @param OutputInterface $output
* @param OutputInterface $output An Output instance
* @param string|array $question The question to ask
* @param string $default The default answer if none is given by the user
*
* @return string The user answer
*
* @throws \RuntimeException If there is no data to read in the input stream
*/
public function ask(OutputInterface $output, $question, $default = null)
{
@ -47,9 +49,9 @@ class DialogHelper extends Helper
/**
* Asks a confirmation to the user.
*
* The question will be asked until the user answer by nothing, yes, or no.
* The question will be asked until the user answers by nothing, yes, or no.
*
* @param OutputInterface $output
* @param OutputInterface $output An Output instance
* @param string|array $question The question to ask
* @param Boolean $default The default answer if the user enters nothing
*
@ -76,15 +78,15 @@ class DialogHelper extends Helper
* validated data when the data is valid and throw an exception
* otherwise.
*
* @param OutputInterface $output
* @param string|array $question
* @param OutputInterface $output An Output instance
* @param string|array $question The question to ask
* @param callback $validator A PHP callback
* @param integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param string $default The default answer if none is given by the user
*
* @return mixed
*
* @throws \Exception When any of the validator returns an error
* @throws \Exception When any of the validators return an error
*/
public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null)
{
@ -118,7 +120,7 @@ class DialogHelper extends Helper
}
/**
* Returns the helper's canonical name
* Returns the helper's canonical name.
*/
public function getName()
{

View File

@ -66,7 +66,7 @@ class FormatterHelper extends Helper
}
/**
* Returns the length of a string, uses mb_strlen if it is available.
* Returns the length of a string, using mb_strlen if it is available.
*
* @param string $string The string to check its length
*
@ -86,7 +86,7 @@ class FormatterHelper extends Helper
}
/**
* Returns the helper's canonical name
* Returns the helper's canonical name.
*
* @return string The canonical name of the helper
*/

View File

@ -24,6 +24,8 @@ class HelperSet
private $command;
/**
* Constructor.
*
* @param Helper[] $helpers An array of helper.
*/
public function __construct(array $helpers = array())