ThemeCompiler::__construct()   A
last analyzed

Complexity

Conditions 4
Paths 5

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 4
eloc 7
c 2
b 0
f 0
nc 5
nop 0
dl 0
loc 14
rs 10
1
<?php
2
3
namespace DneCustomJsCss\Services;
4
5
use Shopware\Components\Theme\Compiler;
0 ignored issues
show
Bug introduced by
The type Shopware\Components\Theme\Compiler was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Shopware\Components\Theme\Compressor\CompressorInterface;
0 ignored issues
show
Bug introduced by
The type Shopware\Components\Them...sor\CompressorInterface was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Shopware\Components\Theme\LessCompiler;
0 ignored issues
show
Bug introduced by
The type Shopware\Components\Theme\LessCompiler was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Shopware\Models\Shop\Shop;
0 ignored issues
show
Bug introduced by
The type Shopware\Models\Shop\Shop was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Shopware\Models\Shop\Template;
0 ignored issues
show
Bug introduced by
The type Shopware\Models\Shop\Template was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
class ThemeCompiler extends Compiler
12
{
13
    /**
14
     * @var CompressorDecorator
15
     */
16
    private $compressor;
17
18
    /**
19
     * @var LessCompilerDecorator
20
     */
21
    private $lessCompiler;
22
23
    /**
24
     * ThemeCompilerDecorator constructor.
25
     *
26
     * {@inheritdoc}
27
     */
28
    public function __construct()
29
    {
30
        $args = func_get_args();
31
32
        foreach ($args as $arg) {
33
            if ($arg instanceof CompressorInterface) {
34
                $this->compressor = $arg;
35
            }
36
            if ($arg instanceof LessCompiler) {
37
                $this->lessCompiler = $arg;
38
            }
39
        }
40
41
        parent::__construct(...$args);
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function compileJavascript($timestamp, Template $template, Shop $shop)
48
    {
49
        $this->compressor->setShop($shop);
50
51
        parent::compileJavascript($timestamp, $template, $shop);
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function compileLess($timestamp, Template $template, Shop $shop)
58
    {
59
        $this->lessCompiler->setShop($shop);
60
61
        parent::compileLess($timestamp, $template, $shop);
62
    }
63
}
64