@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * Adds taxons to given product. |
314 | 314 | * |
315 | 315 | * @param ProductInterface $product |
316 | - * @param array $taxonCodes |
|
316 | + * @param string[] $taxonCodes |
|
317 | 317 | */ |
318 | 318 | protected function setTaxons(ProductInterface $product, array $taxonCodes) |
319 | 319 | { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * Set channels. |
331 | 331 | * |
332 | 332 | * @param ProductInterface $product |
333 | - * @param array $channelCodes |
|
333 | + * @param string[] $channelCodes |
|
334 | 334 | */ |
335 | 335 | protected function setChannels(ProductInterface $product, array $channelCodes) |
336 | 336 | { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $this->generateVariants($product); |
120 | 120 | |
121 | - $this->setReference('Sylius.Product.'.$i, $product); |
|
121 | + $this->setReference('Sylius.Product.' . $i, $product); |
|
122 | 122 | |
123 | 123 | return $product; |
124 | 124 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $this->generateVariants($product); |
164 | 164 | |
165 | - $this->setReference('Sylius.Product.'.$i, $product); |
|
165 | + $this->setReference('Sylius.Product.' . $i, $product); |
|
166 | 166 | |
167 | 167 | return $product; |
168 | 168 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | $this->generateVariants($product); |
201 | 201 | |
202 | - $this->setReference('Sylius.Product.'.$i, $product); |
|
202 | + $this->setReference('Sylius.Product.' . $i, $product); |
|
203 | 203 | |
204 | 204 | return $product; |
205 | 205 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $this->addAttribute($product, 'book_isbn', $isbn); |
237 | 237 | $this->addAttribute($product, 'book_pages', $this->faker->randomNumber(3)); |
238 | 238 | |
239 | - $this->setReference('Sylius.Product.'.$i, $product); |
|
239 | + $this->setReference('Sylius.Product.' . $i, $product); |
|
240 | 240 | |
241 | 241 | return $product; |
242 | 242 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $variant->setCode($this->getUniqueCode()); |
260 | 260 | $variant->setOnHand($this->faker->randomNumber(1)); |
261 | 261 | |
262 | - $this->setReference('Sylius.Variant-'.$this->totalVariants, $variant); |
|
262 | + $this->setReference('Sylius.Variant-' . $this->totalVariants, $variant); |
|
263 | 263 | |
264 | 264 | ++$this->totalVariants; |
265 | 265 | } |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | $variant->setTaxCategory($this->getTaxCategory('taxable')); |
282 | 282 | |
283 | 283 | $mainTaxon = $product->getMainTaxon(); |
284 | - $image = clone $this->getReference('Sylius.Image.'.$mainTaxon->getCode()); |
|
284 | + $image = clone $this->getReference('Sylius.Image.' . $mainTaxon->getCode()); |
|
285 | 285 | $variant->addImage($image); |
286 | 286 | |
287 | 287 | $product->addVariant($variant); |
288 | 288 | |
289 | - $this->setReference('Sylius.Variant-'.$this->totalVariants, $variant); |
|
289 | + $this->setReference('Sylius.Variant-' . $this->totalVariants, $variant); |
|
290 | 290 | |
291 | 291 | ++$this->totalVariants; |
292 | 292 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | { |
303 | 303 | /* @var $attribute AttributeValueInterface */ |
304 | 304 | $attribute = $this->getProductAttributeValueFactory()->createNew(); |
305 | - $attribute->setAttribute($this->getReference('Sylius.Attribute.'.$code)); |
|
305 | + $attribute->setAttribute($this->getReference('Sylius.Attribute.' . $code)); |
|
306 | 306 | $attribute->setProduct($product); |
307 | 307 | $attribute->setValue($value); |
308 | 308 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $taxons = new ArrayCollection(); |
321 | 321 | |
322 | 322 | foreach ($taxonCodes as $taxonCode) { |
323 | - $taxons->add($this->getReference('Sylius.Taxon.'.$taxonCode)); |
|
323 | + $taxons->add($this->getReference('Sylius.Taxon.' . $taxonCode)); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | $product->setTaxons($taxons); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | protected function setChannels(ProductInterface $product, array $channelCodes) |
336 | 336 | { |
337 | 337 | foreach ($channelCodes as $code) { |
338 | - $product->addChannel($this->getReference('Sylius.Channel.'.$code)); |
|
338 | + $product->addChannel($this->getReference('Sylius.Channel.' . $code)); |
|
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | protected function getTaxCategory($code) |
348 | 348 | { |
349 | - return $this->getReference('Sylius.TaxCategory.'.$code); |
|
349 | + return $this->getReference('Sylius.TaxCategory.' . $code); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | /** |
@@ -137,8 +137,8 @@ |
||
137 | 137 | * @param string $description |
138 | 138 | * @param int $priority |
139 | 139 | * @param string $channel |
140 | - * @param array $rules |
|
141 | - * @param array $actions |
|
140 | + * @param RuleInterface[] $rules |
|
141 | + * @param ActionInterface[] $actions |
|
142 | 142 | * |
143 | 143 | * @return PromotionInterface |
144 | 144 | */ |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $promotion->setCode($code); |
152 | 152 | $promotion->setPriority($priority); |
153 | 153 | |
154 | - $promotion->addChannel($this->getReference('Sylius.Channel.'.$channel)); |
|
154 | + $promotion->addChannel($this->getReference('Sylius.Channel.' . $channel)); |
|
155 | 155 | |
156 | 156 | foreach ($rules as $rule) { |
157 | 157 | $promotion->addRule($rule); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $promotion->addAction($action); |
161 | 161 | } |
162 | 162 | |
163 | - $this->setReference('Sylius.Promotion.'.$code, $promotion); |
|
163 | + $this->setReference('Sylius.Promotion.' . $code, $promotion); |
|
164 | 164 | |
165 | 165 | return $promotion; |
166 | 166 | } |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $email |
86 | 86 | * @param string $password |
87 | 87 | * @param bool $enabled |
88 | - * @param array $roles |
|
88 | + * @param string[] $roles |
|
89 | 89 | * @param string $currencyCode |
90 | 90 | * |
91 | 91 | * @return UserInterface |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | $user = $this->createUser( |
53 | - $username.'@example.com', |
|
53 | + $username . '@example.com', |
|
54 | 54 | $username, |
55 | 55 | $this->faker->boolean() |
56 | 56 | ); |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $manager->persist($user); |
61 | 61 | $this->usernames[$username] = true; |
62 | 62 | |
63 | - $this->setReference('Sylius.User-'.$i, $user); |
|
64 | - $this->setReference('Sylius.Customer-'.$i, $user->getCustomer()); |
|
63 | + $this->setReference('Sylius.User-' . $i, $user); |
|
64 | + $this->setReference('Sylius.Customer-' . $i, $user->getCustomer()); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $customer = $this->getCustomerFactory()->createNew(); |
@@ -110,7 +110,7 @@ |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | - * @return array |
|
113 | + * @return \Generator |
|
114 | 114 | */ |
115 | 115 | private function getLocales() |
116 | 116 | { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
96 | - * @param $code |
|
96 | + * @param string $code |
|
97 | 97 | * |
98 | 98 | * @return null|string |
99 | 99 | */ |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * @return array |
|
106 | + * @return string[] |
|
107 | 107 | */ |
108 | 108 | private function getAvailableCountries() |
109 | 109 | { |
@@ -194,6 +194,7 @@ |
||
194 | 194 | |
195 | 195 | /** |
196 | 196 | * @param object $entity |
197 | + * @param string $value |
|
197 | 198 | * |
198 | 199 | * @return Route |
199 | 200 | */ |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | private function getFieldValue($entity, $fieldName) |
191 | 191 | { |
192 | - return $entity->{'get'.ucfirst($fieldName)}(); |
|
192 | + return $entity->{'get' . ucfirst($fieldName)}(); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | $defaults = ['_sylius_entity' => $entity, $fieldName => $value]; |
209 | 209 | |
210 | - return new Route($this->routeConfigs[$className]['prefix'].'/'.$value, $defaults); |
|
210 | + return new Route($this->routeConfigs[$className]['prefix'] . '/' . $value, $defaults); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -13,7 +13,6 @@ |
||
13 | 13 | |
14 | 14 | use Sylius\Bundle\CoreBundle\Sitemap\Factory\SitemapUrlFactoryInterface; |
15 | 15 | use Sylius\Bundle\CoreBundle\Sitemap\Model\ChangeFrequency; |
16 | -use Sylius\Bundle\CoreBundle\Sitemap\Model\SitemapUrlInterface; |
|
17 | 16 | use Sylius\Component\Resource\Repository\RepositoryInterface; |
18 | 17 | use Symfony\Component\Routing\RouterInterface; |
19 | 18 |
@@ -14,10 +14,7 @@ |
||
14 | 14 | use PhpSpec\ObjectBehavior; |
15 | 15 | use Prophecy\Argument; |
16 | 16 | use Sylius\Bundle\CoreBundle\EventListener\OrderPromotionListener; |
17 | -use Sylius\Component\Core\Model\OrderInterface; |
|
18 | -use Sylius\Component\Promotion\Processor\PromotionProcessorInterface; |
|
19 | 17 | use Sylius\Component\Promotion\SyliusPromotionEvents; |
20 | -use Sylius\Component\Resource\Exception\UnexpectedTypeException; |
|
21 | 18 | use Symfony\Component\EventDispatcher\GenericEvent; |
22 | 19 | use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; |
23 | 20 | use Symfony\Component\HttpFoundation\Session\SessionInterface; |
@@ -67,7 +67,7 @@ |
||
67 | 67 | * |
68 | 68 | * @throws \RuntimeException |
69 | 69 | * |
70 | - * @return string |
|
70 | + * @return integer |
|
71 | 71 | */ |
72 | 72 | private function tryToMapPaymentMethodName($paymentMethodName) |
73 | 73 | { |