Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Markup | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __toString | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray; |
| 6 | |
| 7 | use Override; |
| 8 | use Stringable; |
| 9 | |
| 10 | /** |
| 11 | * HTML that is safe to print as is. Cosray's Boiler renderers trust this |
| 12 | * class, so templates print it without escaping it again. |
| 13 | */ |
| 14 | final readonly class Markup implements Stringable |
| 15 | { |
| 16 | public function __construct( |
| 17 | public string $html, |
| 18 | ) {} |
| 19 | |
| 20 | #[Override] |
| 21 | public function __toString(): string |
| 22 | { |
| 23 | return $this->html; |
| 24 | } |
| 25 | } |