Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
64 | public function toArray(): array |
||
65 | { |
||
66 | $array = [ |
||
67 | '_namespace' => static::NAMESPACE_NAME, |
||
68 | '_element' => 'link', |
||
69 | 'link' => [] |
||
70 | ]; |
||
71 | |||
72 | foreach ($this->getHrefLangs() as $hreflang => $href) { |
||
73 | $array['link'][] = [ |
||
74 | '_attributes' => [ |
||
75 | 'rel' => 'alternate', |
||
76 | 'hreflang' => $hreflang, |
||
77 | 'href' => $href |
||
78 | ] |
||
79 | ]; |
||
80 | } |
||
81 | |||
82 | return $array; |
||
83 | } |
||
97 |