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

BeforeRender   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 12
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A stopPropagation() 0 3 1
A isPropagationStopped() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\View\Event;
6
7
use Psr\EventDispatcher\StoppableEventInterface;
8
9
/**
10
 * BeforeRender event is triggered by {@see View::renderFile()} right before it renders a view file.
11
 */
12
class BeforeRender extends ViewEvent implements StoppableEventInterface
13
{
14
    private bool $stopPropagation = false;
15
16
    public function stopPropagation(): void
17
    {
18
        $this->stopPropagation = true;
19
    }
20
21 8
    public function isPropagationStopped(): bool
22
    {
23 8
        return $this->stopPropagation;
24
    }
25
}
26