Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
88.89% |
8 / 9 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| IconHandler | |
88.89% |
8 / 9 |
|
0.00% |
0 / 1 |
2.01 | |
0.00% |
0 / 1 |
| resolve | |
88.89% |
8 / 9 |
|
0.00% |
0 / 1 |
2.01 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Node\Schema; |
| 6 | |
| 7 | class IconHandler extends Handler |
| 8 | { |
| 9 | public function resolve(object $meta, string $nodeClass): array |
| 10 | { |
| 11 | $id = trim((string) $meta->id); |
| 12 | |
| 13 | if ($id === '') { |
| 14 | return ['icon' => null]; |
| 15 | } |
| 16 | |
| 17 | return [ |
| 18 | 'icon' => [ |
| 19 | 'id' => $id, |
| 20 | 'args' => $meta->args, |
| 21 | ], |
| 22 | ]; |
| 23 | } |
| 24 | } |