original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Checks the type of the provided parameter and returns the appropriate Year.
  
  @param  int|Year $year
  @return Year
  @throws InvalidArgumentException
docstring_tokens: Checks the type of the provided parameter and returns the appropriate Year .