Skip to content

Commit b6fb023

Browse files
committed
Use callable to be consistent, fix typo in documentation
1 parent c13af9d commit b6fb023

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Node.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,14 @@ public function getDescendantNodesAndTokens(callable $shouldDescendIntoChildrenF
172172

173173
/**
174174
* Iterate over all descendant Nodes and Tokens, calling $callback.
175-
* This can often be faster than getDescendantNodesAndTokens if you just need to call something and don't be a generator.
175+
* This can often be faster than getDescendantNodesAndTokens
176+
* if you just need to call something and don't need a generator.
176177
*
177178
* @param callable $callback a callback that accepts Node|Token
178179
* @param callable|null $shouldDescendIntoChildrenFn
179180
* @return void
180181
*/
181-
public function walkDescendantNodesAndTokens(\Closure $callback, callable $shouldDescendIntoChildrenFn = null) {
182+
public function walkDescendantNodesAndTokens(callable $callback, callable $shouldDescendIntoChildrenFn = null) {
182183
// TODO - write unit tests to prove invariants
183184
// (concatenating all descendant Tokens should produce document, concatenating all Nodes should produce document)
184185
foreach (static::CHILD_NAMES as $name) {

0 commit comments

Comments
 (0)