Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
NullDisplayProvider | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
supports | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
createComponentFor | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Apie\HtmlBuilders\FieldDisplayProviders; |
3 | |
4 | use Apie\HtmlBuilders\Components\Resource\FieldDisplay\NullDisplay; |
5 | use Apie\HtmlBuilders\FieldDisplayBuildContext; |
6 | use Apie\HtmlBuilders\Interfaces\ComponentInterface; |
7 | use Apie\HtmlBuilders\Interfaces\FieldDisplayComponentProviderInterface; |
8 | |
9 | final class NullDisplayProvider implements FieldDisplayComponentProviderInterface |
10 | { |
11 | public function supports(mixed $object, FieldDisplayBuildContext $context): bool |
12 | { |
13 | return $object === null; |
14 | } |
15 | public function createComponentFor(mixed $object, FieldDisplayBuildContext $context): ComponentInterface |
16 | { |
17 | assert(null === $object); |
18 | return new NullDisplay(); |
19 | } |
20 | } |