Total Complexity | 5 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
21 | final class View extends BaseView |
||
22 | { |
||
23 | /** |
||
24 | * Marks the beginning of a view. |
||
25 | */ |
||
26 | 1 | public function beginPage(): void |
|
27 | { |
||
28 | 1 | ob_start(); |
|
29 | /** @psalm-suppress PossiblyFalseArgument */ |
||
30 | 1 | PHP_VERSION_ID >= 80000 ? ob_implicit_flush(false) : ob_implicit_flush(0); |
|
31 | |||
32 | 1 | $this->eventDispatcher->dispatch(new PageBegin($this)); |
|
33 | 1 | } |
|
34 | |||
35 | /** |
||
36 | * Marks the ending of a view. |
||
37 | */ |
||
38 | 1 | public function endPage(): void |
|
39 | { |
||
40 | 1 | $this->eventDispatcher->dispatch(new PageEnd($this)); |
|
41 | |||
42 | 1 | ob_end_flush(); |
|
43 | 1 | } |
|
44 | |||
45 | 6 | protected function createBeforeRenderEvent(string $viewFile, array $parameters): StoppableEventInterface |
|
46 | { |
||
47 | 6 | return new BeforeRender($this, $viewFile, $parameters); |
|
48 | } |
||
49 | |||
50 | 6 | protected function createAfterRenderEvent( |
|
56 | } |
||
57 | } |
||
58 |