/**
  * Return configuration model for the theme
  *
  * @param ThemePackage $themePackage
  * @return \Magento\Framework\Config\Theme
  */
 protected function _getConfigModel($themePackage)
 {
     $themeDir = $this->dirReadFactory->create($themePackage->getPath());
     if ($themeDir->isExist('theme.xml')) {
         $configContent = $themeDir->readFile('theme.xml');
     } else {
         $configContent = '';
     }
     return $this->themeConfigFactory->create(['configContent' => $configContent]);
 }
 /**
  * Return configuration model for themes
  *
  * @param string $configPath
  * @return \Magento\Framework\Config\Theme
  */
 protected function _getConfigModel($configPath)
 {
     $relativeConfigPath = $this->_directory->getRelativePath($configPath);
     $configContent = $this->_directory->isExist($relativeConfigPath) ? $this->_directory->readFile($relativeConfigPath) : null;
     return $this->themeConfigFactory->create(['configContent' => $configContent]);
 }