| Conditions | 3 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 20 | public function getConfig(string|null $gateway = null): SignerConfig |
|
| 34 | { |
||
| 35 | 20 | if (null === $gateway) { |
|
| 36 | 4 | $gateway = $this->defaultGateway; |
|
| 37 | } |
||
| 38 | 20 | if (array_key_exists($gateway, $this->configs)) { |
|
| 39 | 19 | return $this->configs[$gateway]; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | throw new InvalidArgumentException( |
|
| 43 | 1 | sprintf('Config for gateway "%s" does not exist. You are probably forgot added or you wrong set default config.', $gateway) |
|
| 44 | 1 | ); |
|
| 57 |