QueueName   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
A getQueueName() 0 7 2
A getName() 0 4 1
A getPrefix() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: polidog
5
 * Date: 2016/03/14
6
 */
7
8
namespace Tavii\SQSJobQueue\Queue;
9
10
11
final class QueueName
12
{
13
    /**
14
     * @var string
15
     */
16
    private $name;
17
18
    /**
19
     * @var string
20
     */
21
    private $prefix;
22
23
    /**
24
     * JobName constructor.
25
     * @param string $name
26
     * @param string $prefix
27
     * @param string $separator
28
     */
29
    public function __construct($name, $prefix = "")
30
    {
31
        $this->name = $name;
32
        $this->prefix = $prefix;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function __toString()
39
    {
40
        return $this->getQueueName();
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getQueueName()
47
    {
48
        if (empty($this->prefix)) {
49
            return $this->name;
50
        }
51
        return $this->prefix.$this->name;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getName()
58
    {
59
        return $this->name;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getPrefix()
66
    {
67
        return $this->prefix;
68
    }
69
70
71
}
72