private $commandBus; public function postAction() { $command = new PurchaseProductCommand(42, 29); $this->commandBus->handle($command); } } <?php namespace MyStore\App; class PurchaseProductCommand { public $productId; public $userId; } class PurchaseProductHandler { // ... public function handle(PurchaseProductCommand $command) { $params = [ 'productId' => $command->productId, 'userId' => $command->userId ]; $this->gatewayWorker->validate('purchase.gateway', $params); $this->mailerWorker->send('purchase.mailer', $params); } }