1 | <?php |
||
14 | trait ErrorBag |
||
15 | { |
||
16 | /** |
||
17 | * Create an error bag and store a message on int. |
||
18 | * |
||
19 | * @param $message |
||
20 | * |
||
21 | * @return MessageBag |
||
22 | */ |
||
23 | 3 | protected function createErrorBagForMessage($message): MessageBag |
|
42 | |||
43 | /** |
||
44 | * Get a message bag with a message for a particular status code. |
||
45 | * |
||
46 | * @param $statusCode |
||
47 | * |
||
48 | * @return MessageBag |
||
49 | */ |
||
50 | 3 | protected function getErrorBagForStatusCode($statusCode) |
|
65 | } |
||
66 |
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.