PHP Class Wsdl2PhpGenerator\Validator

Afficher le fichier Open project: wsdl2phpgenerator/wsdl2phpgenerator Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

validateClass() public static méthode

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
Résultat string The validated version of the submitted class name

validateConstant() public static méthode

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

validateOperation() public static méthode

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

validateType() public static méthode

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
Résultat string the validated version of the submitted type

validateTypeHint() public static méthode

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.
Résultat null | string Returns a valid type hint for the type or null if there is no valid type hint.

validateUnique() public static méthode

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.
Résultat string A unique name.