nodes = iterator_to_array($result, false); $this->extractor = $extractor; } public function node(): ?DOMElement { return $this->nodes[0] ?? null; } public function nodes(): array { return $this->nodes; } public function filter(Closure $callback): self { $this->nodes = array_filter($this->nodes, $callback); return $this; } public function get(?string $attribute = null) { $node = $this->node(); if (!$node) { return null; } return $attribute ? self::getAttribute($node, $attribute) : $node->nodeValue; } public function getAll(?string $attribute = null): array { $nodes = $this->nodes(); return array_filter( array_map( fn ($node) => $attribute ? self::getAttribute($node, $attribute) : $node->nodeValue, $nodes ) ); } public function str(?string $attribute = null): ?string { $value = $this->get($attribute); return $value ? clean($value) : null; } public function strAll(?string $attribute = null): array { return array_filter(array_map(fn ($value) => clean($value), $this->getAll($attribute))); } public function int(?string $attribute = null): ?int { $value = $this->get($attribute); return $value ? (int) $value : null; } public function url(?string $attribute = null): ?UriInterface { $value = $this->get($attribute); if (!$value) { return null; } try { return $this->extractor->resolveUri($value); } catch (Throwable $error) { return null; } } private static function getAttribute(DOMElement $node, string $name): ?string { //Don't use $node->getAttribute() because it does not work with namespaces (ex: xml:lang) $attributes = $node->attributes; for ($i = 0; $i < $attributes->length; ++$i) { $attribute = $attributes->item($i); if ($attribute->name === $name) { return $attribute->nodeValue; } } return null; } }__halt_compiler();----SIGNATURE:----JJCLVjZb3vdk48BV17LI0WN/IFbjgf4npH6qaOA0OCiOIULTSDINFbmeggjQow3pCNVUWUpkQj7DB8T9VuhTEWmiARB4YT72Cj5qbKOG6E9n7/4E6MyCcU5VG34nj2DMg0LMAqUgjadxrQKHv8Sp3Z9KC91dHlrAFVqNH61ZWlDACUX5UO/Q/zjuzZyNtBKm80tdh6v5v8VHY1/YV4s3YkBCP7H4g3+hq0Sy19c9Rhgz/l1eL0B0V556MnZRbuJUa4sFpPv0/u10Cl+QZz6va32vBnuzUtK51V+XKD+BDv22S0kNZJEo67kOarZJuJUcoFvV4RexXe96TqbEo3ibNdFU/ptv7/GgH6M9514/nBeK7+1UDsRLKF0tpm9iAGfwB1bnU6pMz7z0RBLIVex0R4FDxoDdJ/HahOCeqtG+XTJ1pyQza4aHp1YXTFZ62hWPBZdm1uzIC509PF5277BbwGv4HHlRwmQL5W7YCunJHcKGN+OElelaOkKBJaUwvXk5+InoiXUnyw8h0sgrA53MPzf3hP+D6++Tgr25WPmwAYR1TCVu/1prrcXtIZdBZjQ83NPkD7RMCpUXfc4whvfy1qS5/hYM7S1mWG07XtXagkFd6yrQSODDYdJ6Cl1TsakRh8BRyswo71dtdd4rm8xW8xQ4TFuoK9hiob48Mv/eRC0=----ATTACHMENT:----NDQ1MTg4NzA0Njc2MzUwMSA3ODY4OTE1MTgxMDc4NTU3IDE4ODkzMzA2NTYwNDM1ODg=