Test Failed
Pull Request — master (#150)
by Alexander
12:20
created

AfterRender   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 13
c 1
b 0
f 0
dl 0
loc 42
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
    public function __construct(WebView $view, string $file, array $parameters, string $result)
30
    {
31
        $this->view = $view;
32
        $this->file = $file;
33
        $this->parameters = $parameters;
34
        $this->result = $result;
35
    }
36
37
    public function getView(): WebView
38
    {
39
        return $this->view;
40
    }
41
42
    public function getFile(): string
43
    {
44
        return $this->file;
45
    }
46
47
    public function getParameters(): array
48
    {
49
        return $this->parameters;
50
    }
51
52
    public function getResult(): string
53
    {
54
        return $this->result;
55
    }
56
}
57