@@ -24,6 +24,7 @@ |
||
| 24 | 24 | * @param ProductInterface $product |
| 25 | 25 | * |
| 26 | 26 | * @throws \InvalidArgumentException |
| 27 | + * @return void |
|
| 27 | 28 | */ |
| 28 | 29 | public function generate(ProductInterface $product): void; |
| 29 | 30 | } |
@@ -444,6 +444,7 @@ |
||
| 444 | 444 | |
| 445 | 445 | /** |
| 446 | 446 | * {@inheritdoc} |
| 447 | + * @param string $localeCode |
|
| 447 | 448 | */ |
| 448 | 449 | private function getAttributeInDifferentLocale( |
| 449 | 450 | ProductAttributeValueInterface $attributeValue, |
@@ -15,12 +15,11 @@ |
||
| 15 | 15 | |
| 16 | 16 | use Doctrine\Common\Collections\ArrayCollection; |
| 17 | 17 | use Doctrine\Common\Collections\Collection; |
| 18 | -use Sylius\Component\Attribute\Model\AttributeInterface; |
|
| 19 | -use Webmozart\Assert\Assert; |
|
| 20 | 18 | use Sylius\Component\Attribute\Model\AttributeValueInterface; |
| 21 | 19 | use Sylius\Component\Resource\Model\TimestampableTrait; |
| 22 | 20 | use Sylius\Component\Resource\Model\ToggleableTrait; |
| 23 | 21 | use Sylius\Component\Resource\Model\TranslatableTrait; |
| 22 | +use Webmozart\Assert\Assert; |
|
| 24 | 23 | |
| 25 | 24 | /** |
| 26 | 25 | * @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\Component\Product\Model; |
| 15 | 15 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * @param string $code |
| 103 | 103 | */ |
| 104 | - public function setCode(?string $code): void |
|
| 104 | + public function setCode(?string $code) : void |
|
| 105 | 105 | { |
| 106 | 106 | $this->code = $code; |
| 107 | 107 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | /** |
| 118 | 118 | * {@inheritdoc} |
| 119 | 119 | */ |
| 120 | - public function setName(?string $name): void |
|
| 120 | + public function setName(?string $name) : void |
|
| 121 | 121 | { |
| 122 | 122 | $this->getTranslation()->setName($name); |
| 123 | 123 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * {@inheritdoc} |
| 135 | 135 | */ |
| 136 | - public function setSlug(?string $slug): void |
|
| 136 | + public function setSlug(?string $slug) : void |
|
| 137 | 137 | { |
| 138 | 138 | $this->getTranslation()->setSlug($slug); |
| 139 | 139 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | /** |
| 150 | 150 | * {@inheritdoc} |
| 151 | 151 | */ |
| 152 | - public function setDescription(?string $description): void |
|
| 152 | + public function setDescription(?string $description) : void |
|
| 153 | 153 | { |
| 154 | 154 | $this->getTranslation()->setDescription($description); |
| 155 | 155 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | /** |
| 166 | 166 | * {@inheritdoc} |
| 167 | 167 | */ |
| 168 | - public function setMetaKeywords(?string $metaKeywords): void |
|
| 168 | + public function setMetaKeywords(?string $metaKeywords) : void |
|
| 169 | 169 | { |
| 170 | 170 | $this->getTranslation()->setMetaKeywords($metaKeywords); |
| 171 | 171 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | /** |
| 182 | 182 | * {@inheritdoc} |
| 183 | 183 | */ |
| 184 | - public function setMetaDescription(?string $metaDescription): void |
|
| 184 | + public function setMetaDescription(?string $metaDescription) : void |
|
| 185 | 185 | { |
| 186 | 186 | $this->getTranslation()->setMetaDescription($metaDescription); |
| 187 | 187 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | /** |
| 214 | 214 | * {@inheritdoc} |
| 215 | 215 | */ |
| 216 | - public function addAttribute(?AttributeValueInterface $attribute): void |
|
| 216 | + public function addAttribute(?AttributeValueInterface $attribute) : void |
|
| 217 | 217 | { |
| 218 | 218 | Assert::isInstanceOf( |
| 219 | 219 | $attribute, |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | /** |
| 231 | 231 | * {@inheritdoc} |
| 232 | 232 | */ |
| 233 | - public function removeAttribute(?AttributeValueInterface $attribute): void |
|
| 233 | + public function removeAttribute(?AttributeValueInterface $attribute) : void |
|
| 234 | 234 | { |
| 235 | 235 | Assert::isInstanceOf( |
| 236 | 236 | $attribute, |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | /** |
| 256 | 256 | * {@inheritdoc} |
| 257 | 257 | */ |
| 258 | - public function hasAttributeByCodeAndLocale(string $attributeCode, ?string $localeCode = null): bool |
|
| 258 | + public function hasAttributeByCodeAndLocale(string $attributeCode, ?string $localeCode = null) : bool |
|
| 259 | 259 | { |
| 260 | 260 | $localeCode = $localeCode ?: $this->getTranslation()->getLocale(); |
| 261 | 261 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | /** |
| 273 | 273 | * {@inheritdoc} |
| 274 | 274 | */ |
| 275 | - public function getAttributeByCodeAndLocale(string $attributeCode, ?string $localeCode = null): ?AttributeValueInterface |
|
| 275 | + public function getAttributeByCodeAndLocale(string $attributeCode, ?string $localeCode = null) : ?AttributeValueInterface |
|
| 276 | 276 | { |
| 277 | 277 | if (null === $localeCode) { |
| 278 | 278 | $localeCode = $this->getTranslation()->getLocale(); |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | private function getAttributeInDifferentLocale( |
| 447 | 447 | ProductAttributeValueInterface $attributeValue, |
| 448 | 448 | ?string $localeCode |
| 449 | - ): AttributeValueInterface { |
|
| 449 | + ) : AttributeValueInterface { |
|
| 450 | 450 | if (!$this->hasAttributeByCodeAndLocale($attributeValue->getCode(), $localeCode)) { |
| 451 | 451 | return $attributeValue; |
| 452 | 452 | } |
@@ -29,6 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @param ProductAssociationTypeInterface|null $type |
| 32 | + * @return void |
|
| 32 | 33 | */ |
| 33 | 34 | public function setType(?ProductAssociationTypeInterface $type): void; |
| 34 | 35 | |
@@ -39,6 +40,7 @@ discard block |
||
| 39 | 40 | |
| 40 | 41 | /** |
| 41 | 42 | * @param ProductInterface|null $owner |
| 43 | + * @return void |
|
| 42 | 44 | */ |
| 43 | 45 | public function setOwner(?ProductInterface $owner): void; |
| 44 | 46 | |
@@ -49,11 +51,13 @@ discard block |
||
| 49 | 51 | |
| 50 | 52 | /** |
| 51 | 53 | * @param ProductInterface $product |
| 54 | + * @return void |
|
| 52 | 55 | */ |
| 53 | 56 | public function addAssociatedProduct(ProductInterface $product): void; |
| 54 | 57 | |
| 55 | 58 | /** |
| 56 | 59 | * @param ProductInterface $product |
| 60 | + * @return void |
|
| 57 | 61 | */ |
| 58 | 62 | public function removeAssociatedProduct(ProductInterface $product): void; |
| 59 | 63 | |
@@ -64,5 +68,8 @@ discard block |
||
| 64 | 68 | */ |
| 65 | 69 | public function hasAssociatedProduct(ProductInterface $product): bool; |
| 66 | 70 | |
| 71 | + /** |
|
| 72 | + * @return void |
|
| 73 | + */ |
|
| 67 | 74 | public function clearAssociatedProducts(): void; |
| 68 | 75 | } |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * @param ProductAssociationTypeInterface|null $type |
| 32 | 32 | */ |
| 33 | - public function setType(?ProductAssociationTypeInterface $type): void; |
|
| 33 | + public function setType(?ProductAssociationTypeInterface $type) : void; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @return ProductInterface|null |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * @param ProductInterface|null $owner |
| 42 | 42 | */ |
| 43 | - public function setOwner(?ProductInterface $owner): void; |
|
| 43 | + public function setOwner(?ProductInterface $owner) : void; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @return Collection|ProductInterface[] |
@@ -29,6 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @param string|null $name |
| 32 | + * @return void |
|
| 32 | 33 | */ |
| 33 | 34 | public function setName(?string $name): void; |
| 34 | 35 | } |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -36,5 +36,5 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * @param string|null $name |
| 38 | 38 | */ |
| 39 | - public function setName(?string $name): void; |
|
| 39 | + public function setName(?string $name) : void; |
|
| 40 | 40 | } |
@@ -29,6 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @param string|null $name |
| 32 | + * @return void |
|
| 32 | 33 | */ |
| 33 | 34 | public function setName(?string $name): void; |
| 34 | 35 | } |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -36,5 +36,5 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * @param string|null $name |
| 38 | 38 | */ |
| 39 | - public function setName(?string $name): void; |
|
| 39 | + public function setName(?string $name) : void; |
|
| 40 | 40 | } |
@@ -27,6 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @param ProductInterface|null $product |
| 30 | + * @return void |
|
| 30 | 31 | */ |
| 31 | 32 | public function setProduct(?ProductInterface $product): void; |
| 32 | 33 | } |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -28,5 +28,5 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @param ProductInterface|null $product |
| 30 | 30 | */ |
| 31 | - public function setProduct(?ProductInterface $product): void; |
|
| 31 | + public function setProduct(?ProductInterface $product) : void; |
|
| 32 | 32 | } |
@@ -42,6 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @param string|null $name |
| 45 | + * @return void |
|
| 45 | 46 | */ |
| 46 | 47 | public function setName(?string $name): void; |
| 47 | 48 | |
@@ -52,6 +53,7 @@ discard block |
||
| 52 | 53 | |
| 53 | 54 | /** |
| 54 | 55 | * @param string|null $description |
| 56 | + * @return void |
|
| 55 | 57 | */ |
| 56 | 58 | public function setDescription(?string $description): void; |
| 57 | 59 | |
@@ -62,6 +64,7 @@ discard block |
||
| 62 | 64 | |
| 63 | 65 | /** |
| 64 | 66 | * @param string|null $metaKeywords |
| 67 | + * @return void |
|
| 65 | 68 | */ |
| 66 | 69 | public function setMetaKeywords(?string $metaKeywords): void; |
| 67 | 70 | |
@@ -72,6 +75,7 @@ discard block |
||
| 72 | 75 | |
| 73 | 76 | /** |
| 74 | 77 | * @param string|null $metaDescription |
| 78 | + * @return void |
|
| 75 | 79 | */ |
| 76 | 80 | public function setMetaDescription(?string $metaDescription): void; |
| 77 | 81 | |
@@ -87,11 +91,13 @@ discard block |
||
| 87 | 91 | |
| 88 | 92 | /** |
| 89 | 93 | * @param ProductVariantInterface $variant |
| 94 | + * @return void |
|
| 90 | 95 | */ |
| 91 | 96 | public function addVariant(ProductVariantInterface $variant): void; |
| 92 | 97 | |
| 93 | 98 | /** |
| 94 | 99 | * @param ProductVariantInterface $variant |
| 100 | + * @return void |
|
| 95 | 101 | */ |
| 96 | 102 | public function removeVariant(ProductVariantInterface $variant): void; |
| 97 | 103 | |
@@ -114,11 +120,13 @@ discard block |
||
| 114 | 120 | |
| 115 | 121 | /** |
| 116 | 122 | * @param ProductOptionInterface $option |
| 123 | + * @return void |
|
| 117 | 124 | */ |
| 118 | 125 | public function addOption(ProductOptionInterface $option): void; |
| 119 | 126 | |
| 120 | 127 | /** |
| 121 | 128 | * @param ProductOptionInterface $option |
| 129 | + * @return void |
|
| 122 | 130 | */ |
| 123 | 131 | public function removeOption(ProductOptionInterface $option): void; |
| 124 | 132 | |
@@ -136,11 +144,13 @@ discard block |
||
| 136 | 144 | |
| 137 | 145 | /** |
| 138 | 146 | * @param ProductAssociationInterface $association |
| 147 | + * @return void |
|
| 139 | 148 | */ |
| 140 | 149 | public function addAssociation(ProductAssociationInterface $association): void; |
| 141 | 150 | |
| 142 | 151 | /** |
| 143 | 152 | * @param ProductAssociationInterface $association |
| 153 | + * @return void |
|
| 144 | 154 | */ |
| 145 | 155 | public function removeAssociation(ProductAssociationInterface $association): void; |
| 146 | 156 | |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * @param string|null $name |
| 45 | 45 | */ |
| 46 | - public function setName(?string $name): void; |
|
| 46 | + public function setName(?string $name) : void; |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * @return string|null |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @param string|null $description |
| 55 | 55 | */ |
| 56 | - public function setDescription(?string $description): void; |
|
| 56 | + public function setDescription(?string $description) : void; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * @return string|null |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | /** |
| 64 | 64 | * @param string|null $metaKeywords |
| 65 | 65 | */ |
| 66 | - public function setMetaKeywords(?string $metaKeywords): void; |
|
| 66 | + public function setMetaKeywords(?string $metaKeywords) : void; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * @return string|null |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** |
| 74 | 74 | * @param string|null $metaDescription |
| 75 | 75 | */ |
| 76 | - public function setMetaDescription(?string $metaDescription): void; |
|
| 76 | + public function setMetaDescription(?string $metaDescription) : void; |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * @return bool |
@@ -34,6 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @param int $position |
| 37 | + * @return void |
|
| 37 | 38 | */ |
| 38 | 39 | public function setPosition(?int $position): void; |
| 39 | 40 | |
@@ -44,11 +45,13 @@ discard block |
||
| 44 | 45 | |
| 45 | 46 | /** |
| 46 | 47 | * @param ProductOptionValueInterface $optionValue |
| 48 | + * @return void |
|
| 47 | 49 | */ |
| 48 | 50 | public function addValue(ProductOptionValueInterface $optionValue): void; |
| 49 | 51 | |
| 50 | 52 | /** |
| 51 | 53 | * @param ProductOptionValueInterface $optionValue |
| 54 | + * @return void |
|
| 52 | 55 | */ |
| 53 | 56 | public function removeValue(ProductOptionValueInterface $optionValue): void; |
| 54 | 57 | |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * @param int $position |
| 37 | 37 | */ |
| 38 | - public function setPosition(?int $position): void; |
|
| 38 | + public function setPosition(?int $position) : void; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @return Collection|ProductOptionValueInterface[] |
@@ -27,6 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @param string $name |
| 30 | + * @return void |
|
| 30 | 31 | */ |
| 31 | 32 | public function setName(?string $name): void; |
| 32 | 33 | } |
@@ -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\Component\Product\Model; |
| 15 | 15 | |
@@ -28,5 +28,5 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @param string $name |
| 30 | 30 | */ |
| 31 | - public function setName(?string $name): void; |
|
| 31 | + public function setName(?string $name) : void; |
|
| 32 | 32 | } |