GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c0447f...f0076f )
by Alex
54:49
created

BatchProducer::produce()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 3
eloc 8
nc 3
nop 1
1
<?php
2
3
4
namespace AmqpWorkers;
5
6
7
class BatchProducer extends Producer
8
{
9
    /**
10
     * @param array|\Traversable $messages
11
     * @throws \AmqpWorkers\Exception\ProducerNotProperlyConfigured
12
     */
13
    public function produce($messages)
14
    {
15
        $channel = $this->getChannel();
16
17
        foreach ($messages as $payload) {
18
            if ($this->isExchange()) {
19
                $channel->batch_basic_publish($this->createMessage($payload), $this->exchange->getName());
20
            } else {
21
                $channel->batch_basic_publish($this->createMessage($payload), '', $this->queue->getName());
22
            }
23
        }
24
25
        $channel->publish_batch();
26
    }
27
28
}
29