@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace PH\Component\Core\Model; |
| 6 | 6 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | return null; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - $payment = $this->payments->filter(function (PaymentInterface $payment) use ($state) { |
|
| 122 | + $payment = $this->payments->filter(function(PaymentInterface $payment) use ($state) { |
|
| 123 | 123 | return null === $state || $payment->getState() === $state; |
| 124 | 124 | })->last(); |
| 125 | 125 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | /** |
| 186 | 186 | * {@inheritdoc} |
| 187 | 187 | */ |
| 188 | - public function setMethod(?PaymentMethodInterface $method): void |
|
| 188 | + public function setMethod(?PaymentMethodInterface $method) : void |
|
| 189 | 189 | { |
| 190 | 190 | $this->method = $method; |
| 191 | 191 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace PH\Component\Core\Model; |
| 6 | 6 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | /** |
| 87 | 87 | * @param null|PaymentMethodInterface $method |
| 88 | 88 | */ |
| 89 | - public function setMethod(?PaymentMethodInterface $method): void; |
|
| 89 | + public function setMethod(?PaymentMethodInterface $method) : void; |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * @return array |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace PH\Bundle\CoreBundle\Form\Extension; |
| 6 | 6 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 40 | 40 | { |
| 41 | - $formModifier = function (FormInterface $form, string $type = null) { |
|
| 41 | + $formModifier = function(FormInterface $form, string $type = null) { |
|
| 42 | 42 | $methods = null === $type ? [] : $this->paymentMethodsProvider->getSupportedMethods($type); |
| 43 | 43 | |
| 44 | 44 | $form->add('method', PaymentMethodChoiceType::class, [ |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $builder->addEventListener( |
| 51 | 51 | FormEvents::PRE_SET_DATA, |
| 52 | - function (FormEvent $event) use ($formModifier) { |
|
| 52 | + function(FormEvent $event) use ($formModifier) { |
|
| 53 | 53 | $data = $event->getData(); |
| 54 | 54 | |
| 55 | 55 | $formModifier($event->getForm(), $data->getType()); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $builder->get('type')->addEventListener( |
| 60 | 60 | FormEvents::POST_SUBMIT, |
| 61 | - function (FormEvent $event) use ($formModifier) { |
|
| 61 | + function(FormEvent $event) use ($formModifier) { |
|
| 62 | 62 | $type = $event->getForm()->getData(); |
| 63 | 63 | $formModifier($event->getForm()->getParent(), $type); |
| 64 | 64 | } |
@@ -68,14 +68,14 @@ discard block |
||
| 68 | 68 | ->add('metadata', TextType::class); |
| 69 | 69 | |
| 70 | 70 | $builder->get('metadata')->addModelTransformer(new CallbackTransformer( |
| 71 | - function ($value) { |
|
| 71 | + function($value) { |
|
| 72 | 72 | if (is_array($value)) { |
| 73 | 73 | return json_encode($value); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $value; |
| 77 | 77 | }, |
| 78 | - function ($value) { |
|
| 78 | + function($value) { |
|
| 79 | 79 | if (is_string($value)) { |
| 80 | 80 | return json_decode($value, true); |
| 81 | 81 | } |