original_string: public function stringToDateTime($string)
  	{
  		$date = date_create($string);
  		$errors = \DateTime::getLastErrors();
  
  		if ($errors['warning_count'] > 0 || $errors['error_count'] > 0)
  			return null;
  
  		return new DateTime($date->format(static::$dateTimeFormat));
  	}
code: public function stringToDateTime($string)
  	{
  		$date = date_create($string);
  		$errors = \DateTime::getLastErrors();
  
  		if ($errors['warning_count'] > 0 || $errors['error_count'] > 0)
  			return null;
  
  		return new DateTime($date->format(static::$dateTimeFormat));
  	}
code_tokens: public function stringToDateTime ( $ string ) { $ date = date_create ( $ string ) ; $ errors = \ DateTime :: getLastErrors ( ) ; if ( $ errors [ 'warning_count' ] > 0 || $ errors [ 'error_count' ] > 0 ) return null ; return new DateTime ( $ date -> format ( static :: $ dateTimeFormat ) ) ; }
docstring: Converts a string representation of a datetime into a DateTime object.
  
  @param string $string A datetime in the form accepted by date_create()
  @return DateTime
docstring_tokens: Converts a string representation of a datetime into a DateTime object .