| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | private function cleanup(): void |
||
| 21 | { |
||
| 22 | $backup_dir = $this->config->get('db.backup_dir'); |
||
| 23 | |||
| 24 | $dir = dir($backup_dir); |
||
| 25 | if ($dir === false) { |
||
| 26 | throw new RuntimeException('error opening backup directory'); |
||
| 27 | } |
||
| 28 | while ($file = $dir->read()) { |
||
| 29 | $filename = sprintf('%s/%s', $backup_dir, $file); |
||
| 30 | |||
| 31 | if (is_file($filename) && filectime($filename) < time() - (int)$this->config->get('db.backup_cycle_time')) { |
||
| 32 | unlink($filename); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | $dir->close(); |
||
| 36 | } |
||
| 53 |
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