protected function yearOrYearNo($year)
    {
        if (is_scalar($year)) {
            return $this->getYear($year);
        }

        if (!$year instanceof Year) {
            throw new InvalidArgumentException(
                '$year must be an instance of BmCalendar\Year; got "' . get_class($year) . '"'
            );
        }

        return $year;
    }
protected function yearOrYearNo($year)
    {
        if (is_scalar($year)) {
            return $this->getYear($year);
        }

        if (!$year instanceof Year) {
            throw new InvalidArgumentException(
                '$year must be an instance of BmCalendar\Year; got "' . get_class($year) . '"'
            );
        }

        return $year;
    }
protected function yearOrYearNo ( $ year ) { if ( is_scalar ( $ year ) ) { return $ this -> getYear ( $ year ) ; } if ( ! $ year instanceof Year ) { throw new InvalidArgumentException ( '$year must be an instance of BmCalendar\Year; got "' . get_class ( $ year ) . '"' ) ; } return $ year ; }
Checks the type of the provided parameter and returns the appropriate Year.

@param  int|Year $year
@return Year
@throws InvalidArgumentException
Checks the type of the provided parameter and returns the appropriate Year .