1 | <?php |
||
20 | final class PaymentMethodNameToGatewayConverter implements PaymentMethodNameToGatewayConverterInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var RegistryInterface |
||
24 | */ |
||
25 | private $payumRegistry; |
||
26 | |||
27 | /** |
||
28 | * @param RegistryInterface $payumRegistry |
||
29 | */ |
||
30 | public function __construct(RegistryInterface $payumRegistry) |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function convert($paymentMethodName) |
||
44 | |||
45 | /** |
||
46 | * @return GatewayInterface[] |
||
47 | */ |
||
48 | private function getRegisteredGateways() |
||
52 | |||
53 | /** |
||
54 | * @param string $paymentMethodName |
||
55 | * |
||
56 | * @throws \InvalidArgumentException |
||
57 | */ |
||
58 | private function validate($paymentMethodName) |
||
64 | |||
65 | /** |
||
66 | * @param string $paymentMethodName |
||
67 | * |
||
68 | * @throws \RuntimeException |
||
69 | * |
||
70 | * @return string |
||
|
|||
71 | */ |
||
72 | private function tryToMapPaymentMethodName($paymentMethodName) |
||
85 | |||
86 | /** |
||
87 | * @param string $gatewayKey |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | private function convertGatewayKeyToName($gatewayKey) |
||
95 | } |
||
96 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.