Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.032 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | 16 | public function addStrategy(SubscriptionStrategyInterface $strategy, $name) |
|
40 | { |
||
41 | 16 | if (array_key_exists($name, $this->strategies)) { |
|
42 | throw new \InvalidArgumentException(sprintf('The strategy %s is already a registered strategy.', $name)); |
||
43 | } |
||
44 | |||
45 | 16 | $this->strategies[$name] = $strategy; |
|
46 | |||
47 | 16 | return $this; |
|
48 | } |
||
68 |