settings = $settings; } public function getSetting(string $key) { return $this->settings[$key]; } public function injectModules(IModulesProvider $provider): void { // Так сделано для предотвращения проблем с циклической зависимостью $this->modulesProvider = $provider; } public function getModulesProvider(): IModulesProvider { return $this->modulesProvider; } public function getApplicationFactory(): AppFactory { if ($this->appFactory) { return $this->appFactory; } $this->appFactory = new AppFactory(); $this->appFactory->setModuleFactory($this); return $this->appFactory; } public function getInfrastructureFactory(): InfrastructureFactory { if ($this->infrastructureFactory) { return $this->infrastructureFactory; } $this->infrastructureFactory = new InfrastructureFactory(); $this->infrastructureFactory->setModuleFactory($this); return $this->infrastructureFactory; } public function getDtoFactory(): DtoFactory { if ($this->dtoFactory) { return $this->dtoFactory; } $this->dtoFactory = new DtoFactory; $this->dtoFactory->setModuleFactory($this); return $this->dtoFactory; } }