Completed
Pull Request — master (#1)
by Raymond
02:20
created

PersistentSubscriptionInfo::getSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace RayRutjes\GetEventStore;
4
5
final class PersistentSubscriptionInfo
6
{
7
    /**
8
     * @var StreamId
9
     */
10
    private $streamId;
11
12
    /**
13
     * @var string
14
     */
15
    private $groupName;
16
17
    /**
18
     * @var PersistentSubscriptionSettings
19
     */
20
    private $settings;
21
22
    /**
23
     * @param StreamId                       $streamId
24
     * @param string                         $groupName
25
     * @param PersistentSubscriptionSettings $settings
26
     */
27
    public function __construct(StreamId $streamId, string $groupName, PersistentSubscriptionSettings $settings)
28
    {
29
        $this->streamId = $streamId;
30
        $this->groupName = $groupName;
31
        $this->settings = $settings;
32
    }
33
34
    /**
35
     * @return StreamId
36
     */
37
    public function getStreamId(): StreamId
38
    {
39
        return $this->streamId;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getGroupName(): string
46
    {
47
        return $this->groupName;
48
    }
49
50
    /**
51
     * Returns a clone of the settings for immutability.
52
     *
53
     * @return PersistentSubscriptionSettings
54
     */
55
    public function getSettings(): PersistentSubscriptionSettings
56
    {
57
        return clone $this->settings;
58
    }
59
}
60