original_string: public static function dateDiff(DateTime $from = null, DateTime $to = null, string $format = 'Y-m-d H:i:s'): string
      {
          if (!$from) {
              return '';
          }
          if (!$to) { // if not define to then to date is set today
              $to = new DateTime();
          }
          return $from->diff($to)->format($format);
      }
code: public static function dateDiff(DateTime $from = null, DateTime $to = null, string $format = 'Y-m-d H:i:s'): string
      {
          if (!$from) {
              return '';
          }
          if (!$to) { // if not define to then to date is set today
              $to = new DateTime();
          }
          return $from->diff($to)->format($format);
      }
code_tokens: public static function dateDiff ( DateTime $ from = null , DateTime $ to = null , string $ format = 'Y-m-d H:i:s' ) : string { if ( ! $ from ) { return '' ; } if ( ! $ to ) { // if not define to then to date is set today $ to = new DateTime ( ) ; } return $ from -> diff ( $ to ) -> format ( $ format ) ; }
docstring: Date diff.
  
  @param DateTime|null $from
  @param DateTime|null $to
  @param string        $format
  @return string
  @throws \Exception
docstring_tokens: Date diff .