Skip to content

Commit

Permalink
TE-10370 Fix up cloaking checks that are not needed. (#8983)
Browse files Browse the repository at this point in the history
* TE-10370 Fix up cloaking checks that are not needed.

* TE-10370 Manually fix up remaining cloaking checks that are not needed.

* TE-10370 Manually fix up remaining cloaking checks that are not needed.

* Remove code smell and phpstan issue.
  • Loading branch information
dereuromark authored Dec 28, 2021
1 parent b64385a commit 942d370
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ public function __construct(
*/
public function filterRestrictedProductConcreteSkus(array $productConcreteSkus, array $customerBlacklistIds, array $customerWhitelistIds): array
{
if (empty($productConcreteSkus)) {
if (!$productConcreteSkus) {
return [];
}

$restrictedProductConcreteSkus = [];

if (!empty($customerWhitelistIds)) {
if ($customerWhitelistIds) {
$productConcreteSkusInWhitelist = $this->productListReader
->getProductConcreteSkusInWhitelists($productConcreteSkus, $customerWhitelistIds);

$restrictedProductConcreteSkus = array_diff($productConcreteSkus, $productConcreteSkusInWhitelist);
}

if (!empty($customerBlacklistIds)) {
if ($customerBlacklistIds) {
$productConcreteSkusInBlacklist = $this->productListReader
->getProductConcreteSkusInBlacklists($productConcreteSkus, $customerBlacklistIds);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function validateItemAddition(CartChangeTransfer $cartChangeTransfer): Ca
$customerWhitelistIds,
);

if (empty($restrictedProductConcreteSkus)) {
if (!$restrictedProductConcreteSkus) {
return $cartPreCheckResponseTransfer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function removeRestrictedItemsFromQuote(
array $blacklistIds,
array $whitelistIds
): void {
if (empty($blacklistIds) && empty($whitelistIds)) {
if (!$blacklistIds && !$whitelistIds) {
return;
}

Expand All @@ -89,7 +89,7 @@ protected function removeRestrictedItemsFromQuote(

$restrictedProductConcreteSkus = $this->productListRestrictionFilter->filterRestrictedProductConcreteSkus($quoteSkus, $blacklistIds, $whitelistIds);

if (empty($restrictedProductConcreteSkus)) {
if (!$restrictedProductConcreteSkus) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ public function getProductConcreteProductListIdsForType(int $idProduct, string $
*/
protected function getConcreteProductSkusInList(array $productConcreteSkus, string $listType, array $productListIds): array
{
if (empty($productConcreteSkus)) {
if (!$productConcreteSkus) {
return [];
}

if (empty($productListIds)) {
if (!$productListIds) {
return [];
}

Expand Down

0 comments on commit 942d370

Please sign in to comment.