Passed
Push — master ( 0074b5...431277 )
by Alexander
02:14
created

TestInjectionWidget   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 3 1
A getInjectable() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
4
namespace Yiisoft\Widget\Tests\Stubs;
5
6
use Psr\EventDispatcher\EventDispatcherInterface;
7
use Yiisoft\Widget\Widget;
8
9
class TestInjectionWidget extends Widget
10
{
11
    private Injectable $injectable;
12
13
    public function __construct(Injectable $injectable, EventDispatcherInterface $eventDispatcher)
14
    {
15
        $this->injectable = $injectable;
16
        parent::__construct($eventDispatcher);
17
    }
18
19
    public function getInjectable(): Injectable
20
    {
21
        return $this->injectable;
22
    }
23
24
    protected function run(): string
25
    {
26
        return 'test';
27
    }
28
}
29