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

BeforeRender::isPropagationStopped()   A

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 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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