| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class CrefoPayPaymentMethodMapper implements CrefoPayPaymentMethodMapperInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var \SprykerEco\Zed\CrefoPay\CrefoPayConfig |
||
| 16 | */ |
||
| 17 | protected $config; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param \SprykerEco\Zed\CrefoPay\CrefoPayConfig $config |
||
| 21 | */ |
||
| 22 | public function __construct(CrefoPayConfig $config) |
||
| 23 | { |
||
| 24 | $this->config = $config; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $internalPaymentMethodName |
||
| 29 | * |
||
| 30 | * @return string|null |
||
| 31 | */ |
||
| 32 | public function mapInternalToExternalPaymentMethodName(string $internalPaymentMethodName): ?string |
||
| 33 | { |
||
| 34 | $paymentMethodNames = $this->getInternalToExternalPaymentMethodNamesMapping(); |
||
| 35 | |||
| 36 | if (!isset($paymentMethodNames[$internalPaymentMethodName])) { |
||
| 37 | return null; |
||
| 38 | } |
||
| 39 | |||
| 40 | return $paymentMethodNames[$internalPaymentMethodName]; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string[] |
||
| 45 | */ |
||
| 46 | protected function getInternalToExternalPaymentMethodNamesMapping(): array |
||
| 49 | } |
||
| 50 | } |
||
| 51 |