Passed
Push — master ( f48571...166e66 )
by Oleksandr
07:53 queued 10s
created

CashOnDeliverySubForm   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 0 5 1
A getPropertyPath() 0 3 1
A setDefaultOptions() 0 3 1
A getName() 0 3 1
A getTemplatePath() 0 3 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\Payone\Form;
9
10
use Generated\Shared\Transfer\PaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PaymentTransfer 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 Generated\Shared\Transfer\PayonePaymentCashOnDeliveryTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tCashOnDeliveryTransfer 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...
12
use Generated\Shared\Transfer\PayonePaymentTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayonePaymentTransfer 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...
13
use Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface;
14
use SprykerEco\Shared\Payone\PayoneConstants;
15
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
16
use Symfony\Component\Form\FormBuilderInterface;
17
use Symfony\Component\OptionsResolver\OptionsResolver;
18
19
class CashOnDeliverySubForm extends AbstractPayoneSubForm
20
{
21
    public const PAYMENT_METHOD = 'cash_on_delivery';
22
23
    /**
24
     * @return string
25
     */
26
    public function getName(): string
27
    {
28
        return PaymentTransfer::PAYONE_CASH_ON_DELIVERY;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getPropertyPath(): string
35
    {
36
        return PaymentTransfer::PAYONE_CASH_ON_DELIVERY;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getTemplatePath(): string
43
    {
44
        return PayoneConstants::PROVIDER_NAME . '/' . self::PAYMENT_METHOD;
45
    }
46
47
    /**
48
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
49
     *
50
     * @return void
51
     */
52
    public function configureOptions(OptionsResolver $resolver): void
53
    {
54
        $resolver->setDefaults([
55
            'data_class' => PayonePaymentCashOnDeliveryTransfer::class,
56
        ])->setRequired(SubFormInterface::OPTIONS_FIELD_NAME);
57
    }
58
59
    /**
60
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
61
     *
62
     * @return void
63
     */
64
    public function setDefaultOptions(OptionsResolver $resolver): void
65
    {
66
        $this->configureOptions($resolver);
67
    }
68
}
69