| Conditions | 5 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function render(Formatter $formatter, array $schema, string $role): ?string |
||
| 28 | { |
||
| 29 | $keys = $schema[$this->key] ?? null; |
||
| 30 | |||
| 31 | $row = \sprintf('%s: ', $formatter->title($this->title)); |
||
| 32 | |||
| 33 | if ($keys === null || $keys === '' || $keys === []) { |
||
| 34 | return $this->required ? $row . $formatter->error('not defined') : null; |
||
| 35 | } |
||
| 36 | |||
| 37 | $keys = \array_map( |
||
| 38 | static fn (string $key) => $formatter->property($key), |
||
| 39 | (array)$keys |
||
| 40 | ); |
||
| 41 | |||
| 42 | return $row . \implode(', ', $keys); |
||
| 43 | } |
||
| 45 |