| Conditions | 5 |
| Paths | 7 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function renderNamespaceAttributes(OpenGraphInterface $graph, $withTag = true) |
||
| 29 | { |
||
| 30 | $namespaces = $graph->getNamespaces(); |
||
| 31 | if (empty($namespaces)) { |
||
| 32 | return ''; |
||
| 33 | } |
||
| 34 | |||
| 35 | $attributes = ''; |
||
| 36 | foreach ($namespaces as $prefix => $uri) { |
||
| 37 | if (!empty($attributes)) { |
||
| 38 | $attributes .= ' '; |
||
| 39 | } |
||
| 40 | |||
| 41 | $attributes .= sprintf('%s: %s', $prefix, $uri); |
||
| 42 | } |
||
| 43 | |||
| 44 | if ($withTag) { |
||
| 45 | $attributes = sprintf('prefix="%s"', $attributes); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $attributes; |
||
| 49 | } |
||
| 50 | |||
| 81 |