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

AfterRender::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 4
c 1
b 1
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 4
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\View\Event\View;
6
7
use Yiisoft\View\Event\AfterRenderEventInterface;
8
use Yiisoft\View\View;
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 View $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 6
    public function __construct(View $view, string $file, array $parameters, string $result)
30
    {
31 6
        $this->view = $view;
32 6
        $this->file = $file;
33 6
        $this->parameters = $parameters;
34 6
        $this->result = $result;
35 6
    }
36
37 1
    public function getView(): View
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 6
    public function getResult(): string
53
    {
54 6
        return $this->result;
55
    }
56
}
57