public function boot(Server $server, Logger $logger) { $this->logger = $logger; if ($this->showActionWarning) { $logger->warning("No actions registered for \$host yet, be sure to add them before injecting Host to AcmeHost for best performance."); } $server->attach(new StartEvent($this->onBoot)); }
public function boot(Server $server, PsrLogger $logger) { $server->attach($this); $this->bootLoader = static function (Bootable $bootable) use($server, $logger) { $booted = $bootable->boot($server, $logger); if ($booted !== null && !$booted instanceof Middleware && !is_callable($booted)) { throw new \InvalidArgumentException("Any return value of " . get_class($bootable) . '::boot() must return an instance of Aerys\\Middleware and/or be callable'); } return $booted ?? $bootable; }; }
public function boot(Server $server, PsrLogger $logger) { $server->attach($this); }