Conditions | 10 |
Paths | 18 |
Total Lines | 25 |
Code Lines | 12 |
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 |
||
64 | public function write($message, $type = null) |
||
65 | { |
||
66 | if ($this->handle = fopen($this->filename, 'a')) { |
||
67 | if (is_array($message) && $type === 'A') { |
||
68 | foreach ($message as $key => $value) { |
||
69 | fwrite($this->handle, date('Y-m-d G:i:s') . ' - ' . print_r($key . " -> " . $value, true) . "\n"); |
||
70 | |||
71 | } |
||
72 | } |
||
73 | if (!empty($message)) { |
||
74 | fwrite($this->handle, date('Y-m-d G:i:s') . ' - ' . print_r($message, true) . "\n"); |
||
75 | |||
76 | } |
||
77 | // to use for get data |
||
78 | |||
79 | if (is_array($message) && $type == 'F') { |
||
80 | foreach ($message as $key => $value) { |
||
81 | fwrite($this->handle, date('Y-m-d G:i:s') . ';' . print_r($key . "=>" . $value, true) . "\n") . "<br>"; |
||
82 | |||
83 | } |
||
84 | } |
||
85 | } |
||
86 | fclose($this->handle); |
||
87 | if ($this->filename == true) { |
||
88 | chmod($this->filename, 0755); |
||
89 | } |
||
140 |
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