Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PresenterAbstract | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| getViewModel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| withContext | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace Phexium\Presentation; |
| 11 | |
| 12 | abstract class PresenterAbstract implements PresenterInterface |
| 13 | { |
| 14 | protected array|object $viewModel; |
| 15 | |
| 16 | protected ?PresentationContextInterface $context = null; |
| 17 | |
| 18 | public function getViewModel(): array|object |
| 19 | { |
| 20 | return $this->viewModel; |
| 21 | } |
| 22 | |
| 23 | public function withContext(PresentationContextInterface $context): static |
| 24 | { |
| 25 | $this->context = $context; |
| 26 | |
| 27 | return $this; |
| 28 | } |
| 29 | } |