src/Type.php
public static function of(string $type): SpecificationInterface
    {
        if (\function_exists('is_'.$type)) {
            return new PrimitiveType($type);
        }

        if ($type === 'variable') {
            return new VariableType;
        }

        if ($type === 'mixed') {
            return new MixedType;
        }

        return new ClassType($type);
    }
public static function of(string $type): SpecificationInterface
    {
        if (\function_exists('is_'.$type)) {
            return new PrimitiveType($type);
        }

        if ($type === 'variable') {
            return new VariableType;
        }

        if ($type === 'mixed') {
            return new MixedType;
        }

        return new ClassType($type);
    }
public static function of ( string $ type ) : SpecificationInterface { if ( \ function_exists ( 'is_' . $ type ) ) { return new PrimitiveType ( $ type ) ; } if ( $ type === 'variable' ) { return new VariableType ; } if ( $ type === 'mixed' ) { return new MixedType ; } return new ClassType ( $ type ) ; }
Build the appropriate specification for the given type

@param string $type

@return SpecificationInterface
Build the appropriate specification for the given type