public function unions(): self
    {
        $sequence = $this
            ->sorted([$this, 'sortByStartDate'])
            ->reduce([$this, 'calculateUnion'], new self())
        ;

        if ($sequence->intervals === $this->intervals) {
            return $this;
        }

        return $sequence;
    }
public function unions(): self
    {
        $sequence = $this
            ->sorted([$this, 'sortByStartDate'])
            ->reduce([$this, 'calculateUnion'], new self())
        ;

        if ($sequence->intervals === $this->intervals) {
            return $this;
        }

        return $sequence;
    }
public function unions ( ) : self { $ sequence = $ this -> sorted ( [ $ this , 'sortByStartDate' ] ) -> reduce ( [ $ this , 'calculateUnion' ] , new self ( ) ) ; if ( $ sequence -> intervals === $ this -> intervals ) { return $ this ; } return $ sequence ; }
Returns the unions inside the instance.
Returns the unions inside the instance .