src/DateRange.php
public function days()
    {
        if ($this->isOpenEnded() || $this->isOpenStarted()) {
            throw new Exception('The number of days within a range cannot be calculated for ranges that are open ended or open started.');
        }

        return $this->after->diffInDays($this->before);
    }
public function days()
    {
        if ($this->isOpenEnded() || $this->isOpenStarted()) {
            throw new Exception('The number of days within a range cannot be calculated for ranges that are open ended or open started.');
        }

        return $this->after->diffInDays($this->before);
    }
public function days ( ) { if ( $ this -> isOpenEnded ( ) || $ this -> isOpenStarted ( ) ) { throw new Exception ( 'The number of days within a range cannot be calculated for ranges that are open ended or open started.' ) ; } return $ this -> after -> diffInDays ( $ this -> before ) ; }
Gets the number of days that a date range spans.

This is not possible, for obvious reasons, on open ended or open start date ranges.

@throws Exception

@return int
Gets the number of days that a date range spans .