Пример #1
0
 public function createInstallDescriber() : InstallDescriber
 {
     $describerClassName = $this->getModuleInfo()->getInstallDescriberClassName();
     if ($describerClassName === null) {
         throw new IllegalStateException('No install describer available.');
     }
     $describerClass = null;
     try {
         $describerClass = ReflectionUtils::createReflectionClass($describerClassName);
     } catch (TypeNotFoundException $e) {
         throw $this->createInvalidInstallDescriberException($e);
     }
     if (!$describerClass->implementsInterface(InstallDescriber::class)) {
         throw $this->createInvalidInstallDescriberException(new InvalidConfigurationException('InstallDescriber must implement interface ' . InstallDescriber::class . ': ' . $describerClass->getName()));
     }
     return $this->installDescriber = $describerClass->newInstance();
 }