/**
  * @param \EBT\ExtensionBuilder\Domain\Model\Extension $extension
  * @param array $propertyConfiguration
  * @return void
  */
 protected function setExtensionProperties(&$extension, $propertyConfiguration)
 {
     // name
     $extension->setName(trim($propertyConfiguration['name']));
     // description
     $extension->setDescription($propertyConfiguration['description']);
     // extensionKey
     $extension->setExtensionKey(trim($propertyConfiguration['extensionKey']));
     // vendorName
     $extension->setVendorName(trim($propertyConfiguration['vendorName']));
     if (!empty($propertyConfiguration['emConf']['sourceLanguage'])) {
         $extension->setSourceLanguage($propertyConfiguration['emConf']['sourceLanguage']);
     }
     if ($propertyConfiguration['emConf']['disableVersioning']) {
         $extension->setSupportVersioning(false);
     }
     if ($propertyConfiguration['emConf']['disableLocalization']) {
         $extension->setSupportLocalization(false);
     }
     if (!empty($propertyConfiguration['emConf']['skipGenerateDocumentationTemplate'])) {
         $extension->setGenerateDocumentationTemplate(false);
     }
     // various extension properties
     $extension->setVersion($propertyConfiguration['emConf']['version']);
     if (!empty($propertyConfiguration['emConf']['dependsOn'])) {
         $dependencies = array();
         $lines = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $propertyConfiguration['emConf']['dependsOn']);
         foreach ($lines as $line) {
             if (strpos($line, '=>')) {
                 list($extensionKey, $version) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=>', $line);
                 $dependencies[$extensionKey] = $version;
             }
         }
         $extension->setDependencies($dependencies);
     }
     if (!empty($propertyConfiguration['emConf']['targetVersion'])) {
         $extension->setTargetVersion(floatval($propertyConfiguration['emConf']['targetVersion']));
     }
     if (!empty($propertyConfiguration['emConf']['custom_category'])) {
         $category = $propertyConfiguration['emConf']['custom_category'];
     } else {
         $category = $propertyConfiguration['emConf']['category'];
     }
     $extension->setCategory($category);
     // state
     $state = 0;
     switch ($propertyConfiguration['emConf']['state']) {
         case 'alpha':
             $state = \EBT\ExtensionBuilder\Domain\Model\Extension::STATE_ALPHA;
             break;
         case 'beta':
             $state = \EBT\ExtensionBuilder\Domain\Model\Extension::STATE_BETA;
             break;
         case 'stable':
             $state = \EBT\ExtensionBuilder\Domain\Model\Extension::STATE_STABLE;
             break;
         case 'experimental':
             $state = \EBT\ExtensionBuilder\Domain\Model\Extension::STATE_EXPERIMENTAL;
             break;
         case 'test':
             $state = \EBT\ExtensionBuilder\Domain\Model\Extension::STATE_TEST;
             break;
     }
     $extension->setState($state);
     if (!empty($propertyConfiguration['originalExtensionKey'])) {
         // handle renaming of extensions
         // original extensionKey
         $extension->setOriginalExtensionKey($propertyConfiguration['originalExtensionKey']);
         \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Extension setOriginalExtensionKey:' . $extension->getOriginalExtensionKey(), 'extbase', 0, $propertyConfiguration);
     }
     if (!empty($propertyConfiguration['originalExtensionKey']) && $extension->getOriginalExtensionKey() != $extension->getExtensionKey()) {
         $settings = $this->configurationManager->getExtensionSettings($extension->getOriginalExtensionKey());
         // if an extension was renamed, a new extension dir is created and we
         // have to copy the old settings file to the new extension dir
         copy($this->configurationManager->getSettingsFile($extension->getOriginalExtensionKey()), $this->configurationManager->getSettingsFile($extension->getExtensionKey()));
     } else {
         $settings = $this->configurationManager->getExtensionSettings($extension->getExtensionKey());
     }
     if (!empty($settings)) {
         $extension->setSettings($settings);
         \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Extension settings:' . $extension->getExtensionKey(), 'extbase', 0, $extension->getSettings());
     }
 }