AfterRender::getView()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 1
c 1
b 1
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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 WebView::renderFile()} right after it renders a view file.
12
 */
13
final class AfterRender implements AfterRenderEventInterface
14
{
15
    /**
16
     * @param string $file The view file being rendered.
17
     * @param array $parameters The parameters array passed to the {@see WebView::render()}
18
     * or {@see WebView::renderFile()} method.
19
     */
20 48
    public function __construct(
21
        private WebView $view,
22
        private string $file,
23
        private array $parameters,
24
        private string $result
25
    ) {
26 48
    }
27
28 1
    public function getView(): WebView
29
    {
30 1
        return $this->view;
31
    }
32
33 1
    public function getFile(): string
34
    {
35 1
        return $this->file;
36
    }
37
38 1
    public function getParameters(): array
39
    {
40 1
        return $this->parameters;
41
    }
42
43 48
    public function getResult(): string
44
    {
45 48
        return $this->result;
46
    }
47
}
48