Total Complexity | 5 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class SubscriptionRegistry |
||
14 | { |
||
15 | /** |
||
16 | * @var SubscriptionStrategyInterface[] |
||
17 | */ |
||
18 | private $strategies; |
||
19 | |||
20 | /** |
||
21 | * Constructor. |
||
22 | * |
||
23 | */ |
||
24 | 16 | public function __construct() |
|
25 | { |
||
26 | 16 | $this->strategies = []; |
|
27 | 16 | } |
|
28 | |||
29 | /** |
||
30 | * Add strategy. |
||
31 | * |
||
32 | * @param SubscriptionStrategyInterface $strategy |
||
33 | * @param string $name |
||
34 | * |
||
35 | * @return SubscriptionRegistry |
||
36 | * |
||
37 | * @throws \InvalidArgumentException |
||
38 | */ |
||
39 | 16 | public function addStrategy(SubscriptionStrategyInterface $strategy, $name) |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * Get strategy. |
||
52 | * |
||
53 | * @param string $name |
||
54 | * |
||
55 | * @return SubscriptionStrategyInterface |
||
56 | * |
||
57 | * @throws StrategyNotFoundException |
||
58 | */ |
||
59 | 11 | public function get($name) |
|
68 |