Test Failed
Pull Request — master (#355)
by Sergei
13:10 queued 02:28
created

CommonViewInjection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 6
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;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Yii\View\CommonP...etersInjectionInterface 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 CommonViewInjection implements CommonParametersInjectionInterface
12
{
13
    private UrlGeneratorInterface $url;
14
    private Field $field;
15
16
    public function __construct(
17
        UrlGeneratorInterface $url,
18
        Field $field
19
    ) {
20
        $this->url = $url;
21
        $this->field = $field;
22
    }
23
24
    public function getCommonParameters(): array
25
    {
26
        return [
27
            'field' => $this->field,
28
            'url' => $this->url,
29
        ];
30
    }
31
}
32