Exemplo n.º 1
0
 /**
  * Adds a filter to the filter chain
  *
  * The filter param could be a known filter alias, a FQ FilterInterface
  * class name or an object implementing FilterInterface.
  *
  * @param string|FilterInterface $filter
  *
  * @return self|$this|FilterAwareInterface
  *
  * @throws InvalidArgumentException If the provided filter is an unknown
  *      filter alias or not a valid class name or the object passed
  *      does not implement the FilterInterface interface.
  */
 public function addFilter($filter)
 {
     try {
         $this->getFilterChain()->add(StaticFilter::create($filter));
     } catch (FilterException $caught) {
         throw new InvalidArgumentException($caught->getMessage(), 0, $caught);
     }
     return $this;
 }