@@ -151,7 +151,7 @@ public function getRoot() : Node {
151151 * @param callable|null $shouldDescendIntoChildrenFn
152152 * @return \Generator|Node[]|Token[]
153153 */
154- public function getDescendantNodesAndTokens (callable $ shouldDescendIntoChildrenFn = null ) {
154+ public function getDescendantNodesAndTokens (? callable $ shouldDescendIntoChildrenFn = null ) {
155155 // TODO - write unit tests to prove invariants
156156 // (concatenating all descendant Tokens should produce document, concatenating all Nodes should produce document)
157157 foreach ($ this ->getChildNodesAndTokens () as $ child ) {
@@ -176,7 +176,7 @@ public function getDescendantNodesAndTokens(callable $shouldDescendIntoChildrenF
176176 * @param callable|null $shouldDescendIntoChildrenFn
177177 * @return void
178178 */
179- public function walkDescendantNodesAndTokens (callable $ callback , callable $ shouldDescendIntoChildrenFn = null ) {
179+ public function walkDescendantNodesAndTokens (callable $ callback , ? callable $ shouldDescendIntoChildrenFn = null ) {
180180 // TODO - write unit tests to prove invariants
181181 // (concatenating all descendant Tokens should produce document, concatenating all Nodes should produce document)
182182 foreach (static ::CHILD_NAMES as $ name ) {
@@ -209,7 +209,7 @@ public function walkDescendantNodesAndTokens(callable $callback, callable $shoul
209209 * @param callable|null $shouldDescendIntoChildrenFn
210210 * @return \Generator|Node[]
211211 */
212- public function getDescendantNodes (callable $ shouldDescendIntoChildrenFn = null ) {
212+ public function getDescendantNodes (? callable $ shouldDescendIntoChildrenFn = null ) {
213213 foreach ($ this ->getChildNodes () as $ child ) {
214214 yield $ child ;
215215 if ($ shouldDescendIntoChildrenFn === null || $ shouldDescendIntoChildrenFn ($ child )) {
@@ -223,7 +223,7 @@ public function getDescendantNodes(callable $shouldDescendIntoChildrenFn = null)
223223 * @param callable|null $shouldDescendIntoChildrenFn
224224 * @return \Generator|Token[]
225225 */
226- public function getDescendantTokens (callable $ shouldDescendIntoChildrenFn = null ) {
226+ public function getDescendantTokens (? callable $ shouldDescendIntoChildrenFn = null ) {
227227 foreach ($ this ->getChildNodesAndTokens () as $ child ) {
228228 if ($ child instanceof Node) {
229229 if ($ shouldDescendIntoChildrenFn == null || $ shouldDescendIntoChildrenFn ($ child )) {
0 commit comments