1 | <?php namespace nyx\console\input\formats; |
||
17 | class Argv extends console\Input |
||
18 | { |
||
19 | /** |
||
20 | * @var lexers\ArgvToCollections The token parser to be used. |
||
21 | */ |
||
22 | private $lexer; |
||
23 | |||
24 | /** |
||
25 | * Constructs a new Argv Input instance. |
||
26 | * |
||
27 | * @param array $parameters An array of parameters (in the argv format). |
||
28 | * @param lexers\ArgvToCollections $lexer A Argv to Collections Lexer instance. |
||
29 | */ |
||
30 | public function __construct(array $parameters = null, lexers\ArgvToCollections $lexer = null) |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | protected function parse() : console\Input |
||
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.