SvgViewInjection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLayoutParameters() 0 4 1
A __construct() 0 4 1
A getContentParameters() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace YiiRocks\SvgInline;
6
7
use Yiisoft\Yii\View\ContentParametersInjectionInterface;
8
use Yiisoft\Yii\View\LayoutParametersInjectionInterface;
9
10
final class SvgViewInjection implements ContentParametersInjectionInterface, LayoutParametersInjectionInterface
11
{
12
    private SvgInlineInterface $svg;
13
14
    public function __construct(
15
        SvgInlineInterface $svg
16
    ) {
17
        $this->svg = $svg;
18
    }
19
20
    public function getContentParameters(): array
21
    {
22
        return [
23
            'svg' => $this->svg,
24
        ];
25
    }
26
27
    public function getLayoutParameters(): array
28
    {
29
        return [
30
            'svg' => $this->svg,
31
        ];
32
    }
33
}
34