| Conditions | 3 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 20 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 30 | View Code Duplication | protected function parseInput() |
|
| 31 | { |
||
| 32 | list($name, $arguments, $options) = Parser::parse($this->signature); |
||
| 33 | |||
| 34 | $this->name = $name; |
||
| 35 | |||
| 36 | $inputDefinition = new InputDefinition(); |
||
| 37 | |||
| 38 | foreach ($arguments as $argument) { |
||
| 39 | $inputDefinition->addArgument($argument); |
||
| 40 | } |
||
| 41 | |||
| 42 | foreach($options as $option) { |
||
| 43 | $inputDefinition->addOption($option); |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->input = new StringInput($this->request->text); |
||
| 47 | |||
| 48 | $this->input->bind($inputDefinition); |
||
| 49 | } |
||
| 50 | |||
| 62 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: