Passed
Pull Request — master (#83)
by Wilmer
10:33
created

ViewEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 25
ccs 3
cts 7
cp 0.4286
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A file() 0 3 1
A __construct() 0 4 1
A parameters() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\View\Event;
6
7
/**
8
 * ViewEvent represents events triggered by the {@see View} component.
9
 */
10
abstract class ViewEvent
11
{
12
    /**
13
     * @var string the view file being rendered.
14
     */
15
    private string $file;
16
    /**
17
     * @var array the parameter array passed to the {@see View::render()} method.
18
     */
19
    private array $parameters;
20
21 8
    public function __construct(string $file, array $parameters = [])
22
    {
23 8
        $this->file = $file;
24 8
        $this->parameters = $parameters;
25
    }
26
27
    public function file(): string
28
    {
29
        return $this->file;
30
    }
31
32
    public function parameters(): array
33
    {
34
        return $this->parameters;
35
    }
36
}
37