Skip to content

Commit eaa26fc

Browse files
committed
Fix composer json
1 parent 95b0e62 commit eaa26fc

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

composer.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,26 @@
2929
"role": "Maintainer"
3030
}
3131
],
32+
"repositories": [
33+
{
34+
"type": "vcs",
35+
"url": "https://github.com/TatevikGr/rss-bundle.git"
36+
}
37+
],
3238
"support": {
3339
"issues": "https://github.com/phpList/rest-api/issues",
3440
"forum": "https://discuss.phplist.org/",
3541
"source": "https://github.com/phpList/rest-api"
3642
},
3743
"require": {
3844
"php": "^8.1",
39-
"phplist/core": "dev-dev",
45+
"phplist/core": "dev-em-flush",
4046
"friendsofsymfony/rest-bundle": "*",
4147
"symfony/test-pack": "^1.0",
4248
"symfony/process": "^6.4",
4349
"zircote/swagger-php": "^4.11",
44-
"ext-dom": "*"
50+
"ext-dom": "*",
51+
"tatevikgr/rss-feed": "dev-main as 0.1.0"
4552
},
4653
"require-dev": {
4754
"phpunit/phpunit": "^10.0",
@@ -123,5 +130,10 @@
123130
}
124131
}
125132
}
133+
},
134+
"config": {
135+
"allow-plugins": {
136+
"php-http/discovery": true
137+
}
126138
}
127139
}

src/Messaging/Controller/CampaignController.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use OpenApi\Attributes as OA;
88
use PhpList\Core\Domain\Messaging\Model\Message;
9-
use PhpList\Core\Domain\Messaging\Service\Processor\CampaignProcessor;
109
use PhpList\Core\Security\Authentication;
1110
use PhpList\RestBundle\Common\Controller\BaseController;
1211
use PhpList\RestBundle\Common\Validator\RequestValidator;
@@ -17,7 +16,9 @@
1716
use Symfony\Component\HttpFoundation\JsonResponse;
1817
use Symfony\Component\HttpFoundation\Request;
1918
use Symfony\Component\HttpFoundation\Response;
19+
use Symfony\Component\Messenger\MessageBusInterface;
2020
use Symfony\Component\Routing\Attribute\Route;
21+
use Symfony\Component\Messenger\Stamp\TransportNamesStamp;
2122

2223
/**
2324
* This controller provides REST API to manage campaigns.
@@ -28,17 +29,17 @@
2829
class CampaignController extends BaseController
2930
{
3031
private CampaignService $campaignService;
31-
private CampaignProcessor $campaignProcessor;
32+
private MessageBusInterface $messageBus;
3233

3334
public function __construct(
3435
Authentication $authentication,
3536
RequestValidator $validator,
3637
CampaignService $campaignService,
37-
CampaignProcessor $campaignProcessor,
38+
MessageBusInterface $messageBus,
3839
) {
3940
parent::__construct($authentication, $validator);
4041
$this->campaignService = $campaignService;
41-
$this->campaignProcessor = $campaignProcessor;
42+
$this->messageBus = $messageBus;
4243
}
4344

4445
#[Route('', name: 'get_list', methods: ['GET'])]
@@ -388,8 +389,10 @@ public function sendMessage(
388389
throw $this->createNotFoundException('Campaign not found.');
389390
}
390391

391-
$this->campaignProcessor->process($message);
392-
392+
$this->messageBus->dispatch(
393+
new CampaignProcessorMessage($message->getId()),
394+
[new TransportNamesStamp(['sync'])]
395+
);
393396
return $this->json($this->campaignService->getMessage($message), Response::HTTP_OK);
394397
}
395398
}

0 commit comments

Comments
 (0)