Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
zalexki committed Jun 30, 2020
1 parent ad33c47 commit 438bf28
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
2 changes: 0 additions & 2 deletions controllers/front/action.php
Expand Up @@ -18,7 +18,6 @@
* International Registered Trademark & Property of PrestaShop SA
*/

use PrestaShop\Module\BlockWishlist\WishList;
use PrestaShop\PrestaShop\Adapter\Image\ImageRetriever;
use PrestaShop\PrestaShop\Adapter\Product\PriceFormatter;
use PrestaShop\PrestaShop\Adapter\Product\ProductColorsRetriever;
Expand Down Expand Up @@ -90,7 +89,6 @@ private function addProductToWishListAction($params)
);

$newStat = new Statistics();
$newStat->id_wishlist = $idWishList;
$newStat->id_product = $id_product;
$newStat->id_product_attribute = $id_product_attribute;
$newStat->save();
Expand Down
1 change: 1 addition & 0 deletions src/Calculator/StatisticsCalculator.php
Expand Up @@ -35,6 +35,7 @@ class StatisticsCalculator
];

private $context;
private $productAssembler;

public function __construct($context)
{
Expand Down
51 changes: 27 additions & 24 deletions src/Controller/AdminAjaxPrestashopWishlistController.php
Expand Up @@ -89,6 +89,9 @@ private function handleForm($datas)
private function getWishlistConfigurationDatas()
{
$languages = \Language::getLanguages(true);
$wishlistNames = [];
$wishlistDefaultTitles = [];
$wishlistCreateNewButtonsLabel = [];

foreach ($languages as $lang) {
$wishlistNames[$lang['id_lang']] = \Configuration::get('blockwishlist_WishlistPageName', $lang['id_lang']);
Expand Down Expand Up @@ -129,28 +132,28 @@ public function getStatisticsAction(Request $request)
}

// this idea need some functional specification, it is not used ATM
public function forceRefreshCacheStatsAction(Request $request)
{
$cacheName = $request->request->get('cacheName');

$statsCalculator = new StatisticsCalculator($this->context);
switch ($cacheName) {
case 'year':
$results = $statsCalculator->computeYearStats();
break;
case 'month':
$results = $statsCalculator->computeMonthStats();
break;
case 'day':
$results = $statsCalculator->computeDayStats();
break;
default:
break;
}

return $this->json([
'success' => true,
'stats' => $results,
]);
}
// public function forceRefreshCacheStatsAction(Request $request)
// {
// $cacheName = $request->request->get('cacheName');

// $statsCalculator = new StatisticsCalculator($this->context);
// switch ($cacheName) {
// case 'year':
// $results = $statsCalculator->computeYearStats();
// break;
// case 'month':
// $results = $statsCalculator->computeMonthStats();
// break;
// case 'day':
// $results = $statsCalculator->computeDayStats();
// break;
// default:
// break;
// }

// return $this->json([
// 'success' => true,
// 'stats' => $results,
// ]);
// }
}
6 changes: 3 additions & 3 deletions views/js/admin/adminConfiguration.js
Expand Up @@ -18,7 +18,7 @@
*/

console.log('blockwishlist - adminConfiguration.js');
import TranslatableInput from "admin-dev/themes/new-theme/js/components/translatable-input";
// import TranslatableInput from "admin-dev/themes/new-theme/js/components/translatable-input";

// enable togging of different locales
new TranslatableInput();
// // enable togging of different locales
// new TranslatableInput();

0 comments on commit 438bf28

Please sign in to comment.