diff --git a/Node/ElementNode.php b/Node/ElementNode.php index fbf8ea0..a188197 100644 --- a/Node/ElementNode.php +++ b/Node/ElementNode.php @@ -26,7 +26,7 @@ class ElementNode extends AbstractNode private $namespace; private $element; - public function __construct(string $namespace = null, string $element = null) + public function __construct(?string $namespace = null, ?string $element = null) { $this->namespace = $namespace; $this->element = $element; diff --git a/Node/SelectorNode.php b/Node/SelectorNode.php index 6e52b2f..cdb0e46 100644 --- a/Node/SelectorNode.php +++ b/Node/SelectorNode.php @@ -26,7 +26,7 @@ class SelectorNode extends AbstractNode private $tree; private $pseudoElement; - public function __construct(NodeInterface $tree, string $pseudoElement = null) + public function __construct(NodeInterface $tree, ?string $pseudoElement = null) { $this->tree = $tree; $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null; diff --git a/Parser/Parser.php b/Parser/Parser.php index d73489e..b0b6427 100644 --- a/Parser/Parser.php +++ b/Parser/Parser.php @@ -29,7 +29,7 @@ class Parser implements ParserInterface { private $tokenizer; - public function __construct(Tokenizer $tokenizer = null) + public function __construct(?Tokenizer $tokenizer = null) { $this->tokenizer = $tokenizer ?? new Tokenizer(); } diff --git a/XPath/Translator.php b/XPath/Translator.php index 8ce4730..3d3ac7a 100644 --- a/XPath/Translator.php +++ b/XPath/Translator.php @@ -48,7 +48,7 @@ class Translator implements TranslatorInterface private $pseudoClassTranslators = []; private $attributeMatchingTranslators = []; - public function __construct(ParserInterface $parser = null) + public function __construct(?ParserInterface $parser = null) { $this->mainParser = $parser ?? new Parser();