public static function validateType($typeName)
    {
        if (substr($typeName, -2) == "[]") {
            return self::validateNamingConvention(substr($typeName, 0, -2)) . "[]";
        }

        switch (strtolower($typeName)) {
            case "int":
            case "integer":
            case "long":
            case "byte":
            case "short":
            case "negativeinteger":
            case "nonnegativeinteger":
            case "nonpositiveinteger":
            case "positiveinteger":
            case "unsignedbyte":
            case "unsignedint":
            case "unsignedlong":
            case "unsignedshort":
                return 'int';
                break;
            case "float":
            case "double":
            case "decimal":
                return 'float';
                break;
            case "<anyxml>":
            case "string":
            case "token":
            case "normalizedstring":
            case "hexbinary":
                return 'string';
                break;
            case "datetime":
                return  '\DateTime';
                break;
            default:
                $typeName = self::validateNamingConvention($typeName);
                break;
        }

        if (self::isKeyword($typeName)) {
            $typeName .= self::NAME_SUFFIX;
        }

        return $typeName;
    }
public static function validateType($typeName)
    {
        if (substr($typeName, -2) == "[]") {
            return self::validateNamingConvention(substr($typeName, 0, -2)) . "[]";
        }

        switch (strtolower($typeName)) {
            case "int":
            case "integer":
            case "long":
            case "byte":
            case "short":
            case "negativeinteger":
            case "nonnegativeinteger":
            case "nonpositiveinteger":
            case "positiveinteger":
            case "unsignedbyte":
            case "unsignedint":
            case "unsignedlong":
            case "unsignedshort":
                return 'int';
                break;
            case "float":
            case "double":
            case "decimal":
                return 'float';
                break;
            case "<anyxml>":
            case "string":
            case "token":
            case "normalizedstring":
            case "hexbinary":
                return 'string';
                break;
            case "datetime":
                return  '\DateTime';
                break;
            default:
                $typeName = self::validateNamingConvention($typeName);
                break;
        }

        if (self::isKeyword($typeName)) {
            $typeName .= self::NAME_SUFFIX;
        }

        return $typeName;
    }
public static function validateType ( $ typeName ) { if ( substr ( $ typeName , - 2 ) == "[]" ) { return self :: validateNamingConvention ( substr ( $ typeName , 0 , - 2 ) ) . "[]" ; } switch ( strtolower ( $ typeName ) ) { case "int" : case "integer" : case "long" : case "byte" : case "short" : case "negativeinteger" : case "nonnegativeinteger" : case "nonpositiveinteger" : case "positiveinteger" : case "unsignedbyte" : case "unsignedint" : case "unsignedlong" : case "unsignedshort" : return 'int' ; break ; case "float" : case "double" : case "decimal" : return 'float' ; break ; case "<anyxml>" : case "string" : case "token" : case "normalizedstring" : case "hexbinary" : return 'string' ; break ; case "datetime" : return '\DateTime' ; break ; default : $ typeName = self :: validateNamingConvention ( $ typeName ) ; break ; } if ( self :: isKeyword ( $ typeName ) ) { $ typeName .= self :: NAME_SUFFIX ; } return $ typeName ; }
Validates a wsdl type against known PHP primitive types, or otherwise
validates the namespace of the type to PHP naming conventions

@param string $typeName the type to test
@return string the validated version of the submitted type
Validates a wsdl type against known PHP primitive types or otherwise validates the namespace of the type to PHP naming conventions