Conditions | 17 |
Paths | 17 |
Total Lines | 31 |
Code Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
78 | public function shutdownHandler() |
||
79 | { |
||
80 | if ($error = error_get_last()) { |
||
81 | $errorMsg = $error['message'] . " " . $error['file'] . "(" . $error['line'] . ")"; |
||
82 | switch ($error['type']) { |
||
83 | case E_ERROR: |
||
84 | case E_CORE_ERROR: |
||
85 | case E_COMPILE_ERROR: |
||
86 | case E_USER_ERROR: |
||
87 | case E_RECOVERABLE_ERROR: |
||
88 | $this->container->logger->fatal($errorMsg); |
||
89 | $this->container->logger->enableDirectWrite(); |
||
90 | $this->container->response->move(500); |
||
91 | break; |
||
92 | case E_PARSE: |
||
93 | $this->container->logger->error($errorMsg); |
||
94 | $this->container->logger->enableDirectWrite(); |
||
95 | $this->container->response->move(500); |
||
96 | break; |
||
97 | case E_WARNING: |
||
98 | case E_CORE_WARNING: |
||
99 | case E_COMPILE_WARNING: |
||
100 | case E_USER_WARNING: |
||
101 | case E_STRICT: |
||
102 | case E_NOTICE: |
||
103 | case E_USER_NOTICE: |
||
104 | case E_DEPRECATED: |
||
105 | case E_USER_DEPRECATED: |
||
106 | $this->container->logger->warn($errorMsg); |
||
107 | $this->container->logger->enableDirectWrite(); |
||
108 | break; |
||
109 | } |
||
113 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths