/** * {@inheritdoc} */ public function bootstrap(ContainerInterface $container, ErrorHandlerInterface $errors, EventEmitterInterface $events) { $this->handler->register(); $this->handler->start(); $this->accessor = new SessionAccessor(new \ArrayObject($_SESSION)); $this->control = new SessionControl($this->accessor); /* * Bind the accessor and control instance to the request * application wide. */ $container->bind($this->accessor, SessionAccessorInterface::class); $container->bind($this->control, SessionControlInterface::class); }
/** * Checks the return type of the controller payload * to determine how the response should be * interpreted. * * @param ResponseInterface $response * @param string $class * @param array $bindings * * @return ResponseInterface */ private function invokeView(ResponseInterface $response, string $class, array $bindings) : ResponseInterface { /** * @var ActionView $payload */ $instance = $this->container->create($class, $bindings); $payload = $this->container->call([$instance, 'execute'], [$response]); if (!$payload instanceof ResponseInterface) { return $this->transform($response, $payload); } return $payload; }
/** * {@inheritdoc} */ public function expand(ContainerInterface $container) { return $container->create($this->class, $this->args); }
/** * Bootstraps the application by running configurations specific for * the module. * * @param ContainerInterface $container * @param ErrorHandlerInterface $errors * @param EventEmitterInterface $events * * @return void */ public function bootstrap(ContainerInterface $container, ErrorHandlerInterface $errors, EventEmitterInterface $events) { $container->bind(new CookieAccessor($_COOKIE), CookieAccessorInterface::class); }