Completed
Push — master ( b791da...819535 )
by Oleksandr
15s queued 11s
created

AbstractHeidelpaySubForm::getTemplatePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 0
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;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfer\HeidelpayPaymentTransfer 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 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 AbstractHeidelpaySubForm extends AbstractSubFormType implements SubFormInterface, SubFormProviderNameInterface
18
{
19
    public const PAYMENT_PROVIDER = HeidelpayConfig::PROVIDER_NAME;
20
    public const PAYMENT_METHOD = '';
21
    public const PAYMENT_METHOD_TEMPLATE_PATH = '';
22
23
    /**
24
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
25
     *
26
     * @return void
27
     */
28
    public function configureOptions(OptionsResolver $resolver): void
29
    {
30
        $resolver->setDefaults([
31
            'data_class' => HeidelpayPaymentTransfer::class,
32
            SubFormInterface::OPTIONS_FIELD_NAME => [],
33
        ]);
34
    }
35
36
    /**
37
     * Specifies the property name of the payment transfer object to access the default form data.
38
     * Form data will be obtained from QuoteTransfer->getPayment()->getHeidelpaySofort()
39
     *
40
     * @return string
41
     */
42
    public function getPropertyPath(): string
43
    {
44
        return static::PAYMENT_METHOD;
45
    }
46
47
    /**
48
     * Using this key, the subform will be registered inside of the twig provider and will be called
49
     * in payment.twig template.
50
     *
51
     * @return string
52
     */
53
    public function getName(): string
54
    {
55
        return static::PAYMENT_METHOD;
56
    }
57
58
    /**
59
     * Path to the form template
60
     *
61
     * @return string
62
     */
63
    public function getTemplatePath(): string
64
    {
65
        return static::PAYMENT_PROVIDER . '/' . static::PAYMENT_METHOD_TEMPLATE_PATH;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getProviderName()
72
    {
73
        return static::PAYMENT_PROVIDER;
74
    }
75
}
76