Browse Source

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

Javier Eguíluz 13 năm trước cách đây
mục cha
commit
96997f12d6

+ 5 - 5
src/Symfony/Component/Console/Input/ArgvInput.php

@@ -25,7 +25,7 @@ namespace Symfony\Component\Console\Input;
  *     $input = new ArgvInput($_SERVER['argv']);
  *
  * If you pass it yourself, don't forget that the first element of the array
- * is the name of the running program.
+ * is the name of the running application.
  *
  * When passing an argument to the constructor, be sure that it respects
  * the same rules as the argv one. It's almost always better to use the
@@ -57,7 +57,7 @@ class ArgvInput extends Input
             $argv = $_SERVER['argv'];
         }
 
-        // strip the program name
+        // strip the application name
         array_shift($argv);
 
         $this->tokens = $argv;
@@ -253,10 +253,10 @@ class ArgvInput extends Input
     }
 
     /**
-     * Returns true if the raw parameters (not parsed) contains a value.
+     * Returns true if the raw parameters (not parsed) contain a value.
      *
      * This method is to be used to introspect the input parameters
-     * before it has been validated. It must be used carefully.
+     * before they have been validated. It must be used carefully.
      *
      * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
      *
@@ -279,7 +279,7 @@ class ArgvInput extends Input
      * Returns the value of a raw option (not parsed).
      *
      * This method is to be used to introspect the input parameters
-     * before it has been validated. It must be used carefully.
+     * before they have been validated. It must be used carefully.
      *
      * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
      * @param mixed $default The default value to return if no result is found

+ 4 - 4
src/Symfony/Component/Console/Input/ArrayInput.php

@@ -58,10 +58,10 @@ class ArrayInput extends Input
     }
 
     /**
-     * Returns true if the raw parameters (not parsed) contains a value.
+     * Returns true if the raw parameters (not parsed) contain a value.
      *
      * This method is to be used to introspect the input parameters
-     * before it has been validated. It must be used carefully.
+     * before they have been validated. It must be used carefully.
      *
      * @param string|array $values The values to look for in the raw parameters (can be an array)
      *
@@ -88,7 +88,7 @@ class ArrayInput extends Input
      * Returns the value of a raw option (not parsed).
      *
      * This method is to be used to introspect the input parameters
-     * before it has been validated. It must be used carefully.
+     * before they have been validated. It must be used carefully.
      *
      * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
      * @param mixed $default The default value to return if no result is found
@@ -132,7 +132,7 @@ class ArrayInput extends Input
      * @param string $shortcut The short option key
      * @param mixed  $value    The value for the option
      *
-     * @throws \RuntimeException When option given doesn't exist
+     * @throws \InvalidArgumentException When option given doesn't exist
      */
     private function addShortOption($shortcut, $value)
     {

+ 4 - 4
src/Symfony/Component/Console/Input/InputDefinition.php

@@ -86,7 +86,7 @@ class InputDefinition
     }
 
     /**
-     * Add an array of InputArgument objects.
+     * Adds an array of InputArgument objects.
      *
      * @param InputArgument[] $arguments An array of InputArgument objects
      *
@@ -102,7 +102,7 @@ class InputDefinition
     }
 
     /**
-     * Add an InputArgument object.
+     * Adds an InputArgument object.
      *
      * @param InputArgument $argument An InputArgument object
      *
@@ -237,7 +237,7 @@ class InputDefinition
     }
 
     /**
-     * Add an array of InputOption objects.
+     * Adds an array of InputOption objects.
      *
      * @param InputOption[] $options An array of InputOption objects
      *
@@ -251,7 +251,7 @@ class InputDefinition
     }
 
     /**
-     * Add an InputOption object.
+     * Adds an InputOption object.
      *
      * @param InputOption $option An InputOption object
      *

+ 8 - 6
src/Symfony/Component/Console/Input/InputInterface.php

@@ -26,10 +26,10 @@ interface InputInterface
     function getFirstArgument();
 
     /**
-     * Returns true if the raw parameters (not parsed) contains a value.
+     * Returns true if the raw parameters (not parsed) contain a value.
      *
      * This method is to be used to introspect the input parameters
-     * before it has been validated. It must be used carefully.
+     * before they have been validated. It must be used carefully.
      *
      * @param string|array $values The values to look for in the raw parameters (can be an array)
      *
@@ -41,7 +41,7 @@ interface InputInterface
      * Returns the value of a raw option (not parsed).
      *
      * This method is to be used to introspect the input parameters
-     * before it has been validated. It must be used carefully.
+     * before they have been validated. It must be used carefully.
      *
      * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
      * @param mixed $default The default value to return if no result is found
@@ -58,7 +58,7 @@ interface InputInterface
     function bind(InputDefinition $definition);
 
     /**
-     * Validate if arguments given are correct.
+     * Validates if arguments given are correct.
      *
      * Throws an exception when not enough arguments are given.
      *
@@ -74,7 +74,7 @@ interface InputInterface
     function getArguments();
 
     /**
-     * Get argument by name.
+     * Gets argument by name.
      *
      * @param string $name The name of the argument
      *
@@ -83,12 +83,14 @@ interface InputInterface
     function getArgument($name);
 
     /**
+     * Returns all the given options merged with the default values.
+     *
      * @return array
      */
     function getOptions();
 
     /**
-     * Get an option by name.
+     * Gets an option by name.
      *
      * @param string $name The name of the option
      *

+ 4 - 2
src/Symfony/Component/Console/Input/InputOption.php

@@ -79,7 +79,7 @@ class InputOption
     }
 
     /**
-     * Returns the shortcut.
+     * Returns the option shortcut.
      *
      * @return string The shortcut
      */
@@ -89,7 +89,7 @@ class InputOption
     }
 
     /**
-     * Returns the name.
+     * Returns the option name.
      *
      * @return string The name
      */
@@ -142,6 +142,8 @@ class InputOption
      * Sets the default value.
      *
      * @param mixed $default The default value
+     *
+     * @throws \LogicException When incorrect default value is given
      */
     public function setDefault($default = null)
     {