lithium\test\Mocker::_filter()

protected static method
This method is deprecated.

Executes a set of filters against a method by taking a method's main implementation as a callback, and iteratively wrapping the filters around it.

Parameters

  • string $class

    Fully namespaced class to apply filters.

  • string|array $method

    The name of the method being executed, or an array containing the name of the class that defined the method, and the method name.

  • array $params

    An associative array containing all the parameters passed into the method.

  • \Closure $callback

    The method's implementation, wrapped in a closure.

  • array $filters

    Additional filters to apply to the method for this call only.

Returns

mixed

Source

	protected static function _filter($class, $method, $params, $callback, $filters = []) {
		$message  = '`' . __METHOD__ . '()` has been deprecated in favor of ';
		$message .= '`\lithium\aop\Filters::run()` and `::apply()`.';
		trigger_error($message, E_USER_DEPRECATED);

		$class = get_called_class();

		foreach ($filters as $filter) {
			Filters::apply($class, $method, $filter);
		}
		return Filters::run($class, $method, $params, $callback);
	}