PAGI\Node\Node::acceptInput PHP Method

acceptInput() protected method

Process a single digit input by the user. Changes the node state according to the digit entered (CANCEL, COMPLETE).
protected acceptInput ( string $digit ) : void
$digit string
return void
    protected function acceptInput($digit)
    {
        switch ($this->evaluateInput($digit)) {
            case self::INPUT_CANCEL:
                $this->state = self::STATE_CANCEL;
                break;
            case self::INPUT_END:
                $this->state = self::STATE_COMPLETE;
                break;
            default:
                $this->appendInput($digit);
                if ($this->minInput > 0 && $this->inputLengthIsAtLeast($this->minInput)) {
                    $this->state = self::STATE_COMPLETE;
                }
        }
    }