Skip to content

Commit 17a4eb7

Browse files
committed
Fix lastest PHPSTAN issues
1 parent 1ad38c4 commit 17a4eb7

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

classes/Handler/ModuleHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ public function uninstallModule($moduleName)
7777
};
7878

7979
$parentUninstallClosure = $parentUninstallClosure->bindTo($oldModule, get_class($oldModule));
80-
$parentUninstallClosure();
8180

82-
return true;
81+
return $parentUninstallClosure();
8382
}
8483
}

classes/Hook/HookActionProductCancel.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public function run()
5353
. ');';
5454
}
5555

56-
$this->context->cookie->ga_admin_refund = $gaScripts . 'MBG.refundByProduct(' . json_encode(['id' => $this->params['order']->id]) . ');';
56+
$this->context->cookie->__set(
57+
'ga_admin_refund',
58+
$gaScripts . 'MBG.refundByProduct(' . json_encode(['id' => $this->params['order']->id]) . ');'
59+
);
60+
$this->context->cookie->write();
5761
}
5862

5963
/**

ps_googleanalytics.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ public function hookdisplayAdminOrder()
140140
$gaTagHandler = new PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler($this, $this->context);
141141

142142
echo $gaTagHandler->generate(
143-
$this->context->cookie->ga_admin_refund,
143+
$this->context->cookie->__get('ga_admin_refund'),
144144
1
145145
);
146-
unset($this->context->cookie->ga_admin_refund);
146+
$this->context->cookie->__unset('ga_admin_refund');
147147
}
148148

149149
/**

tests/phpstan/phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@ parameters:
1010
ignoreErrors:
1111
- '#Property Ps_Googleanalytics::\$version \(float\) does not accept string.#'
1212
- '#Strict comparison using === between false and Module will always evaluate to false.#'
13+
-
14+
message: '#Access to an undefined property object::\$shop.#'
15+
path: ../../classes/Hook/HookActionCartSave.php
16+
- '#PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler does not extend any class.#'
1317

1418
level: 5

0 commit comments

Comments
 (0)