Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function expand(ContainerInterface $container)
 {
     return $container->create($this->class, $this->args);
 }