Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
23 | public function with($policy) : FailSafe |
||
24 | { |
||
25 | if ($policy instanceof CircuitBreaker) { |
||
26 | $this->circuitBreaker = $policy; |
||
27 | |||
28 | return $this; |
||
29 | } |
||
30 | |||
31 | if ($policy instanceof Retry) { |
||
32 | $this->retry = $policy; |
||
33 | |||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | throw new \InvalidArgumentException('Argument is an invalid policy'); |
||
38 | } |
||
39 | |||
56 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.