for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sylius\ShopApiPlugin\Request;
use Sylius\ShopApiPlugin\Command\AddCoupon;
use Symfony\Component\HttpFoundation\Request;
final class AddCouponRequest
{
/**
* @var string
*/
private $token;
private $coupon;
* @param Request $request
public function __construct(Request $request)
$this->token = $request->attributes->get('token');
$this->coupon = $request->request->get('coupon');
}
* @return AddCoupon
public function getCommand()
return new AddCoupon($this->token, $this->coupon);