original_string: protected function prepareDateTime($value)
      {
          if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
              // Actually performing this conversion may not be an issue. Wait
              // until it is raised before making a decision.
              throw new \UnexpectedValueException(
                  "Incoming time zone {$value->getTimeZone()->getName()} did not match app time zone {$this->appTimeZone->getName()}"
              );
          }
          $value = clone $value;
          $value = $value->setTimeZone($this->dbTimeZone);
          if ($this->forceTime) {
              $value = $value->setTime(...$this->forceTime);
          }
          return $value;
      }
code: protected function prepareDateTime($value)
      {
          if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
              // Actually performing this conversion may not be an issue. Wait
              // until it is raised before making a decision.
              throw new \UnexpectedValueException(
                  "Incoming time zone {$value->getTimeZone()->getName()} did not match app time zone {$this->appTimeZone->getName()}"
              );
          }
          $value = clone $value;
          $value = $value->setTimeZone($this->dbTimeZone);
          if ($this->forceTime) {
              $value = $value->setTime(...$this->forceTime);
          }
          return $value;
      }
code_tokens: protected function prepareDateTime ( $ value ) { if ( $ this -> requireAppTimeZone && ! static :: timeZoneEqual ( $ value -> getTimeZone ( ) , $ this -> appTimeZone ) ) { // Actually performing this conversion may not be an issue. Wait // until it is raised before making a decision. throw new \ UnexpectedValueException ( "Incoming time zone {$value->getTimeZone()->getName()} did not match app time zone {$this->appTimeZone->getName()}" ) ; } $ value = clone $ value ; $ value = $ value -> setTimeZone ( $ this -> dbTimeZone ) ; if ( $ this -> forceTime ) { $ value = $ value -> setTime ( ... $ this -> forceTime ) ; } return $ value ; }
docstring: Don't type hint here - there's no common interface between DateTime and DateTimeImmutable
  at 5.6 that supports all the methods we are using, though both objects remain largely interchangeable.
docstring_tokens: Don t type hint here - there s no common interface between DateTime and DateTimeImmutable at 5 . 6 that supports all the methods we are using though both objects remain largely interchangeable .