Skip to content

Commit

Permalink
chore: update container lib to the latest version (#462)
Browse files Browse the repository at this point in the history
* chore: update container lib to the latest version
  • Loading branch information
hschoenenberger authored Dec 19, 2024
1 parent 9118367 commit efd021f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
32 changes: 28 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config.preprod.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@

'ps_accounts.testimonials_url' => 'https://assets.prestashop3.com/dst/accounts/assets/testimonials.json',

'ps_accounts.log_level' => 'DEBUG',
'ps_accounts.log_level' => 'INFO',
];
31 changes: 16 additions & 15 deletions ps_accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ public function getCoreServiceContainer()
public function getServiceContainer()
{
if (null === $this->moduleContainer) {
$this->moduleContainer = \PrestaShop\Module\PsAccounts\ServiceContainer\PsAccountsContainer::createInstance(
$this->moduleContainer = (new \PrestaShop\Module\PsAccounts\ServiceContainer\PsAccountsContainer(
__DIR__ . '/config.php'
);
))->init();
}

return $this->moduleContainer;
Expand Down Expand Up @@ -308,25 +308,26 @@ public function getCustomHooks()
* @param array $customHooks
*
* @return bool
*
* @throws PrestaShopDatabaseException
* @throws PrestaShopException
*/
public function addCustomHooks($customHooks)
{
$ret = true;

foreach ($customHooks as $customHook) {
$verify = true;
if ((bool) Hook::getIdByName($customHook['name']) === false) {
$hook = new Hook();
$hook->name = $customHook['name'];
$hook->title = $customHook['title'];
$hook->description = $customHook['description'];
$hook->position = $customHook['position'];
$verify = $hook->add(); // return true on success
try {
$verify = true;
if ((bool) Hook::getIdByName($customHook['name']) === false) {
$hook = new Hook();
$hook->name = $customHook['name'];
$hook->title = $customHook['title'];
$hook->description = $customHook['description'];
$hook->position = $customHook['position'];
$verify = $hook->add(); // return true on success
}
$ret = $ret && $verify;
} catch (\Throwable $e) {
/* @phpstan-ignore-next-line */
} catch (\Exception $e) {
}
$ret = $ret && $verify;
}

return $ret;
Expand Down

0 comments on commit efd021f

Please sign in to comment.