Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
rokaszygmantas committed Jul 26, 2019
1 parent 4e83ffa commit 1ec5d1a
Showing 1 changed file with 19 additions and 5 deletions.
Expand Up @@ -586,11 +586,25 @@ private function createCartRule(
!$minimumAmountShippingIncluded
);

null !== $code ? $command->setCode($code) : null;
null !== $description ? $command->setDescription($description) : null;
null !== $customerId ? $command->setCustomerId($customerId) : null;
null !== $discountApplicationType ? $command->setDiscountApplicationType($discountApplicationType) : null;
null !== $discountProductId ? $command->setDiscountProductId($discountProductId) : null;
if (null !== $code) {
$command->setCode($code);
}

if (null !== $description) {
$command->setDescription($description);
}

if (null !== $customerId) {
$command->setCustomerId($customerId);
}

if (null !== $discountApplicationType) {
$command->setDiscountApplicationType($discountApplicationType);
}

if (null !== $discountProductId) {
$command->setDiscountProductId($discountProductId);
}

return $this->getCommandBus()->handle($command);
}
Expand Down

0 comments on commit 1ec5d1a

Please sign in to comment.