Пример #1
0
 /**
  * filter
  *
  * @param mixed $name
  * @param mixed $options
  * @access public
  * @return mixed
  */
 public function filter($name, array $options = [])
 {
     if (static::EXT_FILTER === parent::filter($name, $options) and isset($this->filters[$name])) {
         $filter = new $this->filters[$name]($this, $options);
         $filter->run();
     }
 }
Пример #2
0
 /**
  * filter
  *
  * @param mixed $name
  * @param mixed $options
  * @access public
  * @return boolean|void
  */
 public function filter($name, array $options = [])
 {
     if (static::EXT_FILTER === parent::filter($name, $options) and isset($this->filters[$name])) {
         $filter = new $this->filters[$name]($this, $options);
         $filterResults = $filter->run();
         if (!empty($filterResults)) {
             $this->commands = array_merge($this->commands, (array) $filterResults);
         }
     }
 }