InvoiceSubForm   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getPropertyPath() 0 3 1
A setDefaultOptions() 0 3 1
A getTemplatePath() 0 3 1
A configureOptions() 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\Ratepay\Form;
9
10
use Generated\Shared\Transfer\RatepayPaymentInvoiceTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...yPaymentInvoiceTransfer 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\SubFormInterface;
12
use SprykerEco\Shared\Ratepay\RatepayConfig;
13
use Symfony\Component\OptionsResolver\OptionsResolver;
14
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Option...ptionsResolverInterface 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...
15
16
class InvoiceSubForm extends SubFormAbstract
17
{
18
    public const PAYMENT_METHOD = 'invoice';
19
20
    /**
21
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
22
     *
23
     * @return void
24
     */
25
    public function configureOptions(OptionsResolver $resolver)
26
    {
27
        $resolver->setDefaults([
28
            'data_class' => RatepayPaymentInvoiceTransfer::class,
29
            SubFormInterface::OPTIONS_FIELD_NAME => [],
30
        ]);
31
    }
32
33
    /**
34
     * @deprecated Use `configureOptions()` instead.
35
     *
36
     * @param \Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver
37
     *
38
     * @return void
39
     */
40
    public function setDefaultOptions(OptionsResolverInterface $resolver)
41
    {
42
        $this->configureOptions($resolver);
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getPropertyPath()
49
    {
50
        return RatepayConfig::PAYMENT_METHOD_INVOICE;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getName()
57
    {
58
        return RatepayConfig::PAYMENT_METHOD_INVOICE;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getTemplatePath()
65
    {
66
        return RatepayConfig::PROVIDER_NAME . '/' . static::PAYMENT_METHOD;
67
    }
68
}
69