| @@ -39,15 +39,15 @@ | ||
| 39 | 39 | * @param string|null $method The method to use for the link (GET by default) |
| 40 | 40 | * |
| 41 | 41 | * @throws \InvalidArgumentException if the node is not a link |
| 42 | 42 | */ |
| 43 | - public function __construct(\DOMElement $node, string $currentUri = null, ?string $method = 'GET') | |
| 43 | + public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = 'GET') | |
| 44 | 44 | { |
| 45 | 45 | $this->setNode($node); |
| 46 | 46 | $this->method = $method ? strtoupper($method) : null; |
| 47 | 47 | $this->currentUri = $currentUri; |
| 48 | 48 | |
| 49 | - $elementUriIsRelative = null === parse_url(trim($this->getRawUri()), \PHP_URL_SCHEME); | |
| 49 | + $elementUriIsRelative = !parse_url(trim($this->getRawUri()), \PHP_URL_SCHEME); | |
| 50 | 50 | $baseUriIsAbsolute = null !== $this->currentUri && \in_array(strtolower(substr($this->currentUri, 0, 4)), ['http', 'file']); |
| 51 | 51 | if ($elementUriIsRelative && !$baseUriIsAbsolute) { |
| 52 | 52 | throw new \InvalidArgumentException(sprintf('The URL of the element is relative, so you must define its base URI passing an absolute URL to the constructor of the "%s" class ("%s" was passed).', __CLASS__, $this->currentUri)); |
| 53 | 53 | } |