@@ -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_vendor', $config['driver'], $config['resources'], $container); |
|
| 22 | + $this->registerResources('odiseo_sylius_vendor', $config[ 'driver' ], $config[ 'resources' ], $container); |
|
| 23 | 23 | |
| 24 | 24 | $configFiles = [ |
| 25 | 25 | 'services.yml', |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | private function addVendorsSubMenu(ItemInterface $menu): void |
| 25 | 25 | { |
| 26 | 26 | $menu |
| 27 | - ->addChild('vendors', ['route' => 'odiseo_sylius_vendor_admin_vendor_index']) |
|
| 27 | + ->addChild('vendors', [ 'route' => 'odiseo_sylius_vendor_admin_vendor_index' ]) |
|
| 28 | 28 | ->setLabel('odiseo_sylius_vendor.ui.vendors') |
| 29 | 29 | ->setLabelAttribute('icon', 'trademark') |
| 30 | 30 | ; |
@@ -114,14 +114,14 @@ |
||
| 114 | 114 | 'inversedBy' => $inversedBy, |
| 115 | 115 | 'joinTable' => [ |
| 116 | 116 | 'name' => 'odiseo_vendors_'.$inversedBy, |
| 117 | - 'joinColumns' => [[ |
|
| 117 | + 'joinColumns' => [ [ |
|
| 118 | 118 | 'name' => $joinColumn, |
| 119 | 119 | 'referencedColumnName' => 'id' |
| 120 | - ]], |
|
| 121 | - 'inverseJoinColumns' => [[ |
|
| 120 | + ] ], |
|
| 121 | + 'inverseJoinColumns' => [ [ |
|
| 122 | 122 | 'name' => 'vendor_id', |
| 123 | 123 | 'referencedColumnName' => 'id' |
| 124 | - ]], |
|
| 124 | + ] ], |
|
| 125 | 125 | ] |
| 126 | 126 | ]); |
| 127 | 127 | } |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function generate(): iterable |
| 59 | 59 | { |
| 60 | - $urls = []; |
|
| 60 | + $urls = [ ]; |
|
| 61 | 61 | |
| 62 | 62 | foreach ($this->getVendors() as $vendor) { |
| 63 | - $urls[] = $this->createVendorUrl($vendor); |
|
| 63 | + $urls[ ] = $this->createVendorUrl($vendor); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $urls; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | private function getTranslations(VendorInterface $vendor): Collection |
| 70 | 70 | { |
| 71 | - return $vendor->getTranslations()->filter(function (TranslationInterface $translation) { |
|
| 71 | + return $vendor->getTranslations()->filter(function(TranslationInterface $translation) { |
|
| 72 | 72 | return $this->localeInLocaleCodes($translation); |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** @var ChannelInterface $channel */ |
| 92 | 92 | $channel = $this->channelContext->getChannel(); |
| 93 | 93 | |
| 94 | - return $channel->getLocales()->map(function (LocaleInterface $locale) { |
|
| 94 | + return $channel->getLocales()->map(function(LocaleInterface $locale) { |
|
| 95 | 95 | return $locale->getCode(); |
| 96 | 96 | })->toArray(); |
| 97 | 97 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 33 | 33 | { |
| 34 | - if ($options['multiple']) { |
|
| 34 | + if ($options[ 'multiple' ]) { |
|
| 35 | 35 | $builder->addModelTransformer(new CollectionToArrayTransformer()); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -41,17 +41,17 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function configureOptions(OptionsResolver $resolver) |
| 43 | 43 | { |
| 44 | - $criteria = []; |
|
| 45 | - $orderBy = ['name' => 'ASC']; |
|
| 44 | + $criteria = [ ]; |
|
| 45 | + $orderBy = [ 'name' => 'ASC' ]; |
|
| 46 | 46 | |
| 47 | 47 | $resolver->setDefaults([ |
| 48 | - 'choices' => function (Options $options) use ($criteria, $orderBy): array { |
|
| 48 | + 'choices' => function(Options $options) use ($criteria, $orderBy): array { |
|
| 49 | 49 | $vendors = $this->vendorRepository->findBy($criteria, $orderBy); |
| 50 | 50 | |
| 51 | - $choices = []; |
|
| 51 | + $choices = [ ]; |
|
| 52 | 52 | /** @var VendorInterface $vendor */ |
| 53 | 53 | foreach ($vendors as $vendor) { |
| 54 | - $choices[$vendor->getName()] = $vendor; |
|
| 54 | + $choices[ $vendor->getName() ] = $vendor; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return $choices; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | 'label' => 'odiseo_sylius_vendor.form.vendor.email', |
| 36 | 36 | ]) |
| 37 | 37 | ->add('logoFile', FileType::class, [ |
| 38 | - 'label' => 'odiseo_sylius_vendor.form.vendor.logo', |
|
| 38 | + 'label' => 'odiseo_sylius_vendor.form.vendor.logo', |
|
| 39 | 39 | ]) |
| 40 | 40 | ->add('channels', ChannelChoiceType::class, [ |
| 41 | 41 | 'multiple' => true, |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** @var ChannelInterface $channel */ |
| 95 | 95 | foreach ($channels as $channel) { |
| 96 | 96 | $imageIndex = 1; |
| 97 | - for ($i=1; $i <= $options['vendors_per_channel']; $i++) { |
|
| 97 | + for ($i = 1; $i <= $options[ 'vendors_per_channel' ]; $i++) { |
|
| 98 | 98 | /** @var VendorInterface $vendor */ |
| 99 | 99 | $vendor = $this->vendorFactory->createNew(); |
| 100 | 100 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $imageFinder = new Finder(); |
| 113 | - $imagesPath = __DIR__ . '/../Resources/fixtures/vendor'; |
|
| 113 | + $imagesPath = __DIR__.'/../Resources/fixtures/vendor'; |
|
| 114 | 114 | |
| 115 | 115 | /** @var File $img */ |
| 116 | 116 | foreach ($imageFinder->files()->in($imagesPath)->name('0'.$imageIndex.'.png') as $img) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $vendor->setLogoFile($file); |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | - $imageIndex = $imageIndex>=4?1:$imageIndex+1; |
|
| 122 | + $imageIndex = $imageIndex >= 4 ? 1 : $imageIndex + 1; |
|
| 123 | 123 | |
| 124 | 124 | $this->objectManager->persist($vendor); |
| 125 | 125 | } |
@@ -49,6 +49,6 @@ |
||
| 49 | 49 | function it_allows_access_via_properties(): void |
| 50 | 50 | { |
| 51 | 51 | $this->setDescription('Vendor description'); |
| 52 | - $this->getDescription()->shouldReturn('Vendor description');; |
|
| 52 | + $this->getDescription()->shouldReturn('Vendor description'); ; |
|
| 53 | 53 | } |
| 54 | 54 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | $this->setEmail('[email protected]'); |
| 94 | 94 | $this->getEmail()->shouldReturn('[email protected]'); |
| 95 | 95 | |
| 96 | - $file = new File(__DIR__ . '/VendorSpec.php'); |
|
| 96 | + $file = new File(__DIR__.'/VendorSpec.php'); |
|
| 97 | 97 | $this->setLogoFile($file); |
| 98 | 98 | $this->getLogoFile()->shouldReturn($file); |
| 99 | 99 | |