Skip to content

Commit 2d46d02

Browse files
authored
Merge pull request #134 from Hlavtox/php5
Fix PHP 5 compatibility
2 parents 4bb7a21 + c72f9e3 commit 2d46d02

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

classes/Hook/HookActionCarrierProcess.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,18 @@ public function setParams($params)
7171
$this->params = $params;
7272
}
7373

74-
protected function getUniversalAnalytics(string $carrierName)
74+
/**
75+
* @param string $carrierName
76+
*/
77+
protected function getUniversalAnalytics($carrierName)
7578
{
7679
return 'MBG.addCheckoutOption(2,\'' . $carrierName . '\');';
7780
}
7881

79-
protected function getGoogleAnalytics4(string $carrierName)
82+
/**
83+
* @param string $carrierName
84+
*/
85+
protected function getGoogleAnalytics4($carrierName)
8086
{
8187
$eventData = [
8288
'currency' => $this->context->currency->iso_code,

classes/Hook/HookActionOrderStatusPostUpdate.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,17 @@ public function setParams($params)
9999
$this->params = $params;
100100
}
101101

102+
/**
103+
* @param int $idOrder
104+
*/
102105
protected function getUniversalAnalytics($idOrder)
103106
{
104107
return 'MBG.refundByOrderId(' . json_encode(['id' => $idOrder]) . ');';
105108
}
106109

110+
/**
111+
* @param int $idOrder
112+
*/
107113
protected function getGoogleAnalytics4($idOrder)
108114
{
109115
$eventData = [

classes/Hook/HookActionProductCancel.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ public function setParams($params)
8686
$this->params = $params;
8787
}
8888

89-
protected function getUniversalAnalytics(int $idOrder, string $idProduct, float $quantity)
89+
/**
90+
* @param int $idOrder
91+
* @param string $idProduct
92+
* @param float $quantity
93+
*/
94+
protected function getUniversalAnalytics($idOrder, $idProduct, $quantity)
9095
{
9196
$js = 'MBG.add(' . json_encode(
9297
[
@@ -99,7 +104,13 @@ protected function getUniversalAnalytics(int $idOrder, string $idProduct, float
99104
return $js;
100105
}
101106

102-
protected function getGoogleAnalytics4(int $idOrder, string $idProduct, float $quantity, string $nameProduct)
107+
/**
108+
* @param int $idOrder
109+
* @param string $idProduct
110+
* @param float $quantity
111+
* @param string $nameProduct
112+
*/
113+
protected function getGoogleAnalytics4($idOrder, $idProduct, $quantity, $nameProduct)
103114
{
104115
$eventData = [
105116
'transaction_id' => (int) $idOrder,

0 commit comments

Comments
 (0)