original_string: public function getDay(Month $month, $dayNo)
      {
          $dayNo = (int) $dayNo;
  
          if (null === $this->dayProvider) {
              return new Day($month, $dayNo);
          }
  
          $day = $this->dayProvider->createDay($month, $dayNo);
  
          if (!$day instanceof DayInterface) {
              throw new DomainException(
                  '$day must be instance of BmCalendar\DayInterface; got '
                  . is_object($day) ? get_class($day) : gettype($day)
              );
          }
  
          if ($day->value() !== $dayNo) {
              throw new DomainException(
                  "The value of the day is wrong, it should be $dayNo but is actually "
                  . $day->value()
              );
          }
  
          if ($day->getMonth() !== $month) {
              throw new DomainException(
                  'The day returned from the day provider contains the wrong Month.'
              );
          }
  
          return $day;
      }
code: public function getDay(Month $month, $dayNo)
      {
          $dayNo = (int) $dayNo;
  
          if (null === $this->dayProvider) {
              return new Day($month, $dayNo);
          }
  
          $day = $this->dayProvider->createDay($month, $dayNo);
  
          if (!$day instanceof DayInterface) {
              throw new DomainException(
                  '$day must be instance of BmCalendar\DayInterface; got '
                  . is_object($day) ? get_class($day) : gettype($day)
              );
          }
  
          if ($day->value() !== $dayNo) {
              throw new DomainException(
                  "The value of the day is wrong, it should be $dayNo but is actually "
                  . $day->value()
              );
          }
  
          if ($day->getMonth() !== $month) {
              throw new DomainException(
                  'The day returned from the day provider contains the wrong Month.'
              );
          }
  
          return $day;
      }
code_tokens: public function getDay ( Month $ month , $ dayNo ) { $ dayNo = ( int ) $ dayNo ; if ( null === $ this -> dayProvider ) { return new Day ( $ month , $ dayNo ) ; } $ day = $ this -> dayProvider -> createDay ( $ month , $ dayNo ) ; if ( ! $ day instanceof DayInterface ) { throw new DomainException ( '$day must be instance of BmCalendar\DayInterface; got ' . is_object ( $ day ) ? get_class ( $ day ) : gettype ( $ day ) ) ; } if ( $ day -> value ( ) !== $ dayNo ) { throw new DomainException ( "The value of the day is wrong, it should be $dayNo but is actually " . $ day -> value ( ) ) ; } if ( $ day -> getMonth ( ) !== $ month ) { throw new DomainException ( 'The day returned from the day provider contains the wrong Month.' ) ; } return $ day ; }
docstring: Returns the requested day object.
  
  @param  Month $month
  @param  int   $dayNo
  @return DayInterface
docstring_tokens: Returns the requested day object .