PHP Class Wsdl2PhpGenerator\Validator

Show file Open project: wsdl2phpgenerator/wsdl2phpgenerator Class Usage Examples

Public Methods

Method Description
validateAttribute ( string $name ) : string Validates an attribute name against PHP naming conventions.
validateClass ( string $name, string $namespace = null ) : string Validates a class name against PHP naming conventions and already defined classes.
validateConstant ( string $name ) : string Validates a constant name against PHP naming conventions.
validateOperation ( string $name ) : string Validates an operation name against PHP naming conventions.
validateType ( string $typeName ) : string Validates a wsdl type against known PHP primitive types, or otherwise validates the namespace of the type to PHP naming conventions
validateTypeHint ( string $typeName ) : null | string Validates a type to be used as a method parameter type hint.
validateUnique ( $name, callable $function, string $suffix = null ) : string Validate that a name is unique.

Private Methods

Method Description
isKeyword ( string $string ) : boolean Checks if a string is a restricted keyword.
validateNamingConvention ( string $name ) : string Validates a name against standard PHP naming conventions

Method Details

validateAttribute() public static method

Validates an attribute name against PHP naming conventions.
public static validateAttribute ( string $name ) : string
$name string the name of the attribute to test
return string The validated version of the submitted attribute name

validateClass() public static method

Validates a class name against PHP naming conventions and already defined classes.
public static validateClass ( string $name, string $namespace = null ) : string
$name string the name of the class to test
$namespace string the name of the namespace
return string The validated version of the submitted class name

validateConstant() public static method

Validates a constant name against PHP naming conventions.
public static validateConstant ( string $name ) : string
$name string the name of the constant to test
return string The validated version of the submitted constant name

validateOperation() public static method

Validates an operation name against PHP naming conventions.
public static validateOperation ( string $name ) : string
$name string the name of the operation to test
return string The validated version of the submitted operation name

validateType() public static method

Validates a wsdl type against known PHP primitive types, or otherwise validates the namespace of the type to PHP naming conventions
public static validateType ( string $typeName ) : string
$typeName string the type to test
return string the validated version of the submitted type

validateTypeHint() public static method

Validates a type to be used as a method parameter type hint.
public static validateTypeHint ( string $typeName ) : null | string
$typeName string The name of the type to test.
return null | string Returns a valid type hint for the type or null if there is no valid type hint.

validateUnique() public static method

If a name is not unique then append a suffix and numbering.
public static validateUnique ( $name, callable $function, string $suffix = null ) : string
$name The name to test.
$function callable A callback which should return true if the element is unique. Otherwise false.
$suffix string A suffix to append between the name and numbering.
return string A unique name.