Merge pull request #6491 from dseguy/refactor_counts

refactored conditions with simpler terms
This commit is contained in:
Glenn Hermans 2022-06-30 05:18:19 +02:00 committed by GitHub
commit 0653cdfa11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -274,7 +274,7 @@ class Helper extends Review
$priceHTML = view('shop::products.price', ['product' => $product])->render(); $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 [ return [
'priceHTML' => $priceHTML, 'priceHTML' => $priceHTML,