Skip to content

Commit

Permalink
Fixed phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
pbalcerzak committed Sep 20, 2022
1 parent ea4bea0 commit 7ff4ccc
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Controller/Shop/DropinConfigurationAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,20 @@ private function getTranslations(): array

private function getOrder(?string $orderToken = null): ?OrderInterface
{
if (null === $orderToken) {
$order = $this->cartContext->getCart();
} else {
$order = $this->orderRepository->findOneByTokenValue($orderToken);

if (null === $order) {
$order = $this->orderRepository->findCartByTokenValue($orderToken);
}
}

/**
* @var ?OrderInterface $result
*/
$result =
null !== $orderToken
? $this->orderRepository->findOneByTokenValue($orderToken) ? $this->orderRepository->findOneByTokenValue($orderToken) : $this->orderRepository->findCartByTokenValue($orderToken)
: $this->cartContext->getCart()
;
$result = $order;

return $result;
}
Expand Down

0 comments on commit 7ff4ccc

Please sign in to comment.