From abe45b108674cc0ec276e3a7afae9cd9dc07c9de Mon Sep 17 00:00:00 2001 From: Jonathan Lelievre Date: Tue, 2 Nov 2021 15:34:18 +0100 Subject: [PATCH 1/6] Use GenerateThemeMailTemplatesCommand during upgrade instead of legacy removed Language::installEmailsLanguagePack function --- .../CoreUpgrader/CoreUpgrader17.php | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php index 1ab1de474..027daf4f3 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php @@ -30,6 +30,7 @@ use PrestaShop\Module\AutoUpgrade\UpgradeException; use PrestaShop\Module\AutoUpgrade\UpgradeTools\ThemeAdapter; use PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface; +use PrestaShop\PrestaShop\Core\Domain\MailTemplate\Command\GenerateThemeMailTemplatesCommand; use PrestaShop\PrestaShop\Core\Domain\Theme\Command\AdaptThemeToRTLLanguagesCommand; use PrestaShop\PrestaShop\Core\Domain\Theme\ValueObject\ThemeName; use PrestaShop\PrestaShop\Core\Exception\CoreException; @@ -83,7 +84,33 @@ protected function upgradeLanguage($lang) \Language::installSfLanguagePack($lang_pack['locale'], $errorsLanguage); if (!$this->container->getUpgradeConfiguration()->shouldKeepMails()) { - \Language::installEmailsLanguagePack($lang_pack, $errorsLanguage); + $mailTheme = \Configuration::get('PS_MAIL_THEME', null, null, null, 'modern'); + + $frontTheme = _THEME_NAME_; + $frontThemeMailsFolder = _PS_ALL_THEMES_DIR_ . $frontTheme . '/mails'; + $frontThemeModulesFolder = _PS_ALL_THEMES_DIR_ . $frontTheme . '/modules'; + + $generateCommand = new GenerateThemeMailTemplatesCommand( + $mailTheme, + $lang_pack['locale'], + true, + $frontThemeMailsFolder, + $frontThemeModulesFolder + ); + /** @var CommandBusInterface $commandBus */ + $commandBus = $this->container->get('prestashop.core.command_bus'); + + try { + $commandBus->handle($generateCommand); + } catch (CoreException $e) { + throw new UpgradeException( + $this->container->getTranslator()->trans( + 'Cannot generate email templates: %s.', + [$e->getMessage()], + 'Modules.Autoupgrade.Admin' + ) + ); + } } if (!empty($errorsLanguage)) { From 6ea0622c934bc8d5e5f4b7f86c8b216ecd1bd68d Mon Sep 17 00:00:00 2001 From: Jonathan Lelievre Date: Wed, 3 Nov 2021 10:32:42 +0100 Subject: [PATCH 2/6] Create new CoreUpgrade80 to handle backward compatibility regardless of the target version --- classes/TaskRunner/Upgrade/UpgradeDb.php | 9 +- .../CoreUpgrader/CoreUpgrader17.php | 29 +--- .../CoreUpgrader/CoreUpgrader80.php | 135 ++++++++++++++++++ 3 files changed, 143 insertions(+), 30 deletions(-) create mode 100644 classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php diff --git a/classes/TaskRunner/Upgrade/UpgradeDb.php b/classes/TaskRunner/Upgrade/UpgradeDb.php index c26ca0f9e..38975516a 100644 --- a/classes/TaskRunner/Upgrade/UpgradeDb.php +++ b/classes/TaskRunner/Upgrade/UpgradeDb.php @@ -31,6 +31,7 @@ use PrestaShop\Module\AutoUpgrade\UpgradeException; use PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader16; use PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader17; +use PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader80; use PrestaShop\Module\AutoUpgrade\UpgradeTools\SettingsFileWriter; class UpgradeDb extends AbstractTask @@ -59,11 +60,15 @@ public function run() public function getCoreUpgrader() { - if (version_compare($this->container->getState()->getInstallVersion(), '1.7.0.0', '<=')) { + if (version_compare($this->container->getState()->getInstallVersion(), '1.7.0.0', '<')) { return new CoreUpgrader16($this->container, $this->logger); } - return new CoreUpgrader17($this->container, $this->logger); + if (version_compare($this->container->getState()->getInstallVersion(), '8.0.0.0', '<')) { + return new CoreUpgrader17($this->container, $this->logger); + } + + return new CoreUpgrader80($this->container, $this->logger); } public function init() diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php index 027daf4f3..1ab1de474 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php @@ -30,7 +30,6 @@ use PrestaShop\Module\AutoUpgrade\UpgradeException; use PrestaShop\Module\AutoUpgrade\UpgradeTools\ThemeAdapter; use PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface; -use PrestaShop\PrestaShop\Core\Domain\MailTemplate\Command\GenerateThemeMailTemplatesCommand; use PrestaShop\PrestaShop\Core\Domain\Theme\Command\AdaptThemeToRTLLanguagesCommand; use PrestaShop\PrestaShop\Core\Domain\Theme\ValueObject\ThemeName; use PrestaShop\PrestaShop\Core\Exception\CoreException; @@ -84,33 +83,7 @@ protected function upgradeLanguage($lang) \Language::installSfLanguagePack($lang_pack['locale'], $errorsLanguage); if (!$this->container->getUpgradeConfiguration()->shouldKeepMails()) { - $mailTheme = \Configuration::get('PS_MAIL_THEME', null, null, null, 'modern'); - - $frontTheme = _THEME_NAME_; - $frontThemeMailsFolder = _PS_ALL_THEMES_DIR_ . $frontTheme . '/mails'; - $frontThemeModulesFolder = _PS_ALL_THEMES_DIR_ . $frontTheme . '/modules'; - - $generateCommand = new GenerateThemeMailTemplatesCommand( - $mailTheme, - $lang_pack['locale'], - true, - $frontThemeMailsFolder, - $frontThemeModulesFolder - ); - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->container->get('prestashop.core.command_bus'); - - try { - $commandBus->handle($generateCommand); - } catch (CoreException $e) { - throw new UpgradeException( - $this->container->getTranslator()->trans( - 'Cannot generate email templates: %s.', - [$e->getMessage()], - 'Modules.Autoupgrade.Admin' - ) - ); - } + \Language::installEmailsLanguagePack($lang_pack, $errorsLanguage); } if (!empty($errorsLanguage)) { diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php new file mode 100644 index 000000000..ba3912e93 --- /dev/null +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php @@ -0,0 +1,135 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +declare(strict_types=1); + +namespace PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader; + +use PrestaShop\Module\AutoUpgrade\UpgradeException; +use PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface; +use PrestaShop\PrestaShop\Core\Domain\MailTemplate\Command\GenerateThemeMailTemplatesCommand; +use PrestaShop\PrestaShop\Core\Exception\CoreException; + +class CoreUpgrader80 extends CoreUpgrader +{ + protected function initConstants() + { + parent::initConstants(); + + /*if (!file_exists(SETTINGS_FILE_PHP)) { + throw new UpgradeException($this->container->getTranslator()->trans('The app/config/parameters.php file was not found.', array(), 'Modules.Autoupgrade.Admin')); + } + if (!file_exists(SETTINGS_FILE_YML)) { + throw new UpgradeException($this->container->getTranslator()->trans('The app/config/parameters.yml file was not found.', array(), 'Modules.Autoupgrade.Admin')); + }*/ + + // Container may be needed to run upgrade scripts + $this->container->getSymfonyAdapter()->initAppKernel(); + } + + protected function upgradeDb($oldversion) + { + parent::upgradeDb($oldversion); + + $commandResult = $this->container->getSymfonyAdapter()->runSchemaUpgradeCommand(); + if (0 !== $commandResult['exitCode']) { + throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', array(), 'Modules.Autoupgrade.Admin'))) + ->setQuickInfos(explode("\n", $commandResult['output'])); + } + } + + protected function upgradeLanguage($lang) + { + $isoCode = $lang['iso_code']; + + if (!\Validate::isLangIsoCode($isoCode)) { + return; + } + $errorsLanguage = array(); + + if (!\Language::downloadLanguagePack($isoCode, _PS_VERSION_, $errorsLanguage)) { + throw new UpgradeException( + $this->container->getTranslator()->trans( + 'Download of the language pack %lang% failed. %details%', + [ + '%lang%' => $isoCode, + '%details%' => implode('; ', $errorsLanguage), + ], + 'Modules.Autoupgrade.Admin' + ) + ); + } + + $lang_pack = \Language::getLangDetails($isoCode); + \Language::installSfLanguagePack($lang_pack['locale'], $errorsLanguage); + + if (!$this->container->getUpgradeConfiguration()->shouldKeepMails()) { + $mailTheme = \Configuration::get('PS_MAIL_THEME', null, null, null, 'modern'); + + $frontTheme = _THEME_NAME_; + $frontThemeMailsFolder = _PS_ALL_THEMES_DIR_ . $frontTheme . '/mails'; + $frontThemeModulesFolder = _PS_ALL_THEMES_DIR_ . $frontTheme . '/modules'; + + $generateCommand = new GenerateThemeMailTemplatesCommand( + $mailTheme, + $lang_pack['locale'], + true, + $frontThemeMailsFolder, + $frontThemeModulesFolder + ); + /** @var CommandBusInterface $commandBus */ + $commandBus = $this->container->get('prestashop.core.command_bus'); + + try { + $commandBus->handle($generateCommand); + } catch (CoreException $e) { + throw new UpgradeException( + $this->container->getTranslator()->trans( + 'Cannot generate email templates: %s.', + [$e->getMessage()], + 'Modules.Autoupgrade.Admin' + ) + ); + } + } + + if (!empty($errorsLanguage)) { + throw new UpgradeException( + $this->container->getTranslator()->trans( + 'Error while updating translations for lang %lang%. %details%', + [ + '%lang%' => $isoCode, + '%details%' => implode('; ', $errorsLanguage), + ], + 'Modules.Autoupgrade.Admin' + ) + ); + } + \Language::loadLanguages(); + + // TODO: Update AdminTranslationsController::addNewTabs to install tabs translated + } +} From ddf316d38547c6d2aaa52314545422092459d763 Mon Sep 17 00:00:00 2001 From: atomiix Date: Thu, 16 Dec 2021 14:47:48 +0100 Subject: [PATCH 3/6] Remove comment Co-authored-by: GoT --- classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php index ba3912e93..4558710c5 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php @@ -39,13 +39,6 @@ protected function initConstants() { parent::initConstants(); - /*if (!file_exists(SETTINGS_FILE_PHP)) { - throw new UpgradeException($this->container->getTranslator()->trans('The app/config/parameters.php file was not found.', array(), 'Modules.Autoupgrade.Admin')); - } - if (!file_exists(SETTINGS_FILE_YML)) { - throw new UpgradeException($this->container->getTranslator()->trans('The app/config/parameters.yml file was not found.', array(), 'Modules.Autoupgrade.Admin')); - }*/ - // Container may be needed to run upgrade scripts $this->container->getSymfonyAdapter()->initAppKernel(); } From be6d365545ab58fcf4e66ec3112e5a45e01d6c62 Mon Sep 17 00:00:00 2001 From: atomiix Date: Fri, 7 Jan 2022 11:37:00 +0100 Subject: [PATCH 4/6] Get command bus from moduleAdapter --- classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php index 4558710c5..5f767c44d 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php @@ -94,7 +94,7 @@ protected function upgradeLanguage($lang) $frontThemeModulesFolder ); /** @var CommandBusInterface $commandBus */ - $commandBus = $this->container->get('prestashop.core.command_bus'); + $commandBus = $this->container->getModuleAdapter()->getCommandBus(); try { $commandBus->handle($generateCommand); From b99c34d1654a0aaf8d27fb8eb36f83e710ff536a Mon Sep 17 00:00:00 2001 From: Thomas BACCELLI Date: Fri, 7 Jan 2022 19:17:40 +0100 Subject: [PATCH 5/6] Fix ps version detection & mail generation output folders --- classes/TaskRunner/Upgrade/UpgradeDb.php | 2 +- classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/TaskRunner/Upgrade/UpgradeDb.php b/classes/TaskRunner/Upgrade/UpgradeDb.php index 38975516a..7d5e357fc 100644 --- a/classes/TaskRunner/Upgrade/UpgradeDb.php +++ b/classes/TaskRunner/Upgrade/UpgradeDb.php @@ -64,7 +64,7 @@ public function getCoreUpgrader() return new CoreUpgrader16($this->container, $this->logger); } - if (version_compare($this->container->getState()->getInstallVersion(), '8.0.0.0', '<')) { + if (version_compare($this->container->getState()->getInstallVersion(), '8.0.0', '<')) { return new CoreUpgrader17($this->container, $this->logger); } diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php index 5f767c44d..a229e5aff 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php @@ -90,8 +90,8 @@ protected function upgradeLanguage($lang) $mailTheme, $lang_pack['locale'], true, - $frontThemeMailsFolder, - $frontThemeModulesFolder + is_dir($frontThemeMailsFolder) ? $frontThemeMailsFolder : '', + is_dir($frontThemeModulesFolder) ? $frontThemeModulesFolder : '' ); /** @var CommandBusInterface $commandBus */ $commandBus = $this->container->getModuleAdapter()->getCommandBus(); From 86678ea1af28bce8128fb4783ae6fe99fce40be8 Mon Sep 17 00:00:00 2001 From: Thomas BACCELLI Date: Wed, 9 Feb 2022 18:43:03 +0100 Subject: [PATCH 6/6] Fix tests --- .github/workflows/php.yml | 2 +- .../CoreUpgrader/CoreUpgrader80.php | 35 +++---------------- tests/phpstan/phpstan-1.6.1.18.neon | 1 + tests/phpstan/phpstan-1.7.2.5.neon | 2 ++ tests/phpstan/phpstan-1.7.3.4.neon | 2 ++ tests/phpstan/phpstan-1.7.4.4.neon | 2 ++ tests/phpstan/phpstan-1.7.5.1.neon | 2 ++ tests/phpstan/phpstan-1.7.6.neon | 2 ++ tests/phpstan/phpstan-1.7.7.neon | 2 ++ tests/phpstan/phpstan-1.7.8.neon | 2 ++ 10 files changed, 21 insertions(+), 31 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9300ba15d..5060b84b4 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -12,7 +12,7 @@ jobs: - name: PHP syntax checker 5.6 uses: prestashop/github-action-php-lint/5.6@master with: - folder-to-exclude: "! -path \"./.github/*\"" + folder-to-exclude: "! -path \"./.github/*\" ! -path \"./classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php\"" - name: PHP syntax checker 7.2 uses: prestashop/github-action-php-lint/7.2@master diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php index a229e5aff..7fa6de321 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php @@ -49,8 +49,7 @@ protected function upgradeDb($oldversion) $commandResult = $this->container->getSymfonyAdapter()->runSchemaUpgradeCommand(); if (0 !== $commandResult['exitCode']) { - throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', array(), 'Modules.Autoupgrade.Admin'))) - ->setQuickInfos(explode("\n", $commandResult['output'])); + throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', [], 'Modules.Autoupgrade.Admin')))->setQuickInfos(explode("\n", $commandResult['output'])); } } @@ -61,19 +60,10 @@ protected function upgradeLanguage($lang) if (!\Validate::isLangIsoCode($isoCode)) { return; } - $errorsLanguage = array(); + $errorsLanguage = []; if (!\Language::downloadLanguagePack($isoCode, _PS_VERSION_, $errorsLanguage)) { - throw new UpgradeException( - $this->container->getTranslator()->trans( - 'Download of the language pack %lang% failed. %details%', - [ - '%lang%' => $isoCode, - '%details%' => implode('; ', $errorsLanguage), - ], - 'Modules.Autoupgrade.Admin' - ) - ); + throw new UpgradeException($this->container->getTranslator()->trans('Download of the language pack %lang% failed. %details%', ['%lang%' => $isoCode, '%details%' => implode('; ', $errorsLanguage)], 'Modules.Autoupgrade.Admin')); } $lang_pack = \Language::getLangDetails($isoCode); @@ -99,27 +89,12 @@ protected function upgradeLanguage($lang) try { $commandBus->handle($generateCommand); } catch (CoreException $e) { - throw new UpgradeException( - $this->container->getTranslator()->trans( - 'Cannot generate email templates: %s.', - [$e->getMessage()], - 'Modules.Autoupgrade.Admin' - ) - ); + throw new UpgradeException($this->container->getTranslator()->trans('Cannot generate email templates: %s.', [$e->getMessage()], 'Modules.Autoupgrade.Admin')); } } if (!empty($errorsLanguage)) { - throw new UpgradeException( - $this->container->getTranslator()->trans( - 'Error while updating translations for lang %lang%. %details%', - [ - '%lang%' => $isoCode, - '%details%' => implode('; ', $errorsLanguage), - ], - 'Modules.Autoupgrade.Admin' - ) - ); + throw new UpgradeException($this->container->getTranslator()->trans('Error while updating translations for lang %lang%. %details%', ['%lang%' => $isoCode, '%details%' => implode('; ', $errorsLanguage)], 'Modules.Autoupgrade.Admin')); } \Language::loadLanguages(); diff --git a/tests/phpstan/phpstan-1.6.1.18.neon b/tests/phpstan/phpstan-1.6.1.18.neon index eb0a4a06e..cdb8c8e95 100644 --- a/tests/phpstan/phpstan-1.6.1.18.neon +++ b/tests/phpstan/phpstan-1.6.1.18.neon @@ -7,6 +7,7 @@ parameters: - ./../../classes/pclzip.lib.php - ./../../functions.php - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php - ./../../classes/UpgradeTools/SymfonyAdapter.php ignoreErrors: - '#Access to an undefined property Autoupgrade::\$bootstrap.#' diff --git a/tests/phpstan/phpstan-1.7.2.5.neon b/tests/phpstan/phpstan-1.7.2.5.neon index 5e9a4b90c..8f3fc54ad 100644 --- a/tests/phpstan/phpstan-1.7.2.5.neon +++ b/tests/phpstan/phpstan-1.7.2.5.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Autoupgrade::\$bootstrap.#' - '#Access to an undefined property Module::\$installed.#' diff --git a/tests/phpstan/phpstan-1.7.3.4.neon b/tests/phpstan/phpstan-1.7.3.4.neon index 5e9a4b90c..8f3fc54ad 100644 --- a/tests/phpstan/phpstan-1.7.3.4.neon +++ b/tests/phpstan/phpstan-1.7.3.4.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Autoupgrade::\$bootstrap.#' - '#Access to an undefined property Module::\$installed.#' diff --git a/tests/phpstan/phpstan-1.7.4.4.neon b/tests/phpstan/phpstan-1.7.4.4.neon index efe9eddfa..5112a3798 100644 --- a/tests/phpstan/phpstan-1.7.4.4.neon +++ b/tests/phpstan/phpstan-1.7.4.4.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Autoupgrade::\$bootstrap.#' - '#Access to an undefined property Module::\$installed.#' diff --git a/tests/phpstan/phpstan-1.7.5.1.neon b/tests/phpstan/phpstan-1.7.5.1.neon index 0436222ff..29e97db98 100644 --- a/tests/phpstan/phpstan-1.7.5.1.neon +++ b/tests/phpstan/phpstan-1.7.5.1.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Autoupgrade::\$bootstrap.#' - '#Access to an undefined property Module::\$installed.#' diff --git a/tests/phpstan/phpstan-1.7.6.neon b/tests/phpstan/phpstan-1.7.6.neon index ded546c58..2745e98ec 100644 --- a/tests/phpstan/phpstan-1.7.6.neon +++ b/tests/phpstan/phpstan-1.7.6.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Autoupgrade::\$bootstrap.#' - '#Access to an undefined property Module::\$installed.#' diff --git a/tests/phpstan/phpstan-1.7.7.neon b/tests/phpstan/phpstan-1.7.7.neon index ebbff783a..5aba843bc 100644 --- a/tests/phpstan/phpstan-1.7.7.neon +++ b/tests/phpstan/phpstan-1.7.7.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Module::\$installed.#' - '#Call to method fetchLocale\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Cldr\\Update.#' diff --git a/tests/phpstan/phpstan-1.7.8.neon b/tests/phpstan/phpstan-1.7.8.neon index 509919dd2..94bf1b5eb 100644 --- a/tests/phpstan/phpstan-1.7.8.neon +++ b/tests/phpstan/phpstan-1.7.8.neon @@ -2,6 +2,8 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon parameters: + excludes_analyse: + - ./../../classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php ignoreErrors: - '#Access to an undefined property Module::\$installed.#' - '#Call to method fetchLocale\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Cldr\\Update.#'