1111
1212namespace Symfony \Component \Console \Input ;
1313
14+ use Symfony \Component \Console \Exception \InvalidOptionException ;
15+
1416/**
1517 * ArrayInput represents an input provided as an array.
1618 *
@@ -153,12 +155,12 @@ protected function parse()
153155 * @param string $shortcut The short option key
154156 * @param mixed $value The value for the option
155157 *
156- * @throws \InvalidArgumentException When option given doesn't exist
158+ * @throws InvalidOptionException When option given doesn't exist
157159 */
158160 private function addShortOption ($ shortcut , $ value )
159161 {
160162 if (!$ this ->definition ->hasShortcut ($ shortcut )) {
161- throw new \ InvalidArgumentException (sprintf ('The "-%s" option does not exist. ' , $ shortcut ));
163+ throw new InvalidOptionException (sprintf ('The "-%s" option does not exist. ' , $ shortcut ));
162164 }
163165
164166 $ this ->addLongOption ($ this ->definition ->getOptionForShortcut ($ shortcut )->getName (), $ value );
@@ -170,20 +172,20 @@ private function addShortOption($shortcut, $value)
170172 * @param string $name The long option key
171173 * @param mixed $value The value for the option
172174 *
173- * @throws \InvalidArgumentException When option given doesn't exist
174- * @throws \InvalidArgumentException When a required value is missing
175+ * @throws InvalidOptionException When option given doesn't exist
176+ * @throws InvalidOptionException When a required value is missing
175177 */
176178 private function addLongOption ($ name , $ value )
177179 {
178180 if (!$ this ->definition ->hasOption ($ name )) {
179- throw new \ InvalidArgumentException (sprintf ('The "--%s" option does not exist. ' , $ name ));
181+ throw new InvalidOptionException (sprintf ('The "--%s" option does not exist. ' , $ name ));
180182 }
181183
182184 $ option = $ this ->definition ->getOption ($ name );
183185
184186 if (null === $ value ) {
185187 if ($ option ->isValueRequired ()) {
186- throw new \ InvalidArgumentException (sprintf ('The "--%s" option requires a value. ' , $ name ));
188+ throw new InvalidOptionException (sprintf ('The "--%s" option requires a value. ' , $ name ));
187189 }
188190
189191 $ value = $ option ->isValueOptional () ? $ option ->getDefault () : true ;
0 commit comments