Passed
Push — master ( 43bacd...21e282 )
by Alexander
02:43
created

AfterRender   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
eloc 13
c 1
b 1
f 0
dl 0
loc 42
ccs 14
cts 14
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getFile() 0 3 1
A __construct() 0 6 1
A getView() 0 3 1
A getParameters() 0 3 1
A getResult() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\View\Event\WebView;
6
7
use Yiisoft\View\Event\AfterRenderEventInterface;
8
use Yiisoft\View\WebView;
9
10
/**
11
 * `AfterRender` event is triggered by {@see View::renderFile()} right after it renders a view file.
12
 */
13
final class AfterRender implements AfterRenderEventInterface
14
{
15
    private WebView $view;
16
17
    /**
18
     * @var string The view file being rendered.
19
     */
20
    private string $file;
21
22
    /**
23
     * @var array The parameters array passed to the {@see View::render()} or {@see View::renderFile()} method.
24
     */
25
    private array $parameters;
26
27
    private string $result;
28
29 22
    public function __construct(WebView $view, string $file, array $parameters, string $result)
30
    {
31 22
        $this->view = $view;
32 22
        $this->file = $file;
33 22
        $this->parameters = $parameters;
34 22
        $this->result = $result;
35 22
    }
36
37 1
    public function getView(): WebView
38
    {
39 1
        return $this->view;
40
    }
41
42 1
    public function getFile(): string
43
    {
44 1
        return $this->file;
45
    }
46
47 1
    public function getParameters(): array
48
    {
49 1
        return $this->parameters;
50
    }
51
52 22
    public function getResult(): string
53
    {
54 22
        return $this->result;
55
    }
56
}
57