Completed
Push — master ( 2ef464...a5d107 )
by Daniel
18s queued 11s
created

Destination::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jellyfish\Queue;
6
7
class Destination implements DestinationInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $name;
13
14
    /**
15
     * @var string
16
     */
17
    protected $type;
18
19
    /**
20
     * @var string[]
21
     */
22
    protected $properties;
23
24
    public function __construct()
25
    {
26
        $this->properties = [];
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getName(): string
33
    {
34
        return $this->name;
35
    }
36
37
    /**
38
     * @param string $name
39
     *
40
     * @return \Jellyfish\Queue\DestinationInterface
41
     */
42
    public function setName(string $name): DestinationInterface
43
    {
44
        $this->name = $name;
45
46
        return $this;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getType(): string
53
    {
54
        return $this->type;
55
    }
56
57
    /**
58
     * @param string $type
59
     *
60
     * @return \Jellyfish\Queue\DestinationInterface
61
     */
62
    public function setType(string $type): DestinationInterface
63
    {
64
        $this->type = $type;
65
66
        return $this;
67
    }
68
69
    /**
70
     * @param string $name
71
     *
72
     * @return string|null
73
     */
74
    public function getProperty(string $name): ?string
75
    {
76
        if (!isset($this->properties[$name])) {
77
            return null;
78
        }
79
80
        return $this->properties[$name];
81
    }
82
83
    /**
84
     * @param string $name
85
     * @param string $value
86
     *
87
     * @return \Jellyfish\Queue\DestinationInterface
88
     */
89
    public function setProperty(string $name, string $value): DestinationInterface
90
    {
91
        $this->properties[$name] = $value;
92
93
        return $this;
94
    }
95
}
96