Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function __construct(string $key, int $nbTotalActions, int $nbSuccessfulActions) |
||
30 | { |
||
31 | $this->key = $key; |
||
32 | $this->nbTotalActions = max(0, $nbTotalActions); |
||
33 | $this->nbSuccessfulActions = max(0, $nbSuccessfulActions); |
||
34 | if ($this->nbSuccessfulActions > $this->nbTotalActions) { |
||
35 | throw new \InvalidArgumentException("The number of successful actions should not exceed the total number of actions."); |
||
36 | } |
||
37 | } |
||
38 | |||
69 |