/** * Create a new apllication from scratch * @param KernelInterface $application * @return KernelInterface */ public function createApplication(KernelInterface $application) { $bootstrap = $this->getBootstrap(); if ($application->getContainer() === null) { $application->setContainer($bootstrap->getContainer()); } if ($application->getConfig() === null) { $application->setConfig($bootstrap->getConfig()); } if ($application->getStrategy() === null) { $application->setStrategy($application->getContainer()->has(StrategyInterface::class) ? $application->getContainer()->get(StrategyInterface::class) : new MvcStrategy()); } if ($bootstrap instanceof Bootstrap) { $bootstrap->addService(KernelInterface::class, $application); } return $application; }