/**
* Static filtering.
*
* @param string $method Filter name
* @param array $params Parameters; the first value gets filtered, the rest will be used as constructor parameters
* @return mixed
*/
public static function __callStatic(string $method, array $params)
{
$factory = \Jyxo\Spl\ObjectCache::get(\Jyxo\Input\Factory::class) ?: \Jyxo\Spl\ObjectCache::set(\Jyxo\Input\Factory::class, new Factory());
$value = array_shift($params);
$key = 'Jyxo\\Input\\Filter\\' . ucfirst($method) . ($params ? '/' . serialize($params) : '');
$filter = \Jyxo\Spl\ObjectCache::get($key) ?: \Jyxo\Spl\ObjectCache::set($key, $factory->getFilterByName($method, $params));
/* @var $filter \Jyxo\Input\FilterInterface */
return $filter->filter($value);
}