QueueAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setQueue() 0 4 1
A getQueue() 0 3 1
1
<?php
2
3
namespace TraderInteractive\Mongo;
4
5
/**
6
 * Trait for QueueAwareInterface implementation.
7
 */
8
trait QueueAwareTrait
9
{
10
    /**
11
     * The mongoQueue instance.
12
     *
13
     * @var QueueInterface
14
     */
15
    private $mongoQueue;
16
17
    /**
18
     * Returns the Queue instance.
19
     *
20
     * @return QueueInterface
21
     */
22
    public function getQueue() : QueueInterface
23
    {
24
        return $this->mongoQueue;
25
    }
26
27
    /**
28
     * Sets the Queue instance.
29
     *
30
     * @param QueueInterface $mongoQueue
31
     *
32
     * @return QueueAwareInterface
33
     */
34
    public function setQueue(QueueInterface $mongoQueue)
35
    {
36
        $this->mongoQueue = $mongoQueue;
37
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type TraderInteractive\Mongo\QueueAwareTrait which is incompatible with the documented return type TraderInteractive\Mongo\QueueAwareInterface.
Loading history...
38
    }
39
}
40