Passed
Push — master ( 8423a6...5663f2 )
by Alexander
09:42
created

LayoutViewInjection::getLayoutParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\ViewInjection;
6
7
use App\ApplicationParameters;
8
use Yiisoft\Assets\AssetManager;
9
use Yiisoft\I18n\Locale;
10
use Yiisoft\Router\UrlGeneratorInterface;
11
use Yiisoft\Router\UrlMatcherInterface;
12
use Yiisoft\Yii\View\LayoutParametersInjectionInterface;
13
14
final class LayoutViewInjection implements LayoutParametersInjectionInterface
15
{
16
    private ApplicationParameters $applicationParameters;
17
    private AssetManager $assetManager;
18
    private Locale $locale;
19
    private UrlGeneratorInterface $urlGenerator;
20
    private UrlMatcherInterface $urlMatcher;
21
22 2
    public function __construct(
23
        ApplicationParameters $applicationParameters,
24
        AssetManager $assetManager,
25
        Locale $locale,
26
        UrlGeneratorInterface $urlGenerator,
27
        UrlMatcherInterface $urlMatcher
28
    ) {
29 2
        $this->applicationParameters = $applicationParameters;
30 2
        $this->assetManager = $assetManager;
31 2
        $this->locale = $locale;
32 2
        $this->urlGenerator = $urlGenerator;
33 2
        $this->urlMatcher = $urlMatcher;
34 2
    }
35
36 2
    public function getLayoutParameters(): array
37
    {
38
        return [
39 2
            'applicationParameters' => $this->applicationParameters,
40 2
            'assetManager' => $this->assetManager,
41 2
            'locale' => $this->locale,
42 2
            'urlGenerator' => $this->urlGenerator,
43 2
            'urlMatcher' => $this->urlMatcher,
44
        ];
45
    }
46
}
47