src/Filter/Filters.php
public static function detach($context, $method = null)
    {
        if (func_num_args() === 2) {
            $value = static::_ref($context, $method);
        } else {
            $value = $context;
        }
        if (strpos($value, '|') !== false) {
            list($ref, $num) = explode('|', $value);
            if (!isset(static::$_filters[$ref][$num])) {
                throw new Exception("Unexisting `'{$value}'` filter id.");
            }
            $result = static::$_filters[$ref][$num];
            unset(static::$_filters[$ref][$num]);
        } else {
            if (!isset(static::$_filters[$value])) {
                throw new Exception("Unexisting `'{$value}'` filter reference id.");
            }
            $result = static::$_filters[$value];
            unset(static::$_filters[$value]);
        }
        return $result;
    }
public static function detach($context, $method = null)
    {
        if (func_num_args() === 2) {
            $value = static::_ref($context, $method);
        } else {
            $value = $context;
        }
        if (strpos($value, '|') !== false) {
            list($ref, $num) = explode('|', $value);
            if (!isset(static::$_filters[$ref][$num])) {
                throw new Exception("Unexisting `'{$value}'` filter id.");
            }
            $result = static::$_filters[$ref][$num];
            unset(static::$_filters[$ref][$num]);
        } else {
            if (!isset(static::$_filters[$value])) {
                throw new Exception("Unexisting `'{$value}'` filter reference id.");
            }
            $result = static::$_filters[$value];
            unset(static::$_filters[$value]);
        }
        return $result;
    }
public static function detach ( $ context , $ method = null ) { if ( func_num_args ( ) === 2 ) { $ value = static :: _ref ( $ context , $ method ) ; } else { $ value = $ context ; } if ( strpos ( $ value , '|' ) !== false ) { list ( $ ref , $ num ) = explode ( '|' , $ value ) ; if ( ! isset ( static :: $ _filters [ $ ref ] [ $ num ] ) ) { throw new Exception ( "Unexisting `'{$value}'` filter id." ) ; } $ result = static :: $ _filters [ $ ref ] [ $ num ] ; unset ( static :: $ _filters [ $ ref ] [ $ num ] ) ; } else { if ( ! isset ( static :: $ _filters [ $ value ] ) ) { throw new Exception ( "Unexisting `'{$value}'` filter reference id." ) ; } $ result = static :: $ _filters [ $ value ] ; unset ( static :: $ _filters [ $ value ] ) ; } return $ result ; }
Detaches a filter.

@param  object|string  $context An instance, a fully-namespaced class name or a filter id to detach.
@param  string         $method  The name of the method to remove filter on or none if a filter id
has been provided in `$context`.
@return Closure|array           Returns the removed closure if `$context` is a filter id. Otherwise it returns the
array of closures attached to the provided class/method reference.
Detaches a filter .