Completed
Pull Request — master (#60)
by Chad
01:21
created

QueueAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getQueue() 0 4 1
A setQueue() 0 5 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;
38
    }
39
}
40