@@ -16,10 +16,10 @@ |
||
| 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 | $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
| 21 | 21 | |
| 22 | - $this->registerResources('odiseo_sylius_banner', $config['driver'], $config['resources'], $container); |
|
| 22 | + $this->registerResources('odiseo_sylius_banner', $config[ 'driver' ], $config[ 'resources' ], $container); |
|
| 23 | 23 | |
| 24 | 24 | $configFiles = [ |
| 25 | 25 | 'services.yml', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** @var ItemInterface $item */ |
| 18 | 18 | $item = $menu->getChild('catalog'); |
| 19 | 19 | if (null == $item) { |
| 20 | - $item = $menu; |
|
| 20 | + $item = $menu; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $item->addChild('banners', ['route' => 'odiseo_sylius_banner_admin_banner_index']) |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $item = $menu; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - $item->addChild('banners', ['route' => 'odiseo_sylius_banner_admin_banner_index']) |
|
| 23 | + $item->addChild('banners', [ 'route' => 'odiseo_sylius_banner_admin_banner_index' ]) |
|
| 24 | 24 | ->setLabel('odiseo_sylius_banner.ui.banners') |
| 25 | 25 | ->setLabelAttribute('icon', 'image') |
| 26 | 26 | ; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | parent::buildForm($builder, $options); |
| 18 | 18 | |
| 19 | 19 | $builder |
| 20 | - ->add('imageFile', FileType::class, [ |
|
| 20 | + ->add('imageFile', FileType::class, [ |
|
| 21 | 21 | 'label' => 'odiseo_sylius_banner.form.banner.image', |
| 22 | 22 | ]) |
| 23 | 23 | ->add('url', TextType::class, [ |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | $builder |
| 23 | 23 | ->addEventSubscriber(new AddCodeFormSubscriber()) |
| 24 | - ->add('enabled', CheckboxType::class , [ |
|
| 24 | + ->add('enabled', CheckboxType::class, [ |
|
| 25 | 25 | 'label' => 'sylius.ui.enabled', |
| 26 | 26 | ]) |
| 27 | 27 | ->add('translations', ResourceTranslationsType::class, [ |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | ->setParameter('enabled', true) |
| 22 | 22 | ; |
| 23 | 23 | |
| 24 | - if($taxon) { |
|
| 24 | + if ($taxon) { |
|
| 25 | 25 | $queryBuilder->innerJoin('b.taxons', 'taxon') |
| 26 | 26 | ->andWhere('taxon = :taxon') |
| 27 | 27 | ->setParameter('taxon', $taxon) |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $channels = $this->channelRepository->findAll(); |
| 139 | 139 | |
| 140 | 140 | /** @var ChannelInterface $channel */ |
| 141 | - foreach($channels as $channel) |
|
| 141 | + foreach ($channels as $channel) |
|
| 142 | 142 | { |
| 143 | 143 | /** @var BannerInterface $banner */ |
| 144 | 144 | $banner = $this->bannerFactory->createNew(); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $banner->setUrl($this->faker->url); |
| 155 | 155 | |
| 156 | 156 | $imageFinder = new Finder(); |
| 157 | - $imagesPath = __DIR__ . '/../Resources/fixtures/banner'; |
|
| 157 | + $imagesPath = __DIR__.'/../Resources/fixtures/banner'; |
|
| 158 | 158 | |
| 159 | 159 | foreach ($imageFinder->files()->in($imagesPath)->name('01.png') as $img) |
| 160 | 160 | { |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** @var ChannelInterface $channel */ |
| 174 | - foreach($channels as $channel) |
|
| 174 | + foreach ($channels as $channel) |
|
| 175 | 175 | { |
| 176 | 176 | $imageIndex = 1; |
| 177 | - for($i=1; $i <= $options['banners_per_channel']; $i++) |
|
| 177 | + for ($i = 1; $i <= $options[ 'banners_per_channel' ]; $i++) |
|
| 178 | 178 | { |
| 179 | 179 | /** @var BannerInterface $banner */ |
| 180 | 180 | $banner = $this->bannerFactory->createNew(); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $banner->setUrl($this->faker->url); |
| 190 | 190 | |
| 191 | 191 | $imageFinder = new Finder(); |
| 192 | - $imagesPath = __DIR__ . '/../Resources/fixtures/banner'; |
|
| 192 | + $imagesPath = __DIR__.'/../Resources/fixtures/banner'; |
|
| 193 | 193 | |
| 194 | 194 | foreach ($imageFinder->files()->in($imagesPath)->name('0'.$imageIndex.'.png') as $img) |
| 195 | 195 | { |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $file = new UploadedFile($path, $filename); |
| 201 | 201 | $banner->setImageFile($file); |
| 202 | 202 | } |
| 203 | - $imageIndex = $imageIndex>=4?1:$imageIndex+1; |
|
| 203 | + $imageIndex = $imageIndex >= 4 ? 1 : $imageIndex+1; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $this->objectManager->persist($banner); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function addChannel(ChannelInterface $channel): void |
| 137 | 137 | { |
| 138 | - if(!$this->hasChannel($channel)) { |
|
| 138 | + if (!$this->hasChannel($channel)) { |
|
| 139 | 139 | $this->channels->add($channel); |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function removeChannel(ChannelInterface $channel): void |
| 147 | 147 | { |
| 148 | - if($this->hasChannel($channel)) { |
|
| 148 | + if ($this->hasChannel($channel)) { |
|
| 149 | 149 | $this->channels->removeElement($channel); |
| 150 | 150 | } |
| 151 | 151 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function removeTaxon(TaxonInterface $taxon): void |
| 183 | 183 | { |
| 184 | - if($this->taxons->contains($taxon)) { |
|
| 184 | + if ($this->taxons->contains($taxon)) { |
|
| 185 | 185 | $this->taxons->removeElement($taxon); |
| 186 | 186 | } |
| 187 | 187 | } |