@@ -24,7 +24,7 @@ |
||
24 | 24 | public function getFunctions(): array |
25 | 25 | { |
26 | 26 | return [ |
27 | - new TwigFunction('banner_slider_name', [$this, 'getBannerSliderName']) |
|
27 | + new TwigFunction('banner_slider_name', [ $this, 'getBannerSliderName' ]) |
|
28 | 28 | ]; |
29 | 29 | } |
30 | 30 |
@@ -16,9 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | public function load(array $config, ContainerBuilder $container): void |
18 | 18 | { |
19 | - $config = $this->processConfiguration($this->getConfiguration([], $container), $config); |
|
19 | + $config = $this->processConfiguration($this->getConfiguration([ ], $container), $config); |
|
20 | 20 | |
21 | - $container->setParameter('odiseo_sylius_banner_plugin.slider', $config['slider']); |
|
21 | + $container->setParameter('odiseo_sylius_banner_plugin.slider', $config[ 'slider' ]); |
|
22 | 22 | |
23 | 23 | $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
24 | 24 |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | |
129 | 129 | $imageFinder = new Finder(); |
130 | 130 | |
131 | - $imagesPath = __DIR__ . '/../Resources/fixtures/banner/images'; |
|
132 | - $mobileImagesPath = __DIR__ . '/../Resources/fixtures/banner/mobile-images'; |
|
131 | + $imagesPath = __DIR__.'/../Resources/fixtures/banner/images'; |
|
132 | + $mobileImagesPath = __DIR__.'/../Resources/fixtures/banner/mobile-images'; |
|
133 | 133 | |
134 | 134 | foreach ($imageFinder->files()->in($imagesPath)->name('01.png') as $img) { |
135 | 135 | /** @var string $path */ |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | foreach ($channels as $channel) { |
158 | 158 | $imageIndex = 1; |
159 | 159 | $mobileImageIndex = 1; |
160 | - for ($i=1; $i <= $options['banners_per_channel']; $i++) { |
|
160 | + for ($i = 1; $i <= $options[ 'banners_per_channel' ]; $i++) { |
|
161 | 161 | /** @var BannerInterface $banner */ |
162 | 162 | $banner = $this->bannerFactory->createNew(); |
163 | 163 | |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | |
173 | 173 | $imageFinder = new Finder(); |
174 | 174 | |
175 | - $imagesPath = __DIR__ . '/../Resources/fixtures/banner/images'; |
|
176 | - $mobileImagesPath = __DIR__ . '/../Resources/fixtures/banner/mobile-images'; |
|
175 | + $imagesPath = __DIR__.'/../Resources/fixtures/banner/images'; |
|
176 | + $mobileImagesPath = __DIR__.'/../Resources/fixtures/banner/mobile-images'; |
|
177 | 177 | |
178 | 178 | foreach ($imageFinder->files()->in($imagesPath)->name('0'.$imageIndex.'.png') as $img) { |
179 | 179 | /** @var string $path */ |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $file = new UploadedFile($path, $filename); |
184 | 184 | $banner->setImageFile($file); |
185 | 185 | } |
186 | - $imageIndex = $imageIndex>=4?1:$imageIndex+1; |
|
186 | + $imageIndex = $imageIndex >= 4 ? 1 : $imageIndex+1; |
|
187 | 187 | |
188 | 188 | foreach ($imageFinder->files()->in($mobileImagesPath)->name('0'.$mobileImageIndex.'.png') as $img) { |
189 | 189 | /** @var string $path */ |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $file = new UploadedFile($path, $filename); |
194 | 194 | $banner->setMobileImageFile($file); |
195 | 195 | } |
196 | - $mobileImageIndex = $mobileImageIndex>=4?1:$mobileImageIndex+1; |
|
196 | + $mobileImageIndex = $mobileImageIndex >= 4 ? 1 : $mobileImageIndex+1; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | $this->objectManager->persist($banner); |
@@ -43,11 +43,11 @@ |
||
43 | 43 | parent::configureOptions($resolver); |
44 | 44 | |
45 | 45 | $resolver->setDefaults([ |
46 | - 'validation_groups' => function (FormInterface $form) { |
|
46 | + 'validation_groups' => function(FormInterface $form) { |
|
47 | 47 | $bannerTranslation = $form->getData(); |
48 | 48 | |
49 | 49 | if (!$bannerTranslation || null === $bannerTranslation->getId()) { |
50 | - return array_merge($this->validationGroups, ['odiseo_image_create']); |
|
50 | + return array_merge($this->validationGroups, [ 'odiseo_image_create' ]); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | return $this->validationGroups; |
@@ -23,7 +23,7 @@ |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | $item |
26 | - ->addChild('banners', ['route' => 'odiseo_sylius_banner_plugin_admin_banner_index']) |
|
26 | + ->addChild('banners', [ 'route' => 'odiseo_sylius_banner_plugin_admin_banner_index' ]) |
|
27 | 27 | ->setLabel('odiseo_sylius_banner_plugin.menu.admin.banners') |
28 | 28 | ->setLabelAttribute('icon', 'image') |
29 | 29 | ; |