1 | <?php |
||
14 | class KeyStrategy |
||
15 | { |
||
16 | /** |
||
17 | * File to decode. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $file; |
||
22 | |||
23 | /** |
||
24 | * Password to decode the file. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $password; |
||
29 | |||
30 | /** |
||
31 | * Create a new key strategy instance. |
||
32 | * |
||
33 | * @param string $file |
||
34 | * @param string $password |
||
35 | */ |
||
36 | public function __construct(string $file, string $password) |
||
42 | |||
43 | public function decode(): string |
||
53 | } |
||
54 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.