| 1 | <?php |
||
| 23 | class ArgvInputExtended extends ArgvInput implements InputExtendedInterface |
||
| 24 | { |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Returns true if a option is set during the command call. |
||
| 28 | * |
||
| 29 | * This method is useful if you want to know if an option was passed during the command call. |
||
| 30 | * Sometimes this is useful, e.g. to overwrite only values if you pass them. |
||
| 31 | * |
||
| 32 | * Example definition in a command: |
||
| 33 | * protected function configure() { |
||
| 34 | * $this->setName('my:command') |
||
| 35 | * ->addOption('foo', 'f', InputOption::VALUE_REQUIRED, 'Description', 'Default Value'); |
||
| 36 | * ... |
||
| 37 | * |
||
| 38 | * Example: |
||
| 39 | * $ ./console my:command --foo=bar |
||
| 40 | * $input->isOptionSet('foo') => true |
||
| 41 | * |
||
| 42 | * $ ./console my:command |
||
| 43 | * $input->isOptionSet('foo') => false |
||
| 44 | * |
||
| 45 | * @param string $optionName Name of the option you want to check ('foo' from example). |
||
| 46 | * @return boolean |
||
| 47 | */ |
||
| 48 | 7 | public function isOptionSet($optionName) |
|
| 52 | } |
||
| 53 |