Completed
Pull Request — master (#57)
by Wilmer
02:10
created

TestWidgetB::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Yiisoft\Widget\Tests\Stubs;
5
6
use Psr\Log\LoggerInterface;
7
use Yiisoft\View\WebView;
8
use Yiisoft\Widget\Widget;
9
10
/**
11
 * TestWidgetB
12
 */
13
class TestWidgetB extends Widget
14
{
15
    /**
16
     * @var string $id;
17
     */
18
    private $id;
19
20
    /**
21
     * @param WebView $webView
22
     */
23
    private $webView;
0 ignored issues
show
introduced by
The private property $webView is not used, and could be removed.
Loading history...
24
25
    public function __construct(WebView $webView, LoggerInterface $logger)
26
    {
27
        parent::__construct($webView);
28
        $this->logger = $logger;
0 ignored issues
show
Bug Best Practice introduced by
The property logger does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
29
    }
30
31
    public function init(): void
32
    {
33
    }
34
35
    public function run(): string
36
    {
37
        return '<run-' . $this->id . '-construct>';
38
    }
39
40
    public function id(string $value): Widget
41
    {
42
        $this->id = $value;
43
44
        return $this;
45
    }
46
}
47