refactored conditions with simpler terms

This commit is contained in:
Damien Seguy 2022-06-15 18:00:59 +02:00
parent 2790a6e1ff
commit a5db9db490
5 changed files with 5 additions and 5 deletions

View File

@ -329,7 +329,7 @@ class ProductController extends Controller
return redirect()->back();
}
if (! $data['massaction-type'] == 'update') {
if ($data['massaction-type'] !== 'update') {
return redirect()->back();
}

View File

@ -150,7 +150,7 @@ class ReviewController extends Controller
return redirect()->back();
}
if (! $data['massaction-type'] == 'update') {
if ($data['massaction-type'] !== 'update') {
return redirect()->back();
}

View File

@ -192,7 +192,7 @@ class ProductFlatRepository extends Repository
$filterAttributes = $this->getProductsRelatedFilterableAttributes($category);
}
if (! count($filterAttributes) > 0) {
if (empty($filterAttributes)) {
$filterAttributes = $this->attributeRepository->getFilterAttributes();
}

View File

@ -114,7 +114,7 @@ class ProductController extends Controller
$filterAttributes = $this->productFlatRepository->getFilterAttributes($category);
}
if (! count($filterAttributes) > 0) {
if (empty($filterAttributes)) {
$filterAttributes = $attributeRepository->getFilterAttributes();
}

View File

@ -274,7 +274,7 @@ class Helper extends Review
$priceHTML = view('shop::products.price', ['product' => $product])->render();
$isProductNew = ($product->new && ! strpos($priceHTML, 'sticker sale') > 0) ? __('shop::app.products.new') : false;
$isProductNew = ($product->new && strpos($priceHTML, 'sticker sale') === false) ? __('shop::app.products.new') : false;
return [
'priceHTML' => $priceHTML,