Exemplo n.º 1
0
 /**
  * Configures hook.
  *
  * @param array $config
  * @return void
  */
 public function config($config = array())
 {
     if (empty($this->processors)) {
         $this->processors = array();
     }
     if (empty($config)) {
         return;
     }
     $defaults = array();
     if (!empty($config[0])) {
         if (empty($config['*'])) {
             $config['*'] = $config[0];
         }
         unset($config[0]);
     }
     if (!empty($config['*'])) {
         $defaults = $config['*'];
     }
     $processors = current(array_merge(array($this->Provider->getHook() => $defaults), $config));
     foreach ($processors as $processor) {
         $this->pushProcessor($processor);
     }
 }