@@ -64,33 +64,33 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * {@inheritdoc} |
66 | 66 | */ |
67 | - public function create(array $options = []): VendorInterface |
|
67 | + public function create(array $options = [ ]): VendorInterface |
|
68 | 68 | { |
69 | 69 | $options = $this->optionsResolver->resolve($options); |
70 | 70 | |
71 | 71 | /** @var VendorInterface $vendor */ |
72 | 72 | $vendor = $this->vendorFactory->createNew(); |
73 | - $vendor->setName($options['name']); |
|
74 | - $vendor->setEmail($options['email']); |
|
73 | + $vendor->setName($options[ 'name' ]); |
|
74 | + $vendor->setEmail($options[ 'email' ]); |
|
75 | 75 | |
76 | 76 | /** @var string $localeCode */ |
77 | 77 | foreach ($this->getLocales() as $localeCode) { |
78 | 78 | $vendor->setCurrentLocale($localeCode); |
79 | 79 | $vendor->setFallbackLocale($localeCode); |
80 | 80 | |
81 | - $vendor->setDescription($options['description']); |
|
82 | - $vendor->setSlug($options['slug']); |
|
81 | + $vendor->setDescription($options[ 'description' ]); |
|
82 | + $vendor->setSlug($options[ 'slug' ]); |
|
83 | 83 | } |
84 | 84 | |
85 | - foreach ($options['channels'] as $channel) { |
|
85 | + foreach ($options[ 'channels' ] as $channel) { |
|
86 | 86 | $vendor->addChannel($channel); |
87 | 87 | } |
88 | 88 | |
89 | - foreach ($options['products'] as $product) { |
|
89 | + foreach ($options[ 'products' ] as $product) { |
|
90 | 90 | $vendor->addProduct($product); |
91 | 91 | } |
92 | 92 | |
93 | - $vendor->setLogoFile($this->createImage($options['logo'])); |
|
93 | + $vendor->setLogoFile($this->createImage($options[ 'logo' ])); |
|
94 | 94 | |
95 | 95 | return $vendor; |
96 | 96 | } |
@@ -129,27 +129,27 @@ discard block |
||
129 | 129 | ->setNormalizer('products', LazyOption::findBy($this->productRepository, 'code')) |
130 | 130 | ->setRequired('name') |
131 | 131 | ->setAllowedTypes('name', 'string') |
132 | - ->setDefault('name', function (Options $options): string { |
|
132 | + ->setDefault('name', function(Options $options): string { |
|
133 | 133 | return $this->faker->company; |
134 | 134 | }) |
135 | 135 | ->setRequired('slug') |
136 | 136 | ->setAllowedTypes('slug', 'string') |
137 | - ->setDefault('slug', function (Options $options): string { |
|
138 | - return StringInflector::nameToCode((string) $options['name']); |
|
137 | + ->setDefault('slug', function(Options $options): string { |
|
138 | + return StringInflector::nameToCode((string) $options[ 'name' ]); |
|
139 | 139 | }) |
140 | 140 | ->setRequired('email') |
141 | 141 | ->setAllowedTypes('email', 'string') |
142 | - ->setDefault('email', function (Options $options): string { |
|
142 | + ->setDefault('email', function(Options $options): string { |
|
143 | 143 | return $this->faker->companyEmail; |
144 | 144 | }) |
145 | 145 | ->setRequired('logo') |
146 | 146 | ->setAllowedTypes('logo', 'string') |
147 | - ->setDefault('logo', function (Options $options): string { |
|
147 | + ->setDefault('logo', function(Options $options): string { |
|
148 | 148 | return __DIR__.'/../../Resources/fixtures/vendor/images/0'.rand(1, 3).'.png'; |
149 | 149 | }) |
150 | 150 | ->setRequired('description') |
151 | 151 | ->setAllowedTypes('description', 'string') |
152 | - ->setDefault('description', function (Options $options): string { |
|
152 | + ->setDefault('description', function(Options $options): string { |
|
153 | 153 | return $this->faker->text; |
154 | 154 | }) |
155 | 155 | ; |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | $this->eventDispatcher = $eventDispatcher; |
27 | 27 | } |
28 | 28 | |
29 | - public function createMenu(array $options = []): ItemInterface |
|
29 | + public function createMenu(array $options = [ ]): ItemInterface |
|
30 | 30 | { |
31 | 31 | $menu = $this->factory->createItem('root'); |
32 | 32 | |
33 | - if (!array_key_exists('vendor', $options) || !$options['vendor'] instanceof VendorInterface) { |
|
33 | + if (!array_key_exists('vendor', $options) || !$options[ 'vendor' ] instanceof VendorInterface) { |
|
34 | 34 | return $menu; |
35 | 35 | } |
36 | 36 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ; |
55 | 55 | |
56 | 56 | $this->eventDispatcher->dispatch( |
57 | - new VendorMenuBuilderEvent($this->factory, $menu, $options['vendor']) |
|
57 | + new VendorMenuBuilderEvent($this->factory, $menu, $options[ 'vendor' ]) |
|
58 | 58 | ); |
59 | 59 | |
60 | 60 | return $menu; |