Total Complexity | 6 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class ConsoleController extends AbstractActionController |
||
10 | { |
||
11 | /** |
||
12 | * @var ImageOptimiserService |
||
13 | */ |
||
14 | protected $imageOptimiserService; |
||
15 | |||
16 | public function __construct(ImageOptimiserService $imageOptimiserService) |
||
17 | { |
||
18 | $this->setImageOptimiserService($imageOptimiserService); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Console wrapper for service |
||
23 | * |
||
24 | * @throws Exception |
||
25 | */ |
||
26 | public function optimiseImagesAction() |
||
27 | { |
||
28 | /** @var string $fromYear */ |
||
29 | $image = $this->params()->fromRoute('image'); |
||
30 | if ($image === null) { |
||
31 | die('You need the --image param.'); |
||
32 | } |
||
33 | |||
34 | try { |
||
35 | $this->getImageOptimiserService()->optimize($image); |
||
36 | } catch (Exception $exception) { |
||
37 | throw $exception; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return ImageOptimiserService |
||
43 | */ |
||
44 | public function getImageOptimiserService() : ImageOptimiserService |
||
45 | { |
||
46 | return $this->imageOptimiserService; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param ImageOptimiserService $imageOptimiserService |
||
51 | * |
||
52 | * @return ConsoleController |
||
53 | */ |
||
54 | public function setImageOptimiserService(ImageOptimiserService $imageOptimiserService) : ConsoleController |
||
59 | } |
||
60 | } |
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