Skip to content

Commit 368707d

Browse files
committed
Fix many PHPSTAN issues
1 parent bc3b2ea commit 368707d

12 files changed

Lines changed: 37 additions & 25 deletions

classes/GoogleAnalyticsTools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function addTransaction($products, $order)
6464
/**
6565
* add product impression js and product click js
6666
*
67-
* @param array ixed $products
67+
* @param array $products
6868
*
6969
* @return string|void
7070
*/

classes/Handler/GanalyticsJsHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class GanalyticsJsHandler
2525
private $module;
2626
private $context;
2727

28-
public function __construct(\Ps_googleanalytics $module, \Context $context)
28+
public function __construct(\Ps_Googleanalytics $module, \Context $context)
2929
{
3030
$this->module = $module;
3131
$this->context = $context;
@@ -37,7 +37,7 @@ public function __construct(\Ps_googleanalytics $module, \Context $context)
3737
* @param string $jsCode
3838
* @param int $isBackoffice
3939
*
40-
* @return string
40+
* @return void|string
4141
*/
4242
public function generate($jsCode, $isBackoffice = 0)
4343
{

classes/Hook/HookActionProductCancel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct($module, $context)
3535
/**
3636
* run
3737
*
38-
* @return string
38+
* @return void
3939
*/
4040
public function run()
4141
{

classes/Hook/HookDisplayFooter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function run()
8585
if (empty($step)) {
8686
$step = 0;
8787
}
88-
$gaScripts .= $gaTools->addProductFromCheckout($products, $step);
88+
$gaScripts .= $gaTools->addProductFromCheckout($products);
8989
$gaScripts .= 'MBG.addCheckout(\'' . (int) $step . '\');';
9090
}
9191

classes/Hook/HookDisplayHeader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($module, $context)
3636
/**
3737
* run
3838
*
39-
* @return string
39+
* @return void|string
4040
*/
4141
public function run()
4242
{

classes/Hook/HookDisplayHome.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function run()
6565
$gaScripts .= $gaTools->addProductImpression($homeFeaturedProducts) . $gaTools->addProductClick($homeFeaturedProducts);
6666
}
6767

68-
$this->js_state = 1;
68+
$this->module->js_state = 1;
6969

7070
return $gaTagHandler->generate(
7171
$gaTools->filter($gaScripts, $this->module->filterable)

classes/Hook/HookDisplayOrderConfirmation.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ public function run()
9292
}
9393
}
9494
}
95+
96+
return '';
9597
}
9698

9799
/**

classes/Repository/GanalyticsDataRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function findDataByCartIdAndShopId($cartId, $shopId)
4747
*
4848
* @param int $cartId
4949
* @param int $shopId
50-
* @param array $data
50+
* @param string $data
5151
*
5252
* @return bool
5353
*/
@@ -66,7 +66,7 @@ public function addNewRow($cartId, $shopId, $data)
6666
* @param int $cartId
6767
* @param int $shopId
6868
*
69-
* @return void
69+
* @return bool
7070
*/
7171
public function deleteRow($cartId, $shopId)
7272
{

classes/Repository/GanalyticsRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function findAllByShopIdAndDateAdd($shopId)
6161
* addNewRow
6262
*
6363
* @param array $data
64-
* @param \Db $type
64+
* @param int $type
6565
*
6666
* @return bool
6767
*/

classes/Wrapper/ProductWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function wrapProductList($products, $extras = [], $full = false)
5151
}
5252

5353
foreach ($products as $index => $product) {
54-
if ($product instanceof Product) {
54+
if ($product instanceof \Product) {
5555
$product = (array) $product;
5656
}
5757

0 commit comments

Comments
 (0)