Esempio n. 1
0
 /**
  * @return callable
  */
 protected function send() : callable
 {
     return function ($next, $pipe) {
         $run = $this->app->getContainer()->make($pipe);
         return $run($this->request, function () use($next) {
             return $next;
         });
     };
 }
Esempio n. 2
0
 /**
  * Returns the definition to register in the container.
  *
  * Definitions must be indexed by their entry ID. For example:
  *
  *     return [
  *         'logger' => ...
  *         'mailer' => ...
  *     ];
  *
  * @return array
  */
 public function getDefinitions()
 {
     return [CommandBus::class => function () {
         return new TacticianBus($this->app->getContainer(), [new CommandHandlerMiddleware(new ClassNameExtractor(), new HandlerLocator($this->app->getContainer()), new HandleInflector())]);
     }];
 }
Esempio n. 3
0
 /**
  * @param Throwable $e
  * @param           $handler
  */
 private function handle(Throwable $e, $handler)
 {
     $handler = $this->app->getContainer()->make($handler);
     $handler->handle($e);
 }
Esempio n. 4
0
 /**
  * @return Request
  */
 protected function request() : Request
 {
     return $this->app->getContainer()->make(Request::class);
 }