Ejemplo n.º 1
0
 /**
  * Invoke an array of callables
  *
  * @param array $callbacks
  * @param array $parameters
  *
  * @return string
  */
 protected function invoke(array $callbacks = [], array $parameters = [])
 {
     $output = '';
     foreach ($callbacks as $callback) {
         // Invoke the callback with buffering enabled
         $output .= $this->invoker->call($callback, $parameters, true);
     }
     return $output;
 }
Ejemplo n.º 2
0
 /**
  * Determine if the filters pass for the event.
  *
  * @return boolean
  */
 public function filtersPass()
 {
     $invoker = new Invoker();
     foreach ($this->filters as $callback) {
         if (!$invoker->call($callback)) {
             return false;
         }
     }
     foreach ($this->rejects as $callback) {
         if ($invoker->call($callback)) {
             return false;
         }
     }
     return true;
 }