@@ -30,12 +30,12 @@ |
||
30 | 30 | $builder |
31 | 31 | ->add('start', 'date', array( |
32 | 32 | 'label' => 'sylius.form.report.user_registration.start', |
33 | - 'years' => range(date('Y')-100, date('Y')), |
|
33 | + 'years' => range(date('Y') - 100, date('Y')), |
|
34 | 34 | 'data' => new \DateTime(), |
35 | 35 | )) |
36 | 36 | ->add('end', 'date', array( |
37 | 37 | 'label' => 'sylius.form.report.user_registration.end', |
38 | - 'years' => range(date('Y')-100, date('Y')), |
|
38 | + 'years' => range(date('Y') - 100, date('Y')), |
|
39 | 39 | 'data' => new \DateTime(), |
40 | 40 | )) |
41 | 41 | ->add('period', 'choice', array( |
@@ -44,7 +44,7 @@ |
||
44 | 44 | ->add('variant', 'sylius_entity_to_identifier', array( |
45 | 45 | 'label' => 'sylius.form.action.add_product_configuration.variant', |
46 | 46 | 'class' => $this->variantRepository->getClassName(), |
47 | - 'query_builder' => function () { |
|
47 | + 'query_builder' => function() { |
|
48 | 48 | return $this->variantRepository->getFormQueryBuilder(); |
49 | 49 | }, |
50 | 50 | 'constraints' => array( |
@@ -45,7 +45,7 @@ |
||
45 | 45 | 'label' => 'sylius.form.action.customer_group', |
46 | 46 | 'property' => 'name', |
47 | 47 | 'class' => $this->groupRepository->getClassName(), |
48 | - 'query_builder' => function () { |
|
48 | + 'query_builder' => function() { |
|
49 | 49 | return $this->groupRepository->getFormQueryBuilder(); |
50 | 50 | }, |
51 | 51 | 'constraints' => array( |
@@ -31,13 +31,13 @@ |
||
31 | 31 | { |
32 | 32 | parent::configureOptions($resolver); |
33 | 33 | |
34 | - $queryBuilder = function (Options $options) { |
|
34 | + $queryBuilder = function(Options $options) { |
|
35 | 35 | $repositoryOptions = array( |
36 | 36 | 'disabled' => $options['disabled'], |
37 | 37 | 'channel' => $options['channel'], |
38 | 38 | ); |
39 | 39 | |
40 | - return function (PaymentMethodRepositoryInterface $repository) use ($repositoryOptions) { |
|
40 | + return function(PaymentMethodRepositoryInterface $repository) use ($repositoryOptions) { |
|
41 | 41 | return $repository->getQueryBuidlerForChoiceType($repositoryOptions); |
42 | 42 | }; |
43 | 43 | }; |
@@ -51,7 +51,7 @@ |
||
51 | 51 | 'by_reference' => false, |
52 | 52 | 'label' => 'sylius.form.cart.coupon', |
53 | 53 | )) |
54 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
54 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
55 | 55 | $data = $event->getData(); |
56 | 56 | |
57 | 57 | if (!$data->getPromotionCoupons()->isEmpty()) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function buildForm(FormBuilderInterface $builder, array $options) |
33 | 33 | { |
34 | 34 | $builder |
35 | - ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
35 | + ->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
36 | 36 | $data = $event->getData(); |
37 | 37 | |
38 | 38 | if (!array_key_exists('differentBillingAddress', $data) || false === $data['differentBillingAddress']) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $event->setData($data); |
42 | 42 | } |
43 | 43 | }) |
44 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { |
|
44 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options) { |
|
45 | 45 | /* @var CustomerInterface $customer */ |
46 | 46 | $customer = $options['customer']; |
47 | 47 | // if customer does not have user, it is not registered, so we do not preset data |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $notBlank->message = $this->translator->trans('sylius.checkout.shipping_method.not_blank'); |
49 | 49 | |
50 | 50 | $builder |
51 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($notBlank, $criteria, $channel) { |
|
51 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($notBlank, $criteria, $channel) { |
|
52 | 52 | $form = $event->getForm(); |
53 | 53 | $shipment = $event->getData(); |
54 | 54 |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | |
52 | 52 | public function it_fetches_data_by_day($orderRepository) |
53 | 53 | { |
54 | - $rawData = array(array('date' => '2014-12-31', 'number_of_orders' => '20'),array('date' => '2015-01-01', 'number_of_orders' => '2')); |
|
54 | + $rawData = array(array('date' => '2014-12-31', 'number_of_orders' => '20'), array('date' => '2015-01-01', 'number_of_orders' => '2')); |
|
55 | 55 | |
56 | 56 | $configuration = array( |
57 | 57 | 'start' => new \DateTime('2014-12-31 00:00:00.000000'), |
58 | 58 | 'end' => new \DateTime('2015-01-01 00:00:00.000000'), |
59 | 59 | 'period' => 'day', |
60 | - 'empty_records' => false, ); |
|
60 | + 'empty_records' => false,); |
|
61 | 61 | |
62 | 62 | $orderRepository->ordersBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
63 | 63 | |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | |
71 | 71 | public function it_fetches_data_by_month($orderRepository) |
72 | 72 | { |
73 | - $rawData = array(array('date' => '2014-12-30', 'number_of_orders' => '20'),array('date' => '2015-01-01', 'number_of_orders' => '2')); |
|
73 | + $rawData = array(array('date' => '2014-12-30', 'number_of_orders' => '20'), array('date' => '2015-01-01', 'number_of_orders' => '2')); |
|
74 | 74 | |
75 | 75 | $configuration = array( |
76 | 76 | 'start' => new \DateTime('2014-12-01 00:00:00.000000'), |
77 | 77 | 'end' => new \DateTime('2015-01-03 00:00:00.000000'), |
78 | 78 | 'period' => 'month', |
79 | - 'empty_records' => false, ); |
|
79 | + 'empty_records' => false,); |
|
80 | 80 | |
81 | 81 | $orderRepository->ordersBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
82 | 82 | |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | |
90 | 90 | public function it_fetches_data_by_year($orderRepository) |
91 | 91 | { |
92 | - $rawData = array(array('date' => '2014-01-01', 'number_of_orders' => '20'),array('date' => '2015-01-30', 'number_of_orders' => '2')); |
|
92 | + $rawData = array(array('date' => '2014-01-01', 'number_of_orders' => '20'), array('date' => '2015-01-30', 'number_of_orders' => '2')); |
|
93 | 93 | |
94 | 94 | $configuration = array( |
95 | 95 | 'start' => new \DateTime('2014-12-31 00:00:00.000000'), |
96 | 96 | 'end' => new \DateTime('2015-01-01 00:00:00.000000'), |
97 | 97 | 'period' => 'year', |
98 | - 'empty_records' => false, ); |
|
98 | + 'empty_records' => false,); |
|
99 | 99 | |
100 | 100 | $orderRepository->ordersBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
101 | 101 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | |
109 | 109 | public function it_fills_gaps($orderRepository) |
110 | 110 | { |
111 | - $rawData = array(array('date' => '2014-12-30', 'number_of_orders' => '20'),array('date' => '2015-01-01', 'number_of_orders' => '2')); |
|
111 | + $rawData = array(array('date' => '2014-12-30', 'number_of_orders' => '20'), array('date' => '2015-01-01', 'number_of_orders' => '2')); |
|
112 | 112 | |
113 | 113 | $configuration = array( |
114 | 114 | 'start' => new \DateTime('2014-11-01 00:00:00.000000'), |
115 | 115 | 'end' => new \DateTime('2015-01-03 00:00:00.000000'), |
116 | 116 | 'period' => 'month', |
117 | - 'empty_records' => true, ); |
|
117 | + 'empty_records' => true,); |
|
118 | 118 | |
119 | 119 | $orderRepository->ordersBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | 'start' => new \DateTime('2010-01-01 00:00:00.000000'), |
132 | 132 | 'end' => new \DateTime('2012-01-01 00:00:00.000000'), |
133 | 133 | 'period' => 3, |
134 | - 'empty_records' => false, ); |
|
134 | + 'empty_records' => false,); |
|
135 | 135 | $this |
136 | 136 | ->shouldThrow(new \InvalidArgumentException('Wrong data fetcher period')) |
137 | 137 | ->duringFetch($configuration) |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | |
52 | 52 | public function it_fetches_data_by_day($orderRepository) |
53 | 53 | { |
54 | - $rawData = array(array('date' => '2014-12-31', 'total_sale' => '20'),array('date' => '2015-01-01', 'total_sale' => '2')); |
|
54 | + $rawData = array(array('date' => '2014-12-31', 'total_sale' => '20'), array('date' => '2015-01-01', 'total_sale' => '2')); |
|
55 | 55 | |
56 | 56 | $configuration = array( |
57 | 57 | 'start' => new \DateTime('2014-12-31 00:00:00.000000'), |
58 | 58 | 'end' => new \DateTime('2015-01-01 00:00:00.000000'), |
59 | 59 | 'period' => 'day', |
60 | - 'empty_records' => false, ); |
|
60 | + 'empty_records' => false,); |
|
61 | 61 | |
62 | 62 | $orderRepository->revenueBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
63 | 63 | |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | |
71 | 71 | public function it_fetches_data_by_month($orderRepository) |
72 | 72 | { |
73 | - $rawData = array(array('date' => '2014-12-30', 'total_sale' => '20'),array('date' => '2015-01-01', 'total_sale' => '2')); |
|
73 | + $rawData = array(array('date' => '2014-12-30', 'total_sale' => '20'), array('date' => '2015-01-01', 'total_sale' => '2')); |
|
74 | 74 | |
75 | 75 | $configuration = array( |
76 | 76 | 'start' => new \DateTime('2014-12-01 00:00:00.000000'), |
77 | 77 | 'end' => new \DateTime('2015-01-03 00:00:00.000000'), |
78 | 78 | 'period' => 'month', |
79 | - 'empty_records' => false, ); |
|
79 | + 'empty_records' => false,); |
|
80 | 80 | |
81 | 81 | $orderRepository->revenueBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
82 | 82 | |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | |
90 | 90 | public function it_fetches_data_by_year($orderRepository) |
91 | 91 | { |
92 | - $rawData = array(array('date' => '2014-01-01', 'total_sale' => '20'),array('date' => '2015-01-30', 'total_sale' => '2')); |
|
92 | + $rawData = array(array('date' => '2014-01-01', 'total_sale' => '20'), array('date' => '2015-01-30', 'total_sale' => '2')); |
|
93 | 93 | |
94 | 94 | $configuration = array( |
95 | 95 | 'start' => new \DateTime('2014-12-31 00:00:00.000000'), |
96 | 96 | 'end' => new \DateTime('2015-01-01 00:00:00.000000'), |
97 | 97 | 'period' => 'year', |
98 | - 'empty_records' => false, ); |
|
98 | + 'empty_records' => false,); |
|
99 | 99 | |
100 | 100 | $orderRepository->revenueBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
101 | 101 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | |
109 | 109 | public function it_fills_gaps($orderRepository) |
110 | 110 | { |
111 | - $rawData = array(array('date' => '2014-12-30', 'total_sale' => '20'),array('date' => '2015-01-01', 'total_sale' => '2')); |
|
111 | + $rawData = array(array('date' => '2014-12-30', 'total_sale' => '20'), array('date' => '2015-01-01', 'total_sale' => '2')); |
|
112 | 112 | |
113 | 113 | $configuration = array( |
114 | 114 | 'start' => new \DateTime('2014-11-01 00:00:00.000000'), |
115 | 115 | 'end' => new \DateTime('2015-01-03 00:00:00.000000'), |
116 | 116 | 'period' => 'month', |
117 | - 'empty_records' => true, ); |
|
117 | + 'empty_records' => true,); |
|
118 | 118 | |
119 | 119 | $orderRepository->revenueBetweenDatesGroupByDate(Argument::type('array'))->willReturn($rawData); |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | 'start' => new \DateTime('2010-01-01 00:00:00.000000'), |
132 | 132 | 'end' => new \DateTime('2012-01-01 00:00:00.000000'), |
133 | 133 | 'period' => 3, |
134 | - 'empty_records' => false, ); |
|
134 | + 'empty_records' => false,); |
|
135 | 135 | $this |
136 | 136 | ->shouldThrow(new \InvalidArgumentException('Wrong data fetcher period')) |
137 | 137 | ->duringFetch($configuration) |