diff --git a/lib/traits/Moonwalk.php b/lib/traits/Moonwalk.php index f2d404e..f1a55f5 100644 --- a/lib/traits/Moonwalk.php +++ b/lib/traits/Moonwalk.php @@ -1,12 +1,19 @@ parentNode; if ($node !== null) { diff --git a/lib/traits/Walk.php b/lib/traits/Walk.php index 9b55c43..aa3345d 100644 --- a/lib/traits/Walk.php +++ b/lib/traits/Walk.php @@ -1,13 +1,19 @@ firstChild; if ($node !== null) { @@ -39,11 +45,12 @@ trait Walk { /** * Generator which just walks through a node's child nodes. Nonstandard. * - * @param ?\Closure $filter - A callback function used to filter - * @param bool $backwards - An optional setting that if true makes the generator walk backwards through the - * child nodes. + * @param ?\Closure $filter - An optional callback function used to filter; if not provided the generator will + * just yield every node. + * @param bool $backwards - An optional setting that if true makes the generator instead walk backwards + * through the child nodes. */ - public function walkShallow(?\Closure $filter = null, $backwards = false): \Generator { + public function walkShallow(?\Closure $filter = null, bool $backwards = false): \Generator { $node = (!$this instanceof TemplateElement) ? $this : $this->content; if (!$backwards) {