| Total Complexity | 8 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 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 |
||
| 94 | } |
||
| 95 | } |
||
| 96 |