Payload   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 54
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A getToken() 0 4 1
A getQueue() 0 4 1
A getState() 0 4 1
1
<?php
2
3
namespace Simplario\Quedis;
4
5
use Simplario\Quedis\Interfaces\PayloadInterface;
6
7
/**
8
 * Class Payload
9
 * @package Simplario\Quedis
10
 */
11
class Payload implements PayloadInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $token;
17
    /**
18
     * @var string
19
     */
20
    protected $queue;
21
    /**
22
     * @var string
23
     */
24
    protected $state;
25
26
    /**
27
     * Payload constructor.
28
     * @param string|Message $token
29
     * @param string $queue
30
     * @param string $state
31
     */
32 25
    public function __construct($token, $queue, $state)
33
    {
34 25
        $this->token = $token instanceof Message ? $token->getToken() : $token;
35 25
        $this->queue = $queue;
36 25
        $this->state = $state;
37 25
    }
38
39
    /**
40
     * @return string
41
     */
42 19
    public function getToken()
43
    {
44 19
        return $this->token;
45
    }
46
47
    /**
48
     * @return string
49
     */
50 19
    public function getQueue()
51
    {
52 19
        return $this->queue;
53
    }
54
55
    /**
56
     * @return string
57
     */
58 24
    public function getState()
59
    {
60 24
        return $this->state;
61
    }
62
63
64
}
65