| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace nyx\console\input\formats; |
||
| 47 | protected function parse() : console\Input |
||
| 48 | { |
||
| 49 | // Instantiate a Lexer if none has been defined yet. |
||
| 50 | if (!isset($this->lexer)) { |
||
| 51 | $this->lexer = new lexers\ArgvToCollections; |
||
| 52 | } |
||
| 53 | |||
| 54 | // Fill our parameter value collections with the parsed input. |
||
| 55 | $this->lexer->fill($this->arguments(), $this->options(), $this->raw); |
||
|
|
|||
| 56 | |||
| 57 | return $this; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.