Completed
Pull Request — master (#14)
by Саша
02:04
created

QueuedTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Extraload\Transformer;
4
5
use Ko\AmqpBroker;
6
7 View Code Duplication
class QueuedTransformer implements TransformerInterface
8
{
9
    private $transformer;
10
    private $broker;
11
    private $consumer;
12
13
    public function __construct(TransformerConsumer $transformer, AmqpBroker $broker, $consumer)
14
    {
15
        $this->transformer = $transformer;
16
        $this->broker = $broker;
17
        $this->consumer = $consumer;
18
    }
19
20
    public function transform($data = null)
21
    {
22
        $this->broker->getConsumer($this->consumer)->consume([$this->transformer, 'transform'], AMQP_AUTOACK);
23
    }
24
}
25