| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | class Filter implements ModifierInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var callable |
||
| 24 | */ |
||
| 25 | private $filter; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var PreOrder|TraverserInterface |
||
| 29 | */ |
||
| 30 | private $traverser; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Filter constructor. |
||
| 34 | */ |
||
| 35 | 2 | public function __construct(callable $filter, ?TraverserInterface $traverser = null) |
|
| 36 | { |
||
| 37 | 2 | $this->filter = $filter; |
|
| 38 | 2 | $this->traverser = $traverser ?? new PostOrder(); |
|
| 39 | 2 | } |
|
| 40 | |||
| 41 | 1 | public function modify(NodeInterface $tree): NodeInterface |
|
| 56 | } |
||
| 57 | } |
||
| 58 |