@@ -13,7 +13,6 @@ |
||
| 13 | 13 | |
| 14 | 14 | use Doctrine\Common\Persistence\ObjectManager; |
| 15 | 15 | use Sylius\Bundle\CoreBundle\DataFixtures\DataFixture; |
| 16 | -use Sylius\Component\Currency\Model\CurrencyInterface; |
|
| 17 | 16 | |
| 18 | 17 | /** |
| 19 | 18 | * Default currency fixtures. |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $currency->setBase(true); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $this->setReference('Sylius.Currency.'.$code, $currency); |
|
| 53 | + $this->setReference('Sylius.Currency.' . $code, $currency); |
|
| 54 | 54 | |
| 55 | 55 | $manager->persist($currency); |
| 56 | 56 | } |
@@ -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(); |
@@ -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 | /** |