Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes for cart blaming command #12533

Merged
merged 1 commit into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Minor fixes for cart blaming command
  • Loading branch information
arti0090 committed Apr 15, 2021
commit 4ef9a22e38e166c6c65c46e0289a65b8e7153153
6 changes: 3 additions & 3 deletions src/Sylius/Bundle/ApiBundle/Command/BlameCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class BlameCart
* @var string
* @psalm-immutable
*/
public $cartToken;
public $orderTokenValue;

public function __construct(string $shopUserEmail, string $cartToken)
public function __construct(string $shopUserEmail, string $orderTokenValue)
{
$this->shopUserEmail = $shopUserEmail;
$this->cartToken = $cartToken;
$this->orderTokenValue = $orderTokenValue;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Sylius\Component\User\Repository\UserRepositoryInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

class BlameCartHandler implements MessageHandlerInterface
final class BlameCartHandler implements MessageHandlerInterface
{
/** @var UserRepositoryInterface */
private $shopUserRepository;
Expand Down Expand Up @@ -43,7 +43,7 @@ public function __invoke(BlameCart $blameCart): void
}

/** @var OrderInterface|null $cart */
$cart = $this->orderRepository->findCartByTokenValue($blameCart->cartToken);
$cart = $this->orderRepository->findCartByTokenValue($blameCart->orderTokenValue);

if ($cart === null) {
throw new \InvalidArgumentException('Cart with given token value could not be found');
Expand Down