Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace nyx\console\input\formats; |
||
30 | public function __construct(array $parameters = null, lexers\ArgvToCollections $lexer = null) |
||
31 | { |
||
32 | // If no arguments were passed, let's use the globals returned by the CLI SAPI. |
||
33 | if (!isset($parameters)) { |
||
34 | $parameters = $_SERVER['argv']; |
||
35 | |||
36 | // Strip the script name from the arguments. |
||
37 | array_shift($parameters); |
||
38 | } |
||
39 | |||
40 | $this->lexer = $lexer; |
||
41 | $this->raw = new tokens\Argv($parameters); |
||
42 | } |
||
43 | |||
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.