CommonViewInjection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 1
f 0
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCommonParameters() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\ViewInjection;
6
7
use App\ApplicationParameters;
8
use Yiisoft\Yii\View\CommonParametersInjectionInterface;
9
use Yiisoft\Router\UrlGeneratorInterface;
10
11
final class CommonViewInjection implements CommonParametersInjectionInterface
12
{
13
    public function __construct(
14 3
        private ApplicationParameters $applicationParameters,
15
        private UrlGeneratorInterface $urlGenerator,
16
    ) {
17 3
    }
18
19
    public function getCommonParameters(): array
20 3
    {
21
        return [
22
            'applicationParameters' => $this->applicationParameters,
23 3
            'urlGenerator' => $this->urlGenerator,
24
        ];
25
    }
26
}
27