diff --git a/source/FluidXml/FluidContext.php b/source/FluidXml/FluidContext.php index 6f76e41..57b1595 100644 --- a/source/FluidXml/FluidContext.php +++ b/source/FluidXml/FluidContext.php @@ -155,7 +155,7 @@ public function __invoke(...$query): FluidContext return $this->query(...$query); } - public function times($times, callable $fn = null): FluidRepeater|static + public function times($times, ?callable $fn = null): FluidRepeater|static { if ($fn === null) { return new FluidRepeater($this->document, $this->handler, $this, $times); diff --git a/source/FluidXml/FluidInterface.php b/source/FluidXml/FluidInterface.php index 0bfc6e4..4ab140a 100644 --- a/source/FluidXml/FluidInterface.php +++ b/source/FluidXml/FluidInterface.php @@ -14,7 +14,7 @@ public function html($strip = false); public function save($file, $strip = false); public function query(...$query); public function __invoke(...$query); - public function times($times, callable $fn = null); + public function times($times, ?callable $fn = null); public function each(callable $fn); public function map(callable $fn); public function filter(callable $fn); diff --git a/source/FluidXml/FluidXml.php b/source/FluidXml/FluidXml.php index 1f8b11d..72cb906 100644 --- a/source/FluidXml/FluidXml.php +++ b/source/FluidXml/FluidXml.php @@ -207,7 +207,7 @@ protected function namespace_(...$arguments): static } public function query(...$query) { return $this->context()->query(...$query); } - public function times($times, callable $fn = null) { return $this->context()->times($times, $fn); } + public function times($times, ?callable $fn = null) { return $this->context()->times($times, $fn); } public function each(callable $fn) { return $this->context()->each($fn); } public function map(callable $fn) { return $this->context()->map($fn); } public function filter(callable $fn) { return $this->context()->filter($fn); }