Skip to content

Commit

Permalink
Refactoring src/Service/Product.php
Browse files Browse the repository at this point in the history
  • Loading branch information
plvhx committed Sep 23, 2020
1 parent cc873ff commit 3f7479f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Service/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,16 @@ public function deleteProduct(int $shopID, array $data)
private function validateSortOptions(int $sort)
{
switch ($sort) {
case SORT_DEFAULT:
case SORT_LAST_UPDATE_PRODUCT:
case SORT_HIGHEST_SOLD:
case SORT_LOWEST_SOLD:
case SORT_HIGHEST_PRICE:
case SORT_LOWEST_PRICE:
case SORT_PRODUCT_NAME_ASCENDING:
case SORT_PRODUCT_NAME_DESCENDING:
case SORT_FEWEST_STOCK:
case SORT_HIGHEST_STOCK:
case self::SORT_DEFAULT:
case self::SORT_LAST_UPDATE_PRODUCT:
case self::SORT_HIGHEST_SOLD:
case self::SORT_LOWEST_SOLD:
case self::SORT_HIGHEST_PRICE:
case self::SORT_LOWEST_PRICE:
case self::SORT_PRODUCT_NAME_ASCENDING:
case self::SORT_PRODUCT_NAME_DESCENDING:
case self::SORT_FEWEST_STOCK:
case self::SORT_HIGHEST_STOCK:
break;
default:
throw new InvalidArgumentException("Invalid sort options.");
Expand Down

0 comments on commit 3f7479f

Please sign in to comment.