| Total Complexity | 6 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class RemoveNullNode implements ModifierInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var \loophp\phptree\Traverser\PreOrder|\loophp\phptree\Traverser\TraverserInterface |
||
| 18 | */ |
||
| 19 | private $traverser; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * RemoveNullNode constructor. |
||
| 23 | * |
||
| 24 | * @param \loophp\phptree\Traverser\TraverserInterface|null $traverser |
||
| 25 | */ |
||
| 26 | 10 | public function __construct(?TraverserInterface $traverser = null) |
|
| 27 | { |
||
| 28 | 10 | $this->traverser = $traverser ?? new PostOrder(); |
|
| 29 | 10 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | 7 | public function modify(NodeInterface $tree): NodeInterface |
|
| 55 | } |
||
| 56 | } |
||
| 57 |