Passed
Push — feature/eco-3047/dev ( e2d4f4...a386ef )
by Aleksey
07:23 queued 18s
created

InvoiceSecuredB2CSubForm   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropertyPath() 0 3 1
A getProviderName() 0 3 1
A getTemplatePath() 0 3 1
A configureOptions() 0 5 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;
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 InvoiceSecuredB2CSubForm extends AbstractSubFormType implements SubFormInterface, SubFormProviderNameInterface
18
{
19
    protected const PAYMENT_METHOD_TEMPLATE_PATH = 'invoice-secured-b2c';
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_INVOICE_SECURED_B2C;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getPropertyPath(): string
41
    {
42
        return HeidelpayConfig::PAYMENT_METHOD_INVOICE_SECURED_B2C;
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