@@ -40,6 +40,9 @@ |
||
| 40 | 40 | ; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param \Doctrine\ORM\QueryBuilder $queryBuilder |
|
| 45 | + */ |
|
| 43 | 46 | public function applyCustomCriteria($queryBuilder, $criteria): void |
| 44 | 47 | { |
| 45 | 48 | foreach ((array) $criteria as $key => $criterion) { |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = []): void |
| 35 | 35 | { |
| 36 | - $criteria = array_filter($criteria, function ($value) { |
|
| 36 | + $criteria = array_filter($criteria, function($value) { |
|
| 37 | 37 | return !is_null($value); |
| 38 | 38 | }); |
| 39 | 39 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | 'data' => $gatewayFactory, |
| 30 | 30 | ]) |
| 31 | 31 | ->add('supportsRecurring', CheckboxType::class) |
| 32 | - ->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) { |
|
| 32 | + ->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) { |
|
| 33 | 33 | $paymentMethod = $event->getData(); |
| 34 | 34 | |
| 35 | 35 | if (!$paymentMethod instanceof PaymentMethodInterface) { |
@@ -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 | } |
@@ -36,10 +36,10 @@ |
||
| 36 | 36 | |
| 37 | 37 | $builder->get('startDate') |
| 38 | 38 | ->addModelTransformer(new CallbackTransformer( |
| 39 | - function ($value) { |
|
| 39 | + function($value) { |
|
| 40 | 40 | return $value; |
| 41 | 41 | }, |
| 42 | - function ($value) { |
|
| 42 | + function($value) { |
|
| 43 | 43 | if (is_string($value)) { |
| 44 | 44 | return new \DateTime($value); |
| 45 | 45 | } |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | return null; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $payment = $this->payments->filter(function (PaymentInterface $payment) use ($state) { |
|
| 117 | + $payment = $this->payments->filter(function(PaymentInterface $payment) use ($state) { |
|
| 118 | 118 | return null === $state || $payment->getState() === $state; |
| 119 | 119 | })->last(); |
| 120 | 120 | |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | */ |
| 104 | 104 | private function getPaymentsWithState(SubscriptionInterface $subscription, string $state) |
| 105 | 105 | { |
| 106 | - return $subscription->getPayments()->filter(function (PaymentInterface $payment) use ($state) { |
|
| 106 | + return $subscription->getPayments()->filter(function(PaymentInterface $payment) use ($state) { |
|
| 107 | 107 | return $state === $payment->getState(); |
| 108 | 108 | }); |
| 109 | 109 | } |