src/Resolvers/FilterResolver.php
public function setFilter($key, $callable)
    {
        if (!is_callable($callable)) {
            throw new InvalidArgumentException('Invalid callable for filter: "'.$key.'"');
        }
        if (!preg_match('/^'.self::KEY_REGEX.'$/', $key)) {
            throw new InvalidArgumentException('Invalid name for filter: "'.$key.'". The filter name can only contain alphanumeric characters and underscore.');
        }

        $this->filters[$key] = $callable;

        return $this;

    }
public function setFilter($key, $callable)
    {
        if (!is_callable($callable)) {
            throw new InvalidArgumentException('Invalid callable for filter: "'.$key.'"');
        }
        if (!preg_match('/^'.self::KEY_REGEX.'$/', $key)) {
            throw new InvalidArgumentException('Invalid name for filter: "'.$key.'". The filter name can only contain alphanumeric characters and underscore.');
        }

        $this->filters[$key] = $callable;

        return $this;

    }
public function setFilter ( $ key , $ callable ) { if ( ! is_callable ( $ callable ) ) { throw new InvalidArgumentException ( 'Invalid callable for filter: "' . $ key . '"' ) ; } if ( ! preg_match ( '/^' . self :: KEY_REGEX . '$/' , $ key ) ) { throw new InvalidArgumentException ( 'Invalid name for filter: "' . $ key . '". The filter name can only contain alphanumeric characters and underscore.' ) ; } $ this -> filters [ $ key ] = $ callable ; return $ this ; }
Map a filter to a callable
@param string $key
@param callable $callable
@return FilterResolver
@throws InvalidArgumentException
Map a filter to a callable