@@ -11,15 +11,12 @@ |
||
11 | 11 | |
12 | 12 | namespace Sylius\Bundle\AdminApiBundle\DependencyInjection; |
13 | 13 | |
14 | -use Sylius\Bundle\AdminApiBundle\Controller\TokenController; |
|
15 | 14 | use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension; |
16 | 15 | use Symfony\Component\Config\FileLocator; |
17 | 16 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
18 | -use Symfony\Component\DependencyInjection\Definition; |
|
19 | 17 | use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; |
20 | 18 | use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; |
21 | 19 | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
22 | -use Symfony\Component\DependencyInjection\Reference; |
|
23 | 20 | |
24 | 21 | /** |
25 | 22 | * @author Paweł Jędrzejewski <[email protected]> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Bundle\AdminApiBundle\DependencyInjection; |
15 | 15 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function load(array $config, ContainerBuilder $container) |
35 | 35 | { |
36 | 36 | $config = $this->processConfiguration($this->getConfiguration([], $container), $config); |
37 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
37 | + $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
38 | 38 | |
39 | 39 | $this->registerResources('sylius', $config['driver'], $config['resources'], $container); |
40 | 40 |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace Sylius\Bundle\AdminApiBundle\Fixture\Factory; |
13 | 13 | |
14 | -use FOS\OAuthServerBundle\Model\ClientManagerInterface; |
|
15 | 14 | use Sylius\Bundle\AdminApiBundle\Model\AccessTokenInterface; |
16 | 15 | use Sylius\Bundle\AdminApiBundle\Model\ClientInterface; |
17 | 16 | use Sylius\Bundle\AdminApiBundle\Model\UserInterface; |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Bundle\AdminApiBundle\Fixture\Factory; |
15 | 15 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | ->setHelp(<<<EOT |
47 | 47 | The <info>%command.name%</info>command creates a new client. |
48 | 48 | <info>php %command.full_name% [--redirect-uri=...] [--grant-type=...] name</info> |
49 | -EOT |
|
49 | +eot |
|
50 | 50 | ); |
51 | 51 | } |
52 | 52 |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Bundle\AdminApiBundle\Command; |
15 | 15 |
@@ -352,6 +352,7 @@ discard block |
||
352 | 352 | |
353 | 353 | /** |
354 | 354 | * @Given /^([^"]+) gives ("[^"]+%") discount on shipping to every order$/ |
355 | + * @param integer $discount |
|
355 | 356 | */ |
356 | 357 | public function itGivesPercentageDiscountOnShippingToEveryOrder(PromotionInterface $promotion, $discount) |
357 | 358 | { |
@@ -675,6 +676,7 @@ discard block |
||
675 | 676 | |
676 | 677 | /** |
677 | 678 | * @Given /^([^"]+) gives ("[^"]+%") discount on shipping to every order over ("(?:€|£|\$)[^"]+")$/ |
679 | + * @param integer $discount |
|
678 | 680 | */ |
679 | 681 | public function itGivesDiscountOnShippingToEveryOrderOver( |
680 | 682 | PromotionInterface $promotion, |
@@ -697,7 +699,7 @@ discard block |
||
697 | 699 | } |
698 | 700 | |
699 | 701 | /** |
700 | - * @param array $taxonCodes |
|
702 | + * @param string[] $taxonCodes |
|
701 | 703 | * |
702 | 704 | * @return array |
703 | 705 | */ |
@@ -707,7 +709,7 @@ discard block |
||
707 | 709 | } |
708 | 710 | |
709 | 711 | /** |
710 | - * @param array $productCodes |
|
712 | + * @param string[] $productCodes |
|
711 | 713 | * |
712 | 714 | * @return array |
713 | 715 | */ |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Behat\Context\Setup; |
15 | 15 |
@@ -22,6 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @param int|null $priority |
25 | + * @return void |
|
25 | 26 | */ |
26 | 27 | public function setPriority($priority); |
27 | 28 | |
@@ -32,6 +33,7 @@ discard block |
||
32 | 33 | |
33 | 34 | /** |
34 | 35 | * @param string $name |
36 | + * @return void |
|
35 | 37 | */ |
36 | 38 | public function nameIt($name); |
37 | 39 | |
@@ -49,35 +51,47 @@ discard block |
||
49 | 51 | |
50 | 52 | /** |
51 | 53 | * @param string $limit |
54 | + * @return void |
|
52 | 55 | */ |
53 | 56 | public function fillUsageLimit($limit); |
54 | 57 | |
58 | + /** |
|
59 | + * @return void |
|
60 | + */ |
|
55 | 61 | public function makeExclusive(); |
56 | 62 | |
63 | + /** |
|
64 | + * @return void |
|
65 | + */ |
|
57 | 66 | public function checkCouponBased(); |
58 | 67 | |
59 | 68 | /** |
60 | 69 | * @param string $name |
70 | + * @return void |
|
61 | 71 | */ |
62 | 72 | public function checkChannel($name); |
63 | 73 | |
64 | 74 | /** |
65 | 75 | * @param \DateTime $dateTime |
76 | + * @return void |
|
66 | 77 | */ |
67 | 78 | public function setStartsAt(\DateTime $dateTime); |
68 | 79 | |
69 | 80 | /** |
70 | 81 | * @param \DateTime $dateTime |
82 | + * @return void |
|
71 | 83 | */ |
72 | 84 | public function setEndsAt(\DateTime $dateTime); |
73 | 85 | |
74 | 86 | /** |
75 | 87 | * {@inheritdoc} |
88 | + * @return boolean |
|
76 | 89 | */ |
77 | 90 | public function hasStartsAt(\DateTime $dateTime); |
78 | 91 | |
79 | 92 | /** |
80 | 93 | * {@inheritdoc} |
94 | + * @return boolean |
|
81 | 95 | */ |
82 | 96 | public function hasEndsAt(\DateTime $dateTime); |
83 | 97 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Behat\Page\Admin\Promotion; |
15 | 15 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | "plainPassword": "youShallNotPass", |
77 | 77 | "localeCode": "en_US" |
78 | 78 | } |
79 | -EOT; |
|
79 | +eot; |
|
80 | 80 | |
81 | 81 | $this->client->request('POST', '/api/v1/users/', [], [], static::$authorizedHeaderWithContentType, $data); |
82 | 82 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | "localeCode": "en_US", |
104 | 104 | "enabled": "true" |
105 | 105 | } |
106 | -EOT; |
|
106 | +eot; |
|
107 | 107 | |
108 | 108 | $this->client->request('POST', '/api/v1/users/', [], [], static::$authorizedHeaderWithContentType, $data); |
109 | 109 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | "localeCode": "fr_FR", |
234 | 234 | "enabled": "true" |
235 | 235 | } |
236 | -EOT; |
|
236 | +eot; |
|
237 | 237 | |
238 | 238 | $this->client->request('PUT', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithContentType, $data); |
239 | 239 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | "firstName": "John", |
274 | 274 | "lastName": "Doe" |
275 | 275 | } |
276 | -EOT; |
|
276 | +eot; |
|
277 | 277 | |
278 | 278 | $this->client->request('PATCH', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithContentType, $data); |
279 | 279 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Tests\Controller; |
15 | 15 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $this->client->request('DELETE', $this->getAdminUserUrl($user['admin']), [], [], static::$authorizedHeaderWithContentType); |
343 | 343 | |
344 | 344 | $response = $this->client->getResponse(); |
345 | - $this->assertResponse($response, 'admin_user/deletion_fail_response', Response::HTTP_UNPROCESSABLE_ENTITY); |
|
345 | + $this->assertResponse($response, 'admin_user/deletion_fail_response', Response::HTTP_UNPROCESSABLE_ENTITY); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | "code": "christmas-promotion", |
231 | 231 | "name": "Christmas Promotion" |
232 | 232 | } |
233 | -EOT; |
|
233 | +eot; |
|
234 | 234 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
235 | 235 | |
236 | 236 | $response = $this->client->getResponse(); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | "MOB" |
256 | 256 | ] |
257 | 257 | } |
258 | -EOT; |
|
258 | +eot; |
|
259 | 259 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
260 | 260 | |
261 | 261 | $response = $this->client->getResponse(); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | "time": "11:00" |
284 | 284 | } |
285 | 285 | } |
286 | -EOT; |
|
286 | +eot; |
|
287 | 287 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
288 | 288 | |
289 | 289 | $response = $this->client->getResponse(); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | ] |
325 | 325 | } |
326 | -EOT; |
|
326 | +eot; |
|
327 | 327 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
328 | 328 | |
329 | 329 | $response = $this->client->getResponse(); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | } |
388 | 388 | ] |
389 | 389 | } |
390 | -EOT; |
|
390 | +eot; |
|
391 | 391 | |
392 | 392 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
393 | 393 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | "name": "Christmas Promotion", |
410 | 410 | "couponBased": true |
411 | 411 | } |
412 | -EOT; |
|
412 | +eot; |
|
413 | 413 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
414 | 414 | |
415 | 415 | $response = $this->client->getResponse(); |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | "exclusive": true, |
432 | 432 | "priority": 0 |
433 | 433 | } |
434 | -EOT; |
|
434 | +eot; |
|
435 | 435 | $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); |
436 | 436 | |
437 | 437 | $response = $this->client->getResponse(); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | "name": "Monday promotion", |
454 | 454 | "priority": 0 |
455 | 455 | } |
456 | -EOT; |
|
456 | +eot; |
|
457 | 457 | $this->client->request('PUT', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithContentType, $data); |
458 | 458 | $response = $this->client->getResponse(); |
459 | 459 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | { |
480 | 480 | "exclusive": true |
481 | 481 | } |
482 | -EOT; |
|
482 | +eot; |
|
483 | 483 | $this->client->request('PATCH', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithContentType, $data); |
484 | 484 | $response = $this->client->getResponse(); |
485 | 485 | $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Tests\Controller; |
15 | 15 |
@@ -199,6 +199,7 @@ |
||
199 | 199 | |
200 | 200 | /** |
201 | 201 | * {@inheritdoc} |
202 | + * @param string $name |
|
202 | 203 | */ |
203 | 204 | protected function getElement($name, array $parameters = []) |
204 | 205 | { |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Behat\Page\Admin\Product; |
15 | 15 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $imageForm->fillField('Type', $type); |
214 | 214 | } |
215 | 215 | |
216 | - $imageForm->find('css', 'input[type="file"]')->attachFile($filesPath.$path); |
|
216 | + $imageForm->find('css', 'input[type="file"]')->attachFile($filesPath . $path); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $filesPath = $this->getParameter('files_path'); |
225 | 225 | |
226 | 226 | $imageForm = $this->getImageElementByType($type); |
227 | - $imageForm->find('css', 'input[type="file"]')->attachFile($filesPath.$path); |
|
227 | + $imageForm->find('css', 'input[type="file"]')->attachFile($filesPath . $path); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | private function getImageElementByType($type) |
501 | 501 | { |
502 | 502 | $images = $this->getElement('images'); |
503 | - $typeInput = $images->find('css', 'input[value="'.$type.'"]'); |
|
503 | + $typeInput = $images->find('css', 'input[value="' . $type . '"]'); |
|
504 | 504 | |
505 | 505 | if (null === $typeInput) { |
506 | 506 | return null; |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace Sylius\Behat\Page\Admin\Promotion; |
13 | 13 | |
14 | -use Behat\Mink\Driver\Selenium2Driver; |
|
15 | 14 | use Behat\Mink\Element\NodeElement; |
16 | 15 | use Behat\Mink\Exception\ElementNotFoundException; |
17 | 16 | use Sylius\Behat\Behaviour\NamesIt; |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | |
14 | 14 | namespace Sylius\Behat\Page\Admin\Promotion; |
15 | 15 |