src/Slushie/Middleware/Loader.php
protected function createBeforeFilter() {
    $before = $this->before;

    // closure that iterates over all before filters
    return function ($request) use ($before) {
      foreach ($before as $filter) {
        $response = $filter->onBefore($request);
        if (!is_null($response)) {
          return $response;
        }
      }

      return null;
    };
  }
protected function createBeforeFilter() {
    $before = $this->before;

    // closure that iterates over all before filters
    return function ($request) use ($before) {
      foreach ($before as $filter) {
        $response = $filter->onBefore($request);
        if (!is_null($response)) {
          return $response;
        }
      }

      return null;
    };
  }
protected function createBeforeFilter ( ) { $ before = $ this -> before ; // closure that iterates over all before filters return function ( $ request ) use ( $ before ) { foreach ( $ before as $ filter ) { $ response = $ filter -> onBefore ( $ request ) ; if ( ! is_null ( $ response ) ) { return $ response ; } } return null ; } ; }
Generate a callback function that iterates over
all BeforeInterface middleware.

@return callable
Generate a callback function that iterates over all BeforeInterface middleware .