Skip to content

Commit

Permalink
🐛 Add missing import
Browse files Browse the repository at this point in the history
  • Loading branch information
intraordinaire committed Nov 12, 2024
1 parent 74e55af commit 394c219
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Traits/Hooks/UseDisplayAdminAfterHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

namespace PrestaShop\Module\Mbo\Traits\Hooks;

use Cache;
use Configuration;
use Context;
use Exception;
use Language;
use PrestaShop\Module\Mbo\Distribution\Config\Command\VersionChangeApplyConfigCommand;
use PrestaShop\Module\Mbo\Distribution\Config\CommandHandler\VersionChangeApplyConfigCommandHandler;
use PrestaShop\Module\Mbo\Exception\ExpectedServiceNotFoundException;
Expand All @@ -30,9 +34,10 @@
use PrestaShop\Module\Mbo\Service\View\ContextBuilder;
use PrestaShop\PrestaShop\Core\Domain\Employee\Exception\EmployeeException;
use PrestaShop\PrestaShop\Core\Exception\CoreException;
use Shop;
use Tab;
use Tools;
use Twig\Environment;
use Configuration;

trait UseDisplayAdminAfterHeader
{
Expand Down Expand Up @@ -113,6 +118,7 @@ private function renderMboUserExplanation(): string
);
} catch (Exception $e) {
ErrorHelper::reportError($e);

return '';
}
}
Expand Down Expand Up @@ -144,13 +150,14 @@ private function renderModuleManagerMessage(): string
);
} catch (Exception $e) {
ErrorHelper::reportError($e);

return '';
}
}

private function shouldDisplayMboUserExplanation(): bool
{
if (Tools::getValue('controller') !== "AdminEmployees") {
if (Tools::getValue('controller') !== 'AdminEmployees') {
return false;
}

Expand All @@ -161,6 +168,7 @@ private function shouldDisplayMboUserExplanation(): bool
}
} catch (Exception $e) {
ErrorHelper::reportError($e);

return false;
}

Expand All @@ -174,9 +182,9 @@ private function shouldDisplayModuleManagerMessage(): bool
!in_array(
Tools::getValue('controller'),
[
"AdminModulesManage",
"AdminModulesNotifications",
"AdminModulesUpdates",
'AdminModulesManage',
'AdminModulesNotifications',
'AdminModulesUpdates',
]
)
) {
Expand All @@ -190,6 +198,7 @@ private function shouldDisplayModuleManagerMessage(): bool
}
} catch (Exception $e) {
ErrorHelper::reportError($e);

return false;
}

Expand All @@ -204,6 +213,7 @@ private function shouldDisplayModuleManagerMessage(): bool
public function ensureModuleIsCorrectlySetUp(): void
{
$whitelistedControllers = [
'AdminPsMboModule',
'AdminPsMboModuleParent',
'AdminPsMboRecommended',
'apiPsMbo',
Expand Down Expand Up @@ -255,7 +265,7 @@ private function ensureShopIsConfigured(): bool

foreach (Shop::getShops(false, null, true) as $shopId) {
foreach ($configurationList as $name => $value) {
if (Configuration::hasKey($name, null, null, (int)$shopId)) {
if (Configuration::hasKey($name, null, null, (int) $shopId)) {
$configurationList[$name] = true;
}
}
Expand Down

0 comments on commit 394c219

Please sign in to comment.