Passed
Push — master ( a7d12b...46dbe8 )
by Dmitry
03:07
created

TarantoolQueueTransport::setQueue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace OpenTelemetry\Tracing\Transport;
6
7
use OpenTelemetry\Tracing\Transport;
8
use Tarantool\Queue\Queue;
0 ignored issues
show
Bug introduced by
The type Tarantool\Queue\Queue was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Exception;
10
11
class TarantoolQueueTransport implements Transport
12
{
13
    private $queue;
14
15
    public function write(array $data) : bool
16
    {
17
        return $this->getQueue()->put($data) ? true : false;
18
    }
19
20
    public function getQueue() : Queue
21
    {
22
        if (!$this->queue) {
23
            throw new Exception("Queue should be set");
24
        }
25
        return $this->queue;
26
    }
27
28
    public function setQueue(Queue $queue) : self
29
    {
30
        $this->queue = $queue;
31
        return $this;
32
    }
33
}