Skip to content

Commit

Permalink
cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-rolland committed Feb 25, 2022
1 parent 916840c commit add52d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
5 changes: 3 additions & 2 deletions AdminSelfUpgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public function __construct()
(file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'index.php') &&
!@copy(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'index.php', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'index.php'))) {
$this->_errors[] = $this->trans('Unable to create the directory "%s"', [_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml'], 'Modules.Autoupgrade.Admin');

return;
}
}
Expand Down Expand Up @@ -431,7 +432,7 @@ public function postProcess()
parent::postProcess();
}

private function extractFieldsToBeSavedInDB(UpgradeConfiguration $fileConfig): array
private function extractFieldsToBeSavedInDB(UpgradeConfiguration $fileConfig)
{
$DBConfig = [];

Expand All @@ -451,7 +452,7 @@ private function extractFieldsToBeSavedInDB(UpgradeConfiguration $fileConfig): a
/**
* Process configuration values to be stored in database
*/
private function processDatabaseConfigurationFields(array $config): void
private function processDatabaseConfigurationFields(array $config)
{
if (isset($config['PS_DISABLE_OVERRIDES'])) {
foreach (Shop::getCompleteListOfShopsID() as $id_shop) {
Expand Down
1 change: 0 additions & 1 deletion classes/Twig/Form/FormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public function render($name, $fields, $tabname, $size, $icon)
$required = !empty($field['required']);
$disabled = !empty($field['disabled']);


if (in_array($key, UpgradeContainer::DB_CONFIG_KEYS)) {
// values fetched from configuration in database
$val = Configuration::get($key);
Expand Down
14 changes: 2 additions & 12 deletions classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
namespace PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader;

use Cache;
use PrestaShop\Module\AutoUpgrade\Log\LoggerInterface;
use Configuration;
use PrestaShop\Module\AutoUpgrade\Log\LoggerInterface;
use PrestaShop\Module\AutoUpgrade\UpgradeContainer;
use PrestaShop\Module\AutoUpgrade\UpgradeException;
use PrestaShop\Module\AutoUpgrade\UpgradeTools\ThemeAdapter;
Expand Down Expand Up @@ -244,17 +244,7 @@ protected function checkVersionIsNewer($oldVersion)
$versionCompare = version_compare($this->destinationUpgradeVersion, $oldVersion);

if ($versionCompare === -1) {
throw new UpgradeException(
$this->container->getTranslator()->trans('[ERROR] Version to install is too old.', [], 'Modules.Autoupgrade.Admin')
. ' ' .
$this->container->getTranslator()->trans(
'Current version: %oldversion%. Version to install: %newversion%.',
[
'%oldversion%' => $oldVersion,
'%newversion%' => $this->destinationUpgradeVersion,
],
'Modules.Autoupgrade.Admin'
));
throw new UpgradeException($this->container->getTranslator()->trans('[ERROR] Version to install is too old.', [], 'Modules.Autoupgrade.Admin') . ' ' . $this->container->getTranslator()->trans('Current version: %oldversion%. Version to install: %newversion%.', ['%oldversion%' => $oldVersion, '%newversion%' => $this->destinationUpgradeVersion], 'Modules.Autoupgrade.Admin'));
} elseif ($versionCompare === 0) {
throw new UpgradeException($this->container->getTranslator()->trans('You already have the %s version.', [$this->destinationUpgradeVersion], 'Modules.Autoupgrade.Admin'));
}
Expand Down

0 comments on commit add52d6

Please sign in to comment.