diff --git a/src/DiDom/Document.php b/src/DiDom/Document.php index ca032de..ac1f12c 100644 --- a/src/DiDom/Document.php +++ b/src/DiDom/Document.php @@ -251,7 +251,7 @@ public function preserveWhiteSpace(bool $value = true): self * @throws InvalidArgumentException if parameter 4 is not an integer or null * @throws RuntimeException if the document type is invalid (not Document::TYPE_HTML or Document::TYPE_XML) */ - public function load(string $string, bool $isFile = false, string $type = Document::TYPE_HTML, int $options = null): void + public function load(string $string, bool $isFile = false, string $type = Document::TYPE_HTML, ?int $options = null): void { if ( ! in_array(strtolower($type), [Document::TYPE_HTML, Document::TYPE_XML], true)) { throw new RuntimeException(sprintf('Document type must be "xml" or "html", %s given.', $type)); diff --git a/src/DiDom/Element.php b/src/DiDom/Element.php index 434cff1..dc4a563 100644 --- a/src/DiDom/Element.php +++ b/src/DiDom/Element.php @@ -281,7 +281,7 @@ public function attr(string $name, ?string $value = null) * * @return array|null */ - public function attributes(array $names = null): ?array + public function attributes(?array $names = null): ?array { if ( ! $this->node instanceof DOMElement) { return null;