| Conditions | 2 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function renderBlock(array $attributes, string $content): string |
||
| 23 | { |
||
| 24 | $blockContentPlaceholder = <<<EOF |
||
| 25 | <div class="%s"> |
||
| 26 | %s |
||
| 27 | </div> |
||
| 28 | EOF; |
||
| 29 | $values = $attributes[self::ATTRIBUTE_NAME_VALUE] ?? []; |
||
| 30 | return sprintf( |
||
| 31 | $blockContentPlaceholder, |
||
| 32 | $this->getBlockClassName(), |
||
| 33 | $values ? |
||
| 34 | sprintf( |
||
| 35 | '<p><strong>%s</strong></p><ul><li><code>%s</code></li></ul>', |
||
| 36 | $this->getHeader(), |
||
| 37 | implode('</code></li><li><code>', $values) |
||
| 38 | ) : |
||
| 39 | sprintf( |
||
| 40 | '<em>%s</em>', |
||
| 41 | \__('(not set)', 'graphql-api') |
||
| 42 | ) |
||
| 48 |