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