Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 15 | public function get(string|null $gateway = null): SignerInterface |
|
37 | { |
||
38 | 15 | if (null === $gateway) { |
|
39 | 3 | $gateway = $this->configs->getDefaultGateway(); |
|
40 | } |
||
41 | 15 | if (array_key_exists($gateway, $this->signers)) { |
|
42 | 6 | return $this->signers[$gateway]; |
|
43 | } |
||
44 | |||
45 | 15 | $signer = $this->signerFactory->create($this->configs->getConfig($gateway)); |
|
46 | 15 | $this->signers[$gateway] = $signer; |
|
47 | |||
48 | 15 | return $signer; |
|
49 | } |
||
51 |