@@ -126,6 +126,9 @@ |
||
126 | 126 | $order->addShipment($shipment); |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param OrderInterface $order |
|
131 | + */ |
|
129 | 132 | protected function dispatchEvents($order) |
130 | 133 | { |
131 | 134 | $dispatcher = $this->get('event_dispatcher'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $order->setChannel($channel); |
48 | 48 | |
49 | 49 | for ($j = 0, $items = rand(3, 6); $j <= $items; ++$j) { |
50 | - $variant = $this->getReference('Sylius.Variant-'.rand(1, SYLIUS_FIXTURES_TOTAL_VARIANTS - 1)); |
|
50 | + $variant = $this->getReference('Sylius.Variant-' . rand(1, SYLIUS_FIXTURES_TOTAL_VARIANTS - 1)); |
|
51 | 51 | |
52 | 52 | /* @var $item OrderItemInterface */ |
53 | 53 | $item = $orderItemFactory->createNew(); |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | $order->complete(); |
73 | 73 | $paymentState = $this->faker->boolean(50) ? PaymentInterface::STATE_COMPLETED : PaymentInterface::STATE_NEW; |
74 | 74 | |
75 | - $order->setCustomer($this->getReference('Sylius.Customer-'.rand(1, 15))); |
|
75 | + $order->setCustomer($this->getReference('Sylius.Customer-' . rand(1, 15))); |
|
76 | 76 | $this->createPayment($order, $paymentState); |
77 | 77 | |
78 | 78 | $order->setCompletedAt($this->faker->dateTimeThisDecade); |
79 | - $this->setReference('Sylius.Order-'.$i, $order); |
|
79 | + $this->setReference('Sylius.Order-' . $i, $order); |
|
80 | 80 | |
81 | 81 | $manager->persist($order); |
82 | 82 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * @param string $code |
58 | 58 | * @param array $nameTranslations |
59 | 59 | * @param array $options |
60 | - * @param array $properties |
|
60 | + * @param string[] $properties |
|
61 | 61 | * |
62 | 62 | * @return ArchetypeInterface |
63 | 63 | */ |
@@ -72,13 +72,13 @@ |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | foreach ($options as $option) { |
75 | - $archetype->addOption($this->getReference('Sylius.Option.'.$option)); |
|
75 | + $archetype->addOption($this->getReference('Sylius.Option.' . $option)); |
|
76 | 76 | } |
77 | 77 | foreach ($properties as $attribute) { |
78 | - $archetype->addAttribute($this->getReference('Sylius.Attribute.'.$attribute)); |
|
78 | + $archetype->addAttribute($this->getReference('Sylius.Attribute.' . $attribute)); |
|
79 | 79 | } |
80 | 80 | |
81 | - $this->setReference('Sylius.Archetype.'.$code, $archetype); |
|
81 | + $this->setReference('Sylius.Archetype.' . $code, $archetype); |
|
82 | 82 | |
83 | 83 | return $archetype; |
84 | 84 | } |
@@ -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(); |
@@ -94,7 +94,7 @@ |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | - * @return array |
|
97 | + * @return \Generator |
|
98 | 98 | */ |
99 | 99 | private function getLocales() |
100 | 100 | { |
@@ -108,7 +108,7 @@ |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | - * @return array |
|
111 | + * @return \Generator |
|
112 | 112 | */ |
113 | 113 | private function getLocales() |
114 | 114 | { |
@@ -95,7 +95,7 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * @return array |
|
98 | + * @return \Generator |
|
99 | 99 | */ |
100 | 100 | private function getLocales() |
101 | 101 | { |
@@ -247,7 +247,7 @@ |
||
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
250 | - * @return array |
|
250 | + * @return \Generator |
|
251 | 251 | */ |
252 | 252 | private function getLocales() |
253 | 253 | { |