Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function __construct(Parser $parser = null, PrettyPrinterAbstract $printer = null) |
||
38 | { |
||
39 | if (null === $parser) { |
||
40 | $parser = new Parser(new Lexer()); |
||
41 | } |
||
42 | |||
43 | if (null === $printer) { |
||
44 | $printer = new Standard(); |
||
45 | } |
||
46 | |||
47 | $this->parser = $parser; |
||
48 | $this->printer = $printer; |
||
49 | } |
||
50 | |||
67 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.