| 1 | <?php |
||
| 19 | trait IsTraversable |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | protected $traversable = true; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Is this object traversable? |
||
| 28 | * |
||
| 29 | * @return bool |
||
| 30 | */ |
||
| 31 | public function isTraversable() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Traverse this object with given callback. |
||
| 38 | * Loops over this object, passing each iteration to callback function. Return false at any time from callback to exit loop and return false. |
||
|
|
|||
| 39 | * |
||
| 40 | * @param callable $callback |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | public function traverse(callable $callback) |
||
| 56 | } |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.