@@ -69,33 +69,33 @@ discard block |
||
69 | 69 | /** |
70 | 70 | * {@inheritdoc} |
71 | 71 | */ |
72 | - public function create(array $options = []): VendorInterface |
|
72 | + public function create(array $options = [ ]): VendorInterface |
|
73 | 73 | { |
74 | 74 | $options = $this->optionsResolver->resolve($options); |
75 | 75 | |
76 | 76 | /** @var VendorInterface $vendor */ |
77 | 77 | $vendor = $this->vendorFactory->createNew(); |
78 | - $vendor->setName($options['name']); |
|
79 | - $vendor->setEmail($options['email']); |
|
78 | + $vendor->setName($options[ 'name' ]); |
|
79 | + $vendor->setEmail($options[ 'email' ]); |
|
80 | 80 | |
81 | 81 | /** @var string $localeCode */ |
82 | 82 | foreach ($this->getLocales() as $localeCode) { |
83 | 83 | $vendor->setCurrentLocale($localeCode); |
84 | 84 | $vendor->setFallbackLocale($localeCode); |
85 | 85 | |
86 | - $vendor->setDescription($options['description']); |
|
87 | - $vendor->setSlug($options['slug']); |
|
86 | + $vendor->setDescription($options[ 'description' ]); |
|
87 | + $vendor->setSlug($options[ 'slug' ]); |
|
88 | 88 | } |
89 | 89 | |
90 | - foreach ($options['channels'] as $channel) { |
|
90 | + foreach ($options[ 'channels' ] as $channel) { |
|
91 | 91 | $vendor->addChannel($channel); |
92 | 92 | } |
93 | 93 | |
94 | - foreach ($options['products'] as $product) { |
|
94 | + foreach ($options[ 'products' ] as $product) { |
|
95 | 95 | $vendor->addProduct($product); |
96 | 96 | } |
97 | 97 | |
98 | - $vendor->setLogoFile($this->createImage($options['logo'])); |
|
98 | + $vendor->setLogoFile($this->createImage($options[ 'logo' ])); |
|
99 | 99 | |
100 | 100 | $this->vendorLogoUploader->upload($vendor); |
101 | 101 | |
@@ -136,27 +136,27 @@ discard block |
||
136 | 136 | ->setNormalizer('products', LazyOption::findBy($this->productRepository, 'code')) |
137 | 137 | ->setRequired('name') |
138 | 138 | ->setAllowedTypes('name', 'string') |
139 | - ->setDefault('name', function (Options $options): string { |
|
139 | + ->setDefault('name', function(Options $options): string { |
|
140 | 140 | return $this->faker->company; |
141 | 141 | }) |
142 | 142 | ->setRequired('slug') |
143 | 143 | ->setAllowedTypes('slug', 'string') |
144 | - ->setDefault('slug', function (Options $options): string { |
|
145 | - return StringInflector::nameToCode((string) $options['name']); |
|
144 | + ->setDefault('slug', function(Options $options): string { |
|
145 | + return StringInflector::nameToCode((string) $options[ 'name' ]); |
|
146 | 146 | }) |
147 | 147 | ->setRequired('email') |
148 | 148 | ->setAllowedTypes('email', 'string') |
149 | - ->setDefault('email', function (Options $options): string { |
|
149 | + ->setDefault('email', function(Options $options): string { |
|
150 | 150 | return $this->faker->companyEmail; |
151 | 151 | }) |
152 | 152 | ->setRequired('logo') |
153 | 153 | ->setAllowedTypes('logo', 'string') |
154 | - ->setDefault('logo', function (Options $options): string { |
|
154 | + ->setDefault('logo', function(Options $options): string { |
|
155 | 155 | return __DIR__.'/../../Resources/fixtures/vendor/images/0'.rand(1, 3).'.png'; |
156 | 156 | }) |
157 | 157 | ->setRequired('description') |
158 | 158 | ->setAllowedTypes('description', 'string') |
159 | - ->setDefault('description', function (Options $options): string { |
|
159 | + ->setDefault('description', function(Options $options): string { |
|
160 | 160 | return $this->faker->text; |
161 | 161 | }) |
162 | 162 | ; |