Example #1
0
 /**
  * @param array $events
  */
 public function setExpectedEvents(array $events)
 {
     $this->occurredEvents = [];
     $this->expectedEvents = $events;
     $occurredEvents =& $this->occurredEvents;
     foreach ($events as $event) {
         $this->eventer->subscribe($event, function () use($event, &$occurredEvents) {
             $occurredEvents[] = $event;
         });
     }
 }
Example #2
0
File: App.php Project: weew/app
 /**
  * Shutdown App.
  */
 public function shutdown()
 {
     if (!$this->started) {
         return;
     }
     $this->started = false;
     $this->kernel->shutdown();
     $this->eventer->dispatch(new KernelShutdownEvent($this->kernel));
     $this->eventer->dispatch(new AppShutdownEvent($this));
 }
 /**
  * Set up lifecycle events for this provider.
  */
 protected function setUpEvents()
 {
     $this->eventer->subscribe(HandleHttpRequestEvent::class, [$this, 'handleHandleHttpRequestEvent']);
 }