src/Parser/IntervalParser.php
public function parse(string $expression): Interval
    {
        $parse = \explode(',', $expression);
        if (self::BOUNDARIES !== count($parse)) {
            throw new \ErrorException('Parse interval expression');
        }

        $startTerm = \reset($parse);
        $endTerm   = \end($parse);

        $startTerm = $this->parseStartTerm($startTerm);
        $endTerm   = $this->parseEndTerm($endTerm);

        return new Interval(
            $startTerm,
            $endTerm
        );
    }
public function parse(string $expression): Interval
    {
        $parse = \explode(',', $expression);
        if (self::BOUNDARIES !== count($parse)) {
            throw new \ErrorException('Parse interval expression');
        }

        $startTerm = \reset($parse);
        $endTerm   = \end($parse);

        $startTerm = $this->parseStartTerm($startTerm);
        $endTerm   = $this->parseEndTerm($endTerm);

        return new Interval(
            $startTerm,
            $endTerm
        );
    }
public function parse ( string $ expression ) : Interval { $ parse = \ explode ( ',' , $ expression ) ; if ( self :: BOUNDARIES !== count ( $ parse ) ) { throw new \ ErrorException ( 'Parse interval expression' ) ; } $ startTerm = \ reset ( $ parse ) ; $ endTerm = \ end ( $ parse ) ; $ startTerm = $ this -> parseStartTerm ( $ startTerm ) ; $ endTerm = $ this -> parseEndTerm ( $ endTerm ) ; return new Interval ( $ startTerm , $ endTerm ) ; }
Create a Interval from an expression
@param string $expression
@return Interval
@throws \InvalidArgumentException
@throws \UnexpectedValueException
@throws \RangeException
@throws \ErrorException
Create a Interval from an expression