original_string: public static function validateName($name)
      {
          if (null !== $name && !\is_string($name) && !\is_int($name)) {
              throw new UnexpectedTypeException($name, 'string, integer or null');
          }
  
          if (!self::isValidName($name)) {
              throw new InvalidArgumentException(sprintf('The name "%s" contains illegal characters. Names should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":").', $name));
          }
      }
code: public static function validateName($name)
      {
          if (null !== $name && !\is_string($name) && !\is_int($name)) {
              throw new UnexpectedTypeException($name, 'string, integer or null');
          }
  
          if (!self::isValidName($name)) {
              throw new InvalidArgumentException(sprintf('The name "%s" contains illegal characters. Names should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":").', $name));
          }
      }
code_tokens: public static function validateName ( $ name ) { if ( null !== $ name && ! \ is_string ( $ name ) && ! \ is_int ( $ name ) ) { throw new UnexpectedTypeException ( $ name , 'string, integer or null' ) ; } if ( ! self :: isValidName ( $ name ) ) { throw new InvalidArgumentException ( sprintf ( 'The name "%s" contains illegal characters. Names should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":").' , $ name ) ) ; } }
docstring: Validates whether the given variable is a valid form name.
  
  @param string|int|null $name The tested form name
  
  @throws UnexpectedTypeException  if the name is not a string or an integer
  @throws InvalidArgumentException if the name contains invalid characters
docstring_tokens: Validates whether the given variable is a valid form name .