AfterRender   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
eloc 5
c 1
b 1
f 0
dl 0
loc 33
ccs 10
cts 10
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 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