Conditions | 11 |
Paths | 12 |
Total Lines | 20 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
21 | public function run(array $oneFileInfoArray, ?string $mode = null) |
||
22 | { |
||
23 | if ($mode !== 'add' && $mode !== 'remove' && $mode !== null) { |
||
24 | user_error('Mode must be either "add" or "remove" or not set at all', E_USER_ERROR); |
||
25 | } |
||
26 | $pathFromAssetsFolder = $oneFileInfoArray['PathFromAssetsFolder']; |
||
27 | $localPath = $oneFileInfoArray['Path']; |
||
28 | if ($oneFileInfoArray['IsDir']) { |
||
29 | DB::alteration_message('Skipping ' . $pathFromAssetsFolder . ' as this is a folder', ''); |
||
30 | } elseif (! empty($oneFileInfoArray['IsResizedImage'])) { |
||
31 | if (file_exists($localPath)) { |
||
32 | DB::alteration_message('Deleting ' . $pathFromAssetsFolder, 'deleted'); |
||
33 | //unlink($localPath); |
||
34 | } |
||
35 | } elseif ($oneFileInfoArray['ErrorDBNotPresent'] && $mode !== 'remove') { |
||
36 | DB::alteration_message('Adding file to database ' . $pathFromAssetsFolder, 'created'); |
||
37 | $this->addFileToDb($oneFileInfoArray); |
||
38 | } elseif ($oneFileInfoArray['ErrorIsInFileSystem'] && $mode !== 'add') { |
||
39 | DB::alteration_message('Removing from database ' . $pathFromAssetsFolder, 'deleted'); |
||
40 | $this->removeFileFromDb($oneFileInfoArray); |
||
41 | } |
||
74 |
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