Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| Text | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| get_contents | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| execute | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Computator\FrameworkUtils\PHPTemplate\Templates; |
| 4 | |
| 5 | /** |
| 6 | * Plain text template. |
| 7 | * |
| 8 | * A plain text string template with no PHP execution. |
| 9 | */ |
| 10 | class Text extends Base { |
| 11 | public function __construct( |
| 12 | public readonly string $content, |
| 13 | ) {} |
| 14 | |
| 15 | public function get_contents(int $offset = 0, ?int $length = null): string { |
| 16 | return substr($this->content, $offset, $length); |
| 17 | } |
| 18 | |
| 19 | public function execute(array $context, mixed ...$controller_args): mixed { |
| 20 | echo $this->content; |
| 21 | return null; |
| 22 | } |
| 23 | } |