j84reginato/my-eval

View on GitHub
src/Parsing/Operations/Conditional/ConditionOperationInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace MyEval\Parsing\Operations\Conditional;

use MyEval\Parsing\Nodes\Node;
use MyEval\Parsing\Nodes\Operand\BooleanNode;
use MyEval\Parsing\Nodes\Operator\InfixExpressionNode;

/**
 * Interface for construction of ConditionNode.
 */
interface ConditionOperationInterface
{
    /**
     * Factory method to create an ConditionNode with given operands and condition.
     *
     * @param InfixExpressionNode|BooleanNode $condition
     * @param Node                            $then
     * @param Node                            $else
     *
     * @return Node
     */
    public function makeNode(InfixExpressionNode|BooleanNode $condition, Node $then, Node $else): Node;
}