IdealOnlineTransferDataProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
c 1
b 0
f 0
dl 0
loc 58
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 10 2
A getBankGroupTypes() 0 13 1
A getBankCountries() 0 4 1
A getOptions() 0 5 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Payone\Form\DataProvider;
9
10
use Generated\Shared\Transfer\PaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\PayonePaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayonePaymentTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
13
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface;
14
use SprykerEco\Yves\Payone\Form\IdealOnlineTransferSubForm;
15
16
class IdealOnlineTransferDataProvider implements StepEngineFormDataProviderInterface
17
{
18
    /**
19
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
     *
21
     * @return \Spryker\Shared\Kernel\Transfer\AbstractTransfer
22
     */
23
    public function getData(AbstractTransfer $quoteTransfer)
24
    {
25
        /** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */
26
        if ($quoteTransfer->getPayment() === null) {
27
            $paymentTransfer = new PaymentTransfer();
28
            $paymentTransfer->setPayone(new PayonePaymentTransfer());
29
            $quoteTransfer->setPayment($paymentTransfer);
30
        }
31
32
        return $quoteTransfer;
33
    }
34
35
    /**
36
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer $quoteTransfer
37
     *
38
     * @return array
39
     */
40
    public function getOptions(AbstractTransfer $quoteTransfer)
41
    {
42
        return [
43
            IdealOnlineTransferSubForm::OPTION_BANK_COUNTRIES => $this->getBankCountries(),
44
            IdealOnlineTransferSubForm::OPTION_BANK_GROUP_TYPES => $this->getBankGroupTypes(),
45
        ];
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    protected function getBankCountries()
52
    {
53
        return [
54
            'NL' => 'Netherlands',
55
        ];
56
    }
57
58
    /**
59
     * @return array
60
     */
61
    protected function getBankGroupTypes()
62
    {
63
        return [
64
            'ABN Amro' => 'ABN_AMRO_BANK',
65
            'Rabobank' => 'RABOBANK',
66
            'Friesland Bank' => 'FRIESLAND_BANK',
67
            'ASN Bank' => 'ASN_BANK',
68
            'SNS Bank' => 'SNS_BANK',
69
            'Triodos' => 'TRIODOS_BANK',
70
            'SNS Regio Bank' => 'SNS_REGIO_BANK',
71
            'ING' => 'ING_BANK',
72
            'Knab Bank' => 'KNAB_BANK',
73
            'van Lanschot Bank' => 'VAN_LANSCHOT_BANKIERS',
74
        ];
75
    }
76
}
77