| Conditions | 3 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function render(Formatter $formatter, array $schema, string $role): ?string |
||
| 23 | { |
||
| 24 | $customProperties = \array_diff(\array_keys($schema), $this->exclude); |
||
| 25 | |||
| 26 | if ($customProperties === []) { |
||
| 27 | return null; |
||
| 28 | } |
||
| 29 | |||
| 30 | $rows = [ |
||
| 31 | \sprintf('%s:', $formatter->title('Custom props')), |
||
| 32 | ]; |
||
| 33 | |||
| 34 | foreach ($customProperties as $property) { |
||
| 35 | $data = $schema[$property] ?? null; |
||
| 36 | |||
| 37 | $rows[] = \sprintf( |
||
| 38 | '%s%s: %s', |
||
| 39 | $formatter->title(' '), |
||
| 40 | $property, |
||
| 41 | $formatter->typecast($this->printValue($data, $formatter)) |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | return \implode($formatter::LINE_SEPARATOR, $rows); |
||
| 46 | } |
||
| 64 |