예제 #1
0
파일: Core.php 프로젝트: Trivivium/Cascade
 /**
  * Invokes the application.
  *
  * @param TaskInterface $task
  *
  * @return string
  */
 private function dispatch(TaskInterface $task) : string
 {
     $handler = $task->handler();
     $args = $task->args();
     $instance = $this->container->create($handler);
     $payload = $this->container->call([$instance, 'execute'], $args);
     return $payload;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function expand(ContainerInterface $container)
 {
     return $container->create($this->class, $this->args);
 }
예제 #3
0
파일: View.php 프로젝트: Trivivium/Cascade
 /**
  * Builds the view and executes the methods.
  *
  * @param string $class
  * @param array  $args
  *
  * @return mixed
  */
 private function build(string $class, array $args)
 {
     $instance = $this->container->create($class, $args);
     $payload = $this->container->call([$instance, 'execute'], $args);
     return $payload;
 }