Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function __invoke() |
||
25 | { |
||
26 | /** @var Config $config */ |
||
27 | $config = $this->getServiceLocator()->get(Config::class); |
||
28 | $translations = $config->get('translation'); |
||
29 | |||
30 | $result = []; |
||
31 | $pattern = '<a rel="alternate" hreflang="%s" class="lang %s" href="?lang=%s">%s</a>'; |
||
32 | |||
33 | foreach ($translations as $key => $content) { |
||
34 | $result[] = sprintf($pattern, strtolower($key), strtolower($key), $key, $this->languageTextMapping[$key]); |
||
35 | } |
||
36 | |||
37 | return implode('', $result); |
||
38 | } |
||
39 | |||
40 | } |