| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function create(string $commandKey, array $circuitBreakerConfig) |
||
| 31 | { |
||
| 32 | if (! isset($this->circuitBreakersByCommand[$commandKey])) { |
||
| 33 | if ($circuitBreakerConfig['enabled']) { |
||
| 34 | $this->circuitBreakersByCommand[$commandKey] = |
||
| 35 | new CircuitBreaker($commandKey, $this->storage, $circuitBreakerConfig); |
||
| 36 | } else { |
||
| 37 | $this->circuitBreakersByCommand[$commandKey] = new ClosedCircuitBreaker(); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | return $this->circuitBreakersByCommand[$commandKey]; |
||
| 42 | } |
||
| 44 |