private function substractOne(Sequence $sequence, Period $interval): self
    {
        if ($sequence->isEmpty()) {
            return $sequence;
        }

        $reducer = function (Sequence $sequence, Period $period) use ($interval) {
            $substract = $period->substract($interval);
            if (!$substract->isEmpty()) {
                $sequence->push(...$substract);
            }

            return $sequence;
        };

        return $sequence->reduce($reducer, new self());
    }
private function substractOne(Sequence $sequence, Period $interval): self
    {
        if ($sequence->isEmpty()) {
            return $sequence;
        }

        $reducer = function (Sequence $sequence, Period $period) use ($interval) {
            $substract = $period->substract($interval);
            if (!$substract->isEmpty()) {
                $sequence->push(...$substract);
            }

            return $sequence;
        };

        return $sequence->reduce($reducer, new self());
    }
private function substractOne ( Sequence $ sequence , Period $ interval ) : self { if ( $ sequence -> isEmpty ( ) ) { return $ sequence ; } $ reducer = function ( Sequence $ sequence , Period $ period ) use ( $ interval ) { $ substract = $ period -> substract ( $ interval ) ; if ( ! $ substract -> isEmpty ( ) ) { $ sequence -> push ( ... $ substract ) ; } return $ sequence ; } ; return $ sequence -> reduce ( $ reducer , new self ( ) ) ; }
Substract an Interval from a Sequence.
Substract an Interval from a Sequence .