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

PersistentSubscriptionInfo   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 55
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getStreamId() 0 4 1
A getGroupName() 0 4 1
A getSettings() 0 4 1
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