/** * @return FactoryManager */ public function getFactoryManager() { if (!$this->started) { throw new LogicException('Puli was not started'); } if (!$this->factoryManager && $this->context instanceof ProjectContext) { $this->factoryManager = new FactoryManagerImpl($this->context, new DefaultGeneratorRegistry(), new ClassWriter()); // Don't set via the constructor to prevent cyclic dependencies $this->factoryManager->setPackages($this->getPackageManager()->getPackages()); $this->factoryManager->setServers($this->getServerManager()->getServers()); } return $this->factoryManager; }
/** * @return FactoryManager */ public function getFactoryManager() { if (!$this->started) { throw new LogicException('Puli was not started'); } if (!$this->factoryManager && $this->rootDir) { $this->factoryManager = new FactoryManagerImpl($this->environment, new DefaultGeneratorRegistry(), new ClassWriter()); // Don't set via the constructor to prevent a cyclic dependency $this->factoryManager->setServers($this->getServerManager()->getServers()); } return $this->factoryManager; }