PaypalDebitSubForm   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 46
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getProviderName() 0 3 1
A getTemplatePath() 0 3 1
A configureOptions() 0 5 1
A getPropertyPath() 0 3 1
A getName() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Yves\Heidelpay\Form;
9
10
use Generated\Shared\Transfer\HeidelpayPaymentTransfer;
11
use Spryker\Yves\StepEngine\Dependency\Form\AbstractSubFormType;
12
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface;
13
use Spryker\Yves\StepEngine\Dependency\Form\SubFormProviderNameInterface;
14
use SprykerEco\Shared\Heidelpay\HeidelpayConfig;
15
use Symfony\Component\OptionsResolver\OptionsResolver;
16
17
class PaypalDebitSubForm extends AbstractSubFormType implements SubFormInterface, SubFormProviderNameInterface
18
{
19
    protected const PAYMENT_METHOD_TEMPLATE_PATH = 'paypal-debit';
20
21
    /**
22
     * @return string
23
     */
24
    public function getProviderName(): string
25
    {
26
        return HeidelpayConfig::PROVIDER_NAME;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getName(): string
33
    {
34
        return HeidelpayConfig::PAYMENT_METHOD_PAYPAL_DEBIT;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getPropertyPath(): string
41
    {
42
        return HeidelpayConfig::PAYMENT_METHOD_PAYPAL_DEBIT;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getTemplatePath(): string
49
    {
50
        return HeidelpayConfig::PROVIDER_NAME . DIRECTORY_SEPARATOR . static::PAYMENT_METHOD_TEMPLATE_PATH;
51
    }
52
53
    /**
54
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
55
     *
56
     * @return void
57
     */
58
    public function configureOptions(OptionsResolver $resolver): void
59
    {
60
        $resolver->setDefaults([
61
            'data_class' => HeidelpayPaymentTransfer::class,
62
        ])->setRequired(static::OPTIONS_FIELD_NAME);
63
    }
64
}
65