@@ -151,7 +151,7 @@ public function getRoot() : Node {
151
151
* @param callable|null $shouldDescendIntoChildrenFn
152
152
* @return \Generator|Node[]|Token[]
153
153
*/
154
- public function getDescendantNodesAndTokens (callable $ shouldDescendIntoChildrenFn = null ) {
154
+ public function getDescendantNodesAndTokens (? callable $ shouldDescendIntoChildrenFn = null ) {
155
155
// TODO - write unit tests to prove invariants
156
156
// (concatenating all descendant Tokens should produce document, concatenating all Nodes should produce document)
157
157
foreach ($ this ->getChildNodesAndTokens () as $ child ) {
@@ -176,7 +176,7 @@ public function getDescendantNodesAndTokens(callable $shouldDescendIntoChildrenF
176
176
* @param callable|null $shouldDescendIntoChildrenFn
177
177
* @return void
178
178
*/
179
- public function walkDescendantNodesAndTokens (callable $ callback , callable $ shouldDescendIntoChildrenFn = null ) {
179
+ public function walkDescendantNodesAndTokens (callable $ callback , ? callable $ shouldDescendIntoChildrenFn = null ) {
180
180
// TODO - write unit tests to prove invariants
181
181
// (concatenating all descendant Tokens should produce document, concatenating all Nodes should produce document)
182
182
foreach (static ::CHILD_NAMES as $ name ) {
@@ -209,7 +209,7 @@ public function walkDescendantNodesAndTokens(callable $callback, callable $shoul
209
209
* @param callable|null $shouldDescendIntoChildrenFn
210
210
* @return \Generator|Node[]
211
211
*/
212
- public function getDescendantNodes (callable $ shouldDescendIntoChildrenFn = null ) {
212
+ public function getDescendantNodes (? callable $ shouldDescendIntoChildrenFn = null ) {
213
213
foreach ($ this ->getChildNodes () as $ child ) {
214
214
yield $ child ;
215
215
if ($ shouldDescendIntoChildrenFn === null || $ shouldDescendIntoChildrenFn ($ child )) {
@@ -223,7 +223,7 @@ public function getDescendantNodes(callable $shouldDescendIntoChildrenFn = null)
223
223
* @param callable|null $shouldDescendIntoChildrenFn
224
224
* @return \Generator|Token[]
225
225
*/
226
- public function getDescendantTokens (callable $ shouldDescendIntoChildrenFn = null ) {
226
+ public function getDescendantTokens (? callable $ shouldDescendIntoChildrenFn = null ) {
227
227
foreach ($ this ->getChildNodesAndTokens () as $ child ) {
228
228
if ($ child instanceof Node) {
229
229
if ($ shouldDescendIntoChildrenFn == null || $ shouldDescendIntoChildrenFn ($ child )) {
0 commit comments