original_string: public function transform($dateTime)
      {
          if (null === $dateTime) {
              return '';
          }
  
          if (!$dateTime instanceof \DateTimeInterface) {
              throw new TransformationFailedException('Expected a \DateTimeInterface.');
          }
  
          if (!$dateTime instanceof \DateTimeImmutable) {
              $dateTime = clone $dateTime;
          }
  
          $dateTime = $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
  
          return $dateTime->format($this->generateFormat);
      }
code: public function transform($dateTime)
      {
          if (null === $dateTime) {
              return '';
          }
  
          if (!$dateTime instanceof \DateTimeInterface) {
              throw new TransformationFailedException('Expected a \DateTimeInterface.');
          }
  
          if (!$dateTime instanceof \DateTimeImmutable) {
              $dateTime = clone $dateTime;
          }
  
          $dateTime = $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
  
          return $dateTime->format($this->generateFormat);
      }
code_tokens: public function transform ( $ dateTime ) { if ( null === $ dateTime ) { return '' ; } if ( ! $ dateTime instanceof \ DateTimeInterface ) { throw new TransformationFailedException ( 'Expected a \DateTimeInterface.' ) ; } if ( ! $ dateTime instanceof \ DateTimeImmutable ) { $ dateTime = clone $ dateTime ; } $ dateTime = $ dateTime -> setTimezone ( new \ DateTimeZone ( $ this -> outputTimezone ) ) ; return $ dateTime -> format ( $ this -> generateFormat ) ; }
docstring: Transforms a DateTime object into a date string with the configured format
  and timezone.
  
  @param \DateTimeInterface $dateTime A DateTimeInterface object
  
  @return string A value as produced by PHP's date() function
  
  @throws TransformationFailedException If the given value is not a \DateTimeInterface
docstring_tokens: Transforms a DateTime object into a date string with the configured format and timezone .