1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SprykerEco\Yves\Braintree\Form; |
4
|
|
|
|
5
|
|
|
use Generated\Shared\Transfer\QuoteTransfer; |
|
|
|
|
6
|
|
|
use Spryker\Yves\Kernel\Form\AbstractType; |
7
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
8
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
9
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
10
|
|
|
use Symfony\Component\Validator\Constraints\NotBlank; |
11
|
|
|
|
12
|
|
|
class CheckoutShipmentForm extends AbstractType |
13
|
|
|
{ |
14
|
|
|
public const FIELD_ID_SHIPMENT_METHOD = 'idShipmentMethod'; |
15
|
|
|
public const OPTION_SHIPMENT_METHODS = 'shipmentMethods'; |
16
|
|
|
|
17
|
|
|
public const SHIPMENT_PROPERTY_PATH = 'shipment'; |
18
|
|
|
public const SHIPMENT_SELECTION = 'shipmentSelection'; |
19
|
|
|
public const SHIPMENT_SELECTION_PROPERTY_PATH = self::SHIPMENT_PROPERTY_PATH . '.' . self::SHIPMENT_SELECTION; |
20
|
|
|
|
21
|
|
|
protected const VALIDATION_NOT_BLANK_MESSAGE = 'validation.not_blank'; |
22
|
|
|
|
23
|
|
|
public const FORM_NAME = 'checkoutShipmentForm'; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @return string |
27
|
|
|
*/ |
28
|
|
|
public function getBlockPrefix() |
29
|
|
|
{ |
30
|
|
|
return static::FORM_NAME; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options) |
34
|
|
|
{ |
35
|
|
|
$builder->setAction('/test'); |
36
|
|
|
|
37
|
|
|
$this->addIdShipmentMethod($builder, $options); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param FormBuilderInterface $builder |
42
|
|
|
* @param array $options |
43
|
|
|
* |
44
|
|
|
* @return void |
45
|
|
|
*/ |
46
|
|
|
protected function addIdShipmentMethod(FormBuilderInterface $builder, array $options): void |
47
|
|
|
{ |
48
|
|
|
$builder->add(self::FIELD_ID_SHIPMENT_METHOD, ChoiceType::class, [ |
49
|
|
|
'choices' => $options[self::OPTION_SHIPMENT_METHODS], |
50
|
|
|
'expanded' => true, |
51
|
|
|
'multiple' => false, |
52
|
|
|
'required' => true, |
53
|
|
|
'property_path' => static::SHIPMENT_SELECTION_PROPERTY_PATH, |
54
|
|
|
'placeholder' => false, |
55
|
|
|
'constraints' => [ |
56
|
|
|
new NotBlank(), |
57
|
|
|
], |
58
|
|
|
'label' => false, |
59
|
|
|
]); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @param OptionsResolver $resolver |
64
|
|
|
*/ |
65
|
|
|
public function configureOptions(OptionsResolver $resolver) |
66
|
|
|
{ |
67
|
|
|
$resolver->setRequired('shipmentMethods'); |
68
|
|
|
} |
69
|
|
|
} |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths