call() 공개 메소드

Call the given Closure with buffering support
public call ( $closure, array $parameters = [], $buffer = false ) : mixed
$parameters array
리턴 mixed
예제 #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;
 }
예제 #2
0
파일: Event.php 프로젝트: lavary/crunz
 /**
  * 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;
 }