Passed
Push — master ( e274a9...c7178b )
by Alexander
19:43 queued 16:19
created

CommonViewInjection::getCommonParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\ViewInjection;
6
7
use Yiisoft\Form\Widget\Field;
8
use Yiisoft\Router\UrlGeneratorInterface;
9
use Yiisoft\Yii\View\CommonParametersInjectionInterface;
10
11
class CommonViewInjection implements CommonParametersInjectionInterface
12
{
13
    private UrlGeneratorInterface $url;
14
    private Field $field;
15
16 10
    public function __construct(
17
        UrlGeneratorInterface $url,
18
        Field $field
19
    ) {
20 10
        $this->url = $url;
21 10
        $this->field = $field;
22 10
    }
23
24 10
    public function getCommonParameters(): array
25
    {
26
        return [
27 10
            'field' => $this->field,
28 10
            'url' => $this->url,
29
        ];
30
    }
31
}
32