Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class cron_cleaner extends \phpbb\cron\task\base |
||
|
|||
17 | { |
||
18 | /** @var \phpbbgallery\core\config */ |
||
19 | protected $gallery_config; |
||
20 | |||
21 | /** @var \phpbbgallery\core\upload */ |
||
22 | protected $gallery_upload; |
||
23 | |||
24 | /** |
||
25 | * Constructor |
||
26 | * |
||
27 | * @param \phpbbgallery\core\config $gallery_config |
||
28 | * @param \phpbbgallery\core\upload $gallery_upload |
||
29 | * @access public |
||
30 | */ |
||
31 | public function __construct(\phpbbgallery\core\config $gallery_config, \phpbbgallery\core\upload $gallery_upload) |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | public function run() |
||
41 | { |
||
42 | $this->gallery_upload->prune_orphan(); |
||
43 | $this->gallery_config->set('prune_orphan_time', time()); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritDoc} |
||
48 | */ |
||
49 | public function should_run() |
||
50 | { |
||
51 | return $this->gallery_config->get('prune_orphan_time') < strtotime('24 hours ago'); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritDoc} |
||
56 | */ |
||
57 | public function is_runnable() |
||
60 | } |
||
61 | } |
||
62 |
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