示例#1
0
 /**
  * Start the console application
  * 
  * @return int 0 if everything went fine, or an error code
  */
 public function run()
 {
     $this->configuration->apply($this->injector);
     $application = $this->injector->make(ConsoleApplication::class);
     array_map(function ($command) use($application) {
         $application->add($this->injector->make($command));
     }, $this->commands->toArray());
     return $application->run();
 }
示例#2
0
 public function testSetObject()
 {
     $config = $this->getMock(ConfigurationInterface::class);
     $injector = $this->getMock(Injector::class);
     $config->expects($this->once())->method('apply')->with($injector);
     $set = new ConfigurationSet([$config]);
     $set->apply($injector);
 }
示例#3
0
 /**
  * Run the application
  *
  * @param string $runner
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function run($runner = 'Relay\\Relay')
 {
     $this->configuration->apply($this->injector);
     return $this->injector->share($this->middleware)->prepare('Equip\\Directory', $this->routing)->execute($runner);
 }
示例#4
0
 /**
  * Run the application
  *
  * @param string $runner
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function run($runner = Relay::class)
 {
     $this->configuration->apply($this->injector);
     return $this->injector->share($this->middleware)->prepare(Directory::class, $this->routing)->execute($runner);
 }