From b1ca722a3b19c380370a0752d7d982841a3d0893 Mon Sep 17 00:00:00 2001 From: Alexis Guyomar Date: Fri, 14 Feb 2025 15:31:58 +0100 Subject: [PATCH] fix: php stan --- autoupgrade.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/autoupgrade.php b/autoupgrade.php index fc56a9090..87e0118a8 100644 --- a/autoupgrade.php +++ b/autoupgrade.php @@ -202,7 +202,7 @@ public function hookDisplayBackOfficeHeader() { require_once _PS_ROOT_DIR_ . '/modules/autoupgrade/classes/VersionUtils.php'; if (!\PrestaShop\Module\AutoUpgrade\VersionUtils::isActualPHPVersionCompatible()) { - return; + return ''; } $autoloadPath = __DIR__ . '/vendor/autoload.php'; @@ -219,7 +219,7 @@ public function hookDisplayBackOfficeHeader() $default_controller = $tab->class_name; if ($controller !== $default_controller) { - return; + return ''; } require_once _PS_ROOT_DIR_ . '/modules/autoupgrade/classes/UpgradeContainer.php'; @@ -230,7 +230,7 @@ public function hookDisplayBackOfficeHeader() // check if new version is available if (!$container->getUpgrader()->isNewerVersionAvailableOnline()) { - return; + return ''; } $twig = $container->getTwig(); @@ -252,8 +252,6 @@ public function hookDisplayBackOfficeHeader() $updateType = \PrestaShop\Module\AutoUpgrade\VersionUtils::getUpdateType($psVersion, $onlineVersion); - $translator = $container->getTranslator(); - $htmlToReturn .= $twig->render('@ModuleAutoUpgrade/hooks/external-layout.html.twig', [ 'external_parent_id' => \PrestaShop\Module\AutoUpgrade\Twig\PageSelectors::EXTERNAL_PARENT_ID, 'component' => 'dialog-update-notification', @@ -268,6 +266,9 @@ public function hookDisplayBackOfficeHeader() return $htmlToReturn; } + /** + * @return void + */ public function hookActionAdminControllerSetMedia() { $this->context->controller->addCSS($this->_path . 'views/css/autoupgrade-external.css');