InvoiceSubForm::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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