thomas-kl1/php-combine-conditions

View on GitHub
src/Node/AbstractNode.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare(strict_types=1);
/**
 * Copyright © Thomas Klein, All rights reserved.
 * See LICENSE bundled with this library for license details.
 */

namespace LogicTree\Node;

abstract class AbstractNode implements NodeInterface
{
    private ?CombineInterface $parent = null;

    public function getParent(): ?CombineInterface
    {
        return $this->parent;
    }

    public function setParent(?CombineInterface $combine): void
    {
        $this->parent = $combine;
    }

    public function hasParent(): bool
    {
        return $this->parent !== null;
    }
}