We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 356119d commit b7c3704Copy full SHA for b7c3704
1 file changed
src/Model/F2Item/Links.php
@@ -24,11 +24,16 @@ public static function fromSimpleXMLElement(\SimpleXMLElement $sxe): static
24
/** @var \SimpleXMLElement[] $elements */
25
$elements = $sxe->Link;
26
foreach ($elements as $element) {
27
- // @mago-ignore analysis:invalid-type-cast
28
- /** @var Link $attributes */
29
- $attributes = (array) $element['@attributes'];
30
- if (array_key_exists('rel', $attributes)) {
31
- $links[$attributes['rel']] = $attributes;
+ $attributes = $element->attributes();
+ if (null === $attributes) {
+ continue;
+ }
+ $link = [];
32
+ foreach ($attributes as $key => $value) {
33
+ $attributes[$key] = (string) $value;
34
35
+ if (array_key_exists('rel', $link)) {
36
+ $links[$link['rel']] = $link;
37
}
38
39
0 commit comments