@@ -46,7 +46,8 @@ discard block |
||
46 | 46 | $this->getAllOrdersCount()->shouldReturn(0); |
47 | 47 | } |
48 | 48 | |
49 | - function it_has_number_of_all_orders(ChannelInterface $channel) { |
|
49 | + function it_has_number_of_all_orders(ChannelInterface $channel) |
|
50 | + { |
|
50 | 51 | $firstStatistics = new PerChannelCustomerStatistics(110, 120, $channel->getWrappedObject()); |
51 | 52 | $secondStatistics = new PerChannelCustomerStatistics(13, 120, $channel->getWrappedObject()); |
52 | 53 | |
@@ -55,7 +56,8 @@ discard block |
||
55 | 56 | $this->getAllOrdersCount()->shouldReturn(123); |
56 | 57 | } |
57 | 58 | |
58 | - function it_has_an_array_of_statistics_per_channel(ChannelInterface $channel) { |
|
59 | + function it_has_an_array_of_statistics_per_channel(ChannelInterface $channel) |
|
60 | + { |
|
59 | 61 | $firstStatistics = new PerChannelCustomerStatistics(110, 120, $channel->getWrappedObject()); |
60 | 62 | $secondStatistics = new PerChannelCustomerStatistics(13, 120, $channel->getWrappedObject()); |
61 | 63 |
@@ -27,11 +27,18 @@ discard block |
||
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param int $price |
30 | + * @return void |
|
30 | 31 | */ |
31 | 32 | public function specifyPrice($price); |
32 | 33 | |
34 | + /** |
|
35 | + * @return void |
|
36 | + */ |
|
33 | 37 | public function disableTracking(); |
34 | 38 | |
39 | + /** |
|
40 | + * @return void |
|
41 | + */ |
|
35 | 42 | public function enableTracking(); |
36 | 43 | |
37 | 44 | /** |
@@ -63,6 +70,7 @@ discard block |
||
63 | 70 | |
64 | 71 | /** |
65 | 72 | * @param int $amount |
73 | + * @return void |
|
66 | 74 | */ |
67 | 75 | public function specifyCurrentStock($amount); |
68 | 76 | } |
@@ -223,7 +223,7 @@ |
||
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | - if (null !== $options['province_name']){ |
|
226 | + if (null !== $options['province_name']) { |
|
227 | 227 | $this->provideProvince($options, $address); |
228 | 228 | } |
229 | 229 | } |
@@ -223,7 +223,7 @@ |
||
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | - if (null !== $options['province_name']){ |
|
226 | + if (null !== $options['province_name']) { |
|
227 | 227 | $this->provideProvince($options, $address); |
228 | 228 | } |
229 | 229 | } |
@@ -271,7 +271,8 @@ |
||
271 | 271 | /** |
272 | 272 | * @Given /^the customer chose ("[^"]+" shipping method)$/ |
273 | 273 | */ |
274 | - public function theCustomerChoseShippingMethod(ShippingMethodInterface $shippingMethod) { |
|
274 | + public function theCustomerChoseShippingMethod(ShippingMethodInterface $shippingMethod) |
|
275 | + { |
|
275 | 276 | /** @var OrderInterface $order */ |
276 | 277 | $order = $this->sharedStorage->get('order'); |
277 | 278 |
@@ -27,7 +27,6 @@ |
||
27 | 27 | use Sylius\Component\Core\OrderCheckoutTransitions; |
28 | 28 | use Sylius\Component\Core\OrderPaymentTransitions; |
29 | 29 | use Sylius\Component\Core\Repository\OrderRepositoryInterface; |
30 | -use Sylius\Component\Currency\Model\CurrencyInterface; |
|
31 | 30 | use Sylius\Component\Customer\Model\CustomerInterface; |
32 | 31 | use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface; |
33 | 32 | use Sylius\Component\Order\OrderTransitions; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | $this->itemQuantityModifier->modify($item, 1); |
389 | 389 | |
390 | - $order = $this->createOrder($customer, '#00000'.$i); |
|
390 | + $order = $this->createOrder($customer, '#00000' . $i); |
|
391 | 391 | $order->addItem($item); |
392 | 392 | |
393 | 393 | $this->checkoutUsing($order, $shippingMethod, clone $address, $paymentMethod); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $total = $this->getPriceFromString($total); |
487 | 487 | |
488 | 488 | for ($i = 0; $i < $numberOfOrders; $i++) { |
489 | - $order = $this->createOrder($customers[rand(0, $numberOfCustomers - 1)], '#'.uniqid()); |
|
489 | + $order = $this->createOrder($customers[rand(0, $numberOfCustomers - 1)], '#' . uniqid()); |
|
490 | 490 | $order->setState(OrderInterface::STATE_NEW); // Temporary, we should use checkout to place these orders. |
491 | 491 | $this->applyPaymentTransitionOnOrder($order, PaymentTransitions::TRANSITION_COMPLETE); |
492 | 492 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $total = $this->getPriceFromString($total); |
514 | 514 | |
515 | 515 | for ($i = 0; $i < $numberOfOrders; $i++) { |
516 | - $order = $this->createOrder($customers[rand(0, $numberOfCustomers - 1)], '#'.uniqid(), $product->getChannels()->first()); |
|
516 | + $order = $this->createOrder($customers[rand(0, $numberOfCustomers - 1)], '#' . uniqid(), $product->getChannels()->first()); |
|
517 | 517 | $order->setState(OrderInterface::STATE_NEW); |
518 | 518 | $this->applyPaymentTransitionOnOrder($order, PaymentTransitions::TRANSITION_COMPLETE); |
519 | 519 | |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | $customer = $this->customerFactory->createNew(); |
739 | 739 | $customer->setEmail(sprintf('john%[email protected]', uniqid())); |
740 | 740 | $customer->setFirstname('John'); |
741 | - $customer->setLastname('Doe'.$i); |
|
741 | + $customer->setLastname('Doe' . $i); |
|
742 | 742 | |
743 | 743 | $customers[] = $customer; |
744 | 744 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * {@inheritdoc} |
52 | 52 | */ |
53 | - public function hasInstructions() |
|
53 | + public function hasInstructions() |
|
54 | 54 | { |
55 | 55 | return null !== $this->getDocument()->find('css', '#sylius-payment-method-instructions'); |
56 | 56 | } |
@@ -12,10 +12,10 @@ |
||
12 | 12 | namespace Sylius\Bundle\ApiBundle\Controller; |
13 | 13 | |
14 | 14 | use FOS\RestBundle\Decoder\DecoderProviderInterface; |
15 | -use Symfony\Component\HttpFoundation\Request; |
|
16 | -use Symfony\Component\HttpFoundation\ParameterBag; |
|
17 | 15 | use OAuth2\OAuth2; |
18 | 16 | use OAuth2\OAuth2ServerException; |
17 | +use Symfony\Component\HttpFoundation\ParameterBag; |
|
18 | +use Symfony\Component\HttpFoundation\Request; |
|
19 | 19 | use Symfony\Component\HttpFoundation\Response; |
20 | 20 | use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
21 | 21 |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
145 | 145 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
146 | 146 | |
147 | - $this->client->request('GET', '/api/v1/currencies/'.$currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
147 | + $this->client->request('GET', '/api/v1/currencies/' . $currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
148 | 148 | |
149 | 149 | $response = $this->client->getResponse(); |
150 | 150 | $this->assertResponse($response, 'currency/show_response', Response::HTTP_OK); |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
172 | 172 | $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); |
173 | 173 | |
174 | - $this->client->request('DELETE', '/api/v1/currencies/'.$currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithContentType, []); |
|
174 | + $this->client->request('DELETE', '/api/v1/currencies/' . $currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithContentType, []); |
|
175 | 175 | |
176 | 176 | $response = $this->client->getResponse(); |
177 | 177 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
178 | 178 | |
179 | - $this->client->request('GET', '/api/v1/currencies/'.$currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
179 | + $this->client->request('GET', '/api/v1/currencies/' . $currencies['currency_1']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
180 | 180 | |
181 | 181 | $response = $this->client->getResponse(); |
182 | 182 | $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | "code": "USD" |
80 | 80 | } |
81 | -EOT; |
|
81 | +eot; |
|
82 | 82 | |
83 | 83 | $this->client->request('POST', '/api/v1/currencies/', [], [], static::$authorizedHeaderWithContentType, $data); |
84 | 84 |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
148 | 148 | $zones = $this->loadFixturesFromFile('resources/zones.yml'); |
149 | 149 | |
150 | - $this->client->request('GET', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
150 | + $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
151 | 151 | |
152 | 152 | $response = $this->client->getResponse(); |
153 | 153 | $this->assertResponse($response, 'zone/show_response', Response::HTTP_OK); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $this->loadFixturesFromFile('resources/countries.yml'); |
187 | 187 | $zones = $this->loadFixturesFromFile('resources/zones.yml'); |
188 | 188 | |
189 | - $this->client->request('PUT', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType); |
|
189 | + $this->client->request('PUT', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType); |
|
190 | 190 | |
191 | 191 | $response = $this->client->getResponse(); |
192 | 192 | $this->assertResponse($response, 'zone/update_validation_fail_response', Response::HTTP_BAD_REQUEST); |
@@ -214,12 +214,12 @@ discard block |
||
214 | 214 | } |
215 | 215 | EOT; |
216 | 216 | |
217 | - $this->client->request('PUT', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
217 | + $this->client->request('PUT', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
218 | 218 | |
219 | 219 | $response = $this->client->getResponse(); |
220 | 220 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
221 | 221 | |
222 | - $this->client->request('GET', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
222 | + $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
223 | 223 | |
224 | 224 | $response = $this->client->getResponse(); |
225 | 225 | $this->assertResponse($response, 'zone/update_response', Response::HTTP_OK); |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | } |
266 | 266 | EOT; |
267 | 267 | |
268 | - $this->client->request('PATCH', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
268 | + $this->client->request('PATCH', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); |
|
269 | 269 | |
270 | 270 | $response = $this->client->getResponse(); |
271 | 271 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
272 | 272 | |
273 | - $this->client->request('GET', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
273 | + $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
274 | 274 | |
275 | 275 | $response = $this->client->getResponse(); |
276 | 276 | $this->assertResponse($response, 'zone/update_response', Response::HTTP_OK); |
@@ -308,12 +308,12 @@ discard block |
||
308 | 308 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
309 | 309 | $zones = $this->loadFixturesFromFile('resources/zones.yml'); |
310 | 310 | |
311 | - $this->client->request('DELETE', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType); |
|
311 | + $this->client->request('DELETE', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType); |
|
312 | 312 | |
313 | 313 | $response = $this->client->getResponse(); |
314 | 314 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
315 | 315 | |
316 | - $this->client->request('GET', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
316 | + $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
317 | 317 | |
318 | 318 | $response = $this->client->getResponse(); |
319 | 319 | $this->assertResponseCode($response, Response::HTTP_NOT_FOUND); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | ] |
84 | 84 | } |
85 | -EOT; |
|
85 | +eot; |
|
86 | 86 | |
87 | 87 | $this->client->request('POST', '/api/v1/zones/country', [], [], static::$authorizedHeaderWithContentType, $data); |
88 | 88 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | ] |
214 | 214 | } |
215 | -EOT; |
|
215 | +eot; |
|
216 | 216 | |
217 | 217 | $this->client->request('PUT', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); |
218 | 218 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | { |
264 | 264 | "name": "European Union +" |
265 | 265 | } |
266 | -EOT; |
|
266 | +eot; |
|
267 | 267 | |
268 | 268 | $this->client->request('PATCH', '/api/v1/zones/'.$zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); |
269 | 269 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
72 | 72 | $locales = $this->loadFixturesFromFile('resources/locales.yml'); |
73 | 73 | |
74 | - $this->client->request('GET', '/api/v1/locales/'.$locales['locale_en']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
74 | + $this->client->request('GET', '/api/v1/locales/' . $locales['locale_en']->getCode(), [], [], static::$authorizedHeaderWithAccept); |
|
75 | 75 | |
76 | 76 | $response = $this->client->getResponse(); |
77 | 77 | $this->assertResponse($response, 'locale/show_response', Response::HTTP_OK); |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | $this->loadFixturesFromFile('authentication/api_administrator.yml'); |
158 | 158 | $locales = $this->loadFixturesFromFile('resources/locales.yml'); |
159 | 159 | |
160 | - $this->client->request('DELETE', '/api/v1/locales/'.$locales['locale_en']->getCode(), [], [], static::$authorizedHeaderWithContentType, []); |
|
160 | + $this->client->request('DELETE', '/api/v1/locales/' . $locales['locale_en']->getCode(), [], [], static::$authorizedHeaderWithContentType, []); |
|
161 | 161 | |
162 | 162 | $response = $this->client->getResponse(); |
163 | 163 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
164 | 164 | |
165 | - $this->client->request('GET', '/api/v1/locales/'.$locales['locale_en']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
165 | + $this->client->request('GET', '/api/v1/locales/' . $locales['locale_en']->getId(), [], [], static::$authorizedHeaderWithAccept); |
|
166 | 166 | |
167 | 167 | $response = $this->client->getResponse(); |
168 | 168 | $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); |
@@ -102,7 +102,7 @@ |
||
102 | 102 | { |
103 | 103 | "code": "es" |
104 | 104 | } |
105 | -EOT; |
|
105 | +eot; |
|
106 | 106 | |
107 | 107 | $this->client->request('POST', '/api/v1/locales/', [], [], static::$authorizedHeaderWithContentType, $data); |
108 | 108 |