These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | use Tomaj\Hermes\Driver\RabbitMqDriver; |
||
5 | use Tomaj\Hermes\Emitter; |
||
6 | use Tomaj\Hermes\Message; |
||
7 | use PhpAmqpLib\Connection\AMQPStreamConnection; |
||
8 | |||
9 | require_once __DIR__.'/../../vendor/autoload.php'; |
||
10 | |||
11 | |||
12 | $queueName = 'hermes_queue'; |
||
13 | $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest', '/'); |
||
14 | $channel = $connection->channel(); |
||
15 | $channel->queue_declare($queueName, false, false, false, false); |
||
16 | $driver = new RabbitMqDriver($channel, $queueName); |
||
0 ignored issues
–
show
|
|||
17 | |||
18 | $emitter = new Emitter($driver); |
||
19 | |||
20 | $counter = 1; |
||
21 | View Code Duplication | while (true) { |
|
22 | $emitter->emit(new Message('type1', ['message' => $counter])); |
||
23 | echo "Emited message $counter\n"; |
||
24 | $counter++; |
||
25 | sleep(1); |
||
26 | } |
||
27 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.