-
Notifications
You must be signed in to change notification settings - Fork 0
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
GKarman/hw19 rabbit-mq #1165
base: GKarman/main
Are you sure you want to change the base?
GKarman/hw19 rabbit-mq #1165
Conversation
README.md
Outdated
docker-compose up -d | ||
``` | ||
|
||
3. Зайти внутрь php-fpm и запустить скрипт consumer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Было бы лучше если бы сам скрипт стартовал. Для этого можно создать отдельный контейнер в котором он будет запускаться.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал
@@ -0,0 +1,24 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поправьте все замечания линтера.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал
use Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\ReportDateFrom; | ||
use Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\ReportDateTo; | ||
|
||
class OrderReportRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно воспользоваться readonly классом
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал
*/ | ||
private function init(): void | ||
{ | ||
$configs = parse_ini_file('src/Configs/rabbitMQ.ini'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше выделить в отдельный класс, в котором разобрать файл и разложить по свойствам. Объект этого класса передать сюда через конструктор данного класса.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал
|
||
class RabbitMQConfigs | ||
{ | ||
private readonly ?string $host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поправьте все замечания линтера.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поравил
{ | ||
public function run() | ||
{ | ||
$configs = parse_ini_file('src/Configs/rabbitMQ.ini'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут остался парсинг ini файла.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрал, спасибо
public function run() | ||
{ | ||
$configs = parse_ini_file('src/Configs/rabbitMQ.ini'); | ||
$connection = new AMQPStreamConnection($configs['host'], $configs['port'], $configs['user'], $configs['password']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше создать вне данного класса и сюда прокинуть как зависимость.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал, спасибо!
{ | ||
try { | ||
$generateOrderRequest = GenerateOrderRequest::createFromArray($request); | ||
$useCase = new GenerateReportUseCase(new RabbitMQQueueRepository()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше создать вне текущего класса и сюда прокинуть как зависимость, через конструктор.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cделал, спасибо
*/ | ||
private function init(RabbitMqConfigs $rabbitMQConfigs): void | ||
{ | ||
$this->connection = new AMQPStreamConnection( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше создать вне текущего класса и сюда прокинуть как зависимость, через конструктор.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал, спасибо
No description provided.