1 | <?php |
||
19 | class ShiftReduce extends Conflict |
||
20 | { |
||
21 | /** |
||
22 | * @var State |
||
23 | */ |
||
24 | protected $state; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $reduce; |
||
30 | |||
31 | /** |
||
32 | * ShiftReduce constructor. |
||
33 | * |
||
34 | * @param State $state |
||
35 | * @param int $reduce |
||
36 | * @param Symbol $symbol |
||
37 | * @param Conflict|null $next |
||
38 | */ |
||
39 | public function __construct(State $state, int $reduce, Symbol $symbol, Conflict $next = null) |
||
45 | |||
46 | /** |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function isShiftReduce(): bool |
||
53 | |||
54 | /** |
||
55 | * @return State |
||
56 | */ |
||
57 | public function state(): State |
||
61 | |||
62 | /** |
||
63 | * @return int |
||
64 | */ |
||
65 | public function reduce(): int |
||
69 | } |
||
70 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.