protected function getTypeSwapValue($type, $value)
    {
        switch (strtolower($type)) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            default:
                return $value;
        }
    }
protected function getTypeSwapValue($type, $value)
    {
        switch (strtolower($type)) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            default:
                return $value;
        }
    }
protected function getTypeSwapValue ( $ type , $ value ) { switch ( strtolower ( $ type ) ) { case 'int' : case 'integer' : return ( int ) $ value ; case 'real' : case 'float' : case 'double' : return ( float ) $ value ; case 'string' : return ( string ) $ value ; default : return $ value ; } }
Converts a given value to a given type value.

@param  string $type
@param  mixed  $value
@return mixed
Converts a given value to a given type value .