Completed
Push — master ( 2933de...ffcf9e )
by Odiseo
03:31
created
src/DependencyInjection/OdiseoSyliusVendorExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
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',
Please login to merge, or discard this patch.
src/Menu/AdminMenuListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
         ;
Please login to merge, or discard this patch.
src/Form/Type/VendorType.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             ->add('name', TextType::class, [
25 25
                 'label' => 'sylius.ui.name',
26 26
             ])
27
-            ->add('enabled', CheckboxType::class , [
27
+            ->add('enabled', CheckboxType::class, [
28 28
                 'label' => 'sylius.ui.enabled',
29 29
             ])
30 30
             ->add('translations', ResourceTranslationsType::class, [
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             ->add('email', EmailType::class, [
35 35
                 'label' => 'odiseo_sylius_vendor.form.vendor.email',
36 36
             ])
37
-            ->add('logoFile',  FileType::class, [
37
+            ->add('logoFile', FileType::class, [
38 38
                  'label' => 'odiseo_sylius_vendor.form.vendor.logo',
39 39
             ])
40 40
             ->add('channels', ChannelChoiceType::class, [
Please login to merge, or discard this patch.
src/Form/Type/VendorChoiceType.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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,18 +41,18 @@  discard block
 block discarded – undo
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 54
                 {
55
-                    $choices[$vendor->getName()] = $vendor;
55
+                    $choices[ $vendor->getName() ] = $vendor;
56 56
                 }
57 57
 
58 58
                 return $choices;
Please login to merge, or discard this patch.
src/Fixture/VendorFixture.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
         $channels = $this->channelRepository->findAll();
93 93
 
94 94
         /** @var ChannelInterface $channel */
95
-        foreach($channels as $channel)
95
+        foreach ($channels as $channel)
96 96
         {
97 97
             $imageIndex = 1;
98
-            for($i=1; $i <= $options['vendors_per_channel']; $i++)
98
+            for ($i = 1; $i <= $options[ 'vendors_per_channel' ]; $i++)
99 99
             {
100 100
                 /** @var VendorInterface $vendor */
101 101
                 $vendor = $this->vendorFactory->createNew();
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
                 }
113 113
 
114 114
                 $imageFinder = new Finder();
115
-                $imagesPath = __DIR__ . '/../Resources/fixtures/vendor';
115
+                $imagesPath = __DIR__.'/../Resources/fixtures/vendor';
116 116
 
117 117
                 foreach ($imageFinder->files()->in($imagesPath)->name('0'.$imageIndex.'.png') as $img)
118 118
                 {
119 119
                     $file = new UploadedFile($img->getRealPath(), $img->getFilename());
120 120
                     $vendor->setLogoFile($file);
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
             }
Please login to merge, or discard this patch.
src/EventListener/ORMVendorAwareListener.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -133,16 +133,16 @@  discard block
 block discarded – undo
133 133
                 'inversedBy' => 'vendors',
134 134
                 'joinTable' => [
135 135
                     'name' => 'odiseo_vendors_products',
136
-                    'joinColumns' => [[
136
+                    'joinColumns' => [ [
137 137
                         'name' => 'vendor_id',
138 138
                         'referencedColumnName' => 'id',
139 139
                         'onDelete' => 'CASCADE',
140 140
                         'nullable' => false,
141
-                    ]],
142
-                    'inverseJoinColumns' => [[
141
+                    ] ],
142
+                    'inverseJoinColumns' => [ [
143 143
                         'name' => 'product_id',
144 144
                         'referencedColumnName' => 'id',
145
-                    ]],
145
+                    ] ],
146 146
                 ]
147 147
             ]);
148 148
         }
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
                 'inversedBy' => 'vendors',
155 155
                 'joinTable' => [
156 156
                     'name' => 'odiseo_vendors_channels',
157
-                    'joinColumns' => [[
157
+                    'joinColumns' => [ [
158 158
                         'name' => 'vendor_id',
159 159
                         'referencedColumnName' => 'id',
160 160
                         'onDelete' => 'CASCADE',
161 161
                         'nullable' => false,
162
-                    ]],
163
-                    'inverseJoinColumns' => [[
162
+                    ] ],
163
+                    'inverseJoinColumns' => [ [
164 164
                         'name' => 'channel_id',
165 165
                         'referencedColumnName' => 'id',
166
-                    ]],
166
+                    ] ],
167 167
                 ]
168 168
             ]);
169 169
         }
Please login to merge, or discard this patch.
src/Model/Vendor.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@
 block discarded – undo
222 222
     {
223 223
         $this->logoFile = $file;
224 224
 
225
-        if($file)
225
+        if ($file)
226 226
         {
227 227
             $this->setUpdatedAt(new \DateTime());
228 228
         }
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -155,8 +155,9 @@  discard block
 block discarded – undo
155 155
         if (!$this->channels->contains($channel)) {
156 156
             $this->channels->add($channel);
157 157
 
158
-            if ($channel instanceof VendorsAwareInterface)
159
-                $channel->addVendor($this);
158
+            if ($channel instanceof VendorsAwareInterface) {
159
+                            $channel->addVendor($this);
160
+            }
160 161
         }
161 162
     }
162 163
 
@@ -168,8 +169,9 @@  discard block
 block discarded – undo
168 169
         if ($this->channels->contains($channel)) {
169 170
             $this->channels->removeElement($channel);
170 171
 
171
-            if ($channel instanceof VendorsAwareInterface)
172
-                $channel->removeVendor($this);
172
+            if ($channel instanceof VendorsAwareInterface) {
173
+                            $channel->removeVendor($this);
174
+            }
173 175
         }
174 176
     }
175 177
 
@@ -197,8 +199,9 @@  discard block
 block discarded – undo
197 199
         if (!$this->products->contains($product)) {
198 200
             $this->products->add($product);
199 201
 
200
-            if ($product instanceof VendorsAwareInterface)
201
-                $product->addVendor($this);
202
+            if ($product instanceof VendorsAwareInterface) {
203
+                            $product->addVendor($this);
204
+            }
202 205
         }
203 206
     }
204 207
 
@@ -210,8 +213,9 @@  discard block
 block discarded – undo
210 213
         if ($this->products->contains($product)) {
211 214
             $this->products->removeElement($product);
212 215
 
213
-            if ($product instanceof VendorsAwareInterface)
214
-                $product->removeVendor($this);
216
+            if ($product instanceof VendorsAwareInterface) {
217
+                            $product->removeVendor($this);
218
+            }
215 219
         }
216 220
     }
217 221
 
Please login to merge, or discard this patch.
src/Model/VendorsTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function addVendor(VendorInterface $vendor)
32 32
     {
33
-        if(!$this->vendors->contains($vendor)) {
33
+        if (!$this->vendors->contains($vendor)) {
34 34
             $this->vendors->add($vendor);
35 35
         }
36 36
     }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function removeVendor(VendorInterface $vendor)
42 42
     {
43
-        if($this->vendors->contains($vendor)) {
43
+        if ($this->vendors->contains($vendor)) {
44 44
             $this->vendors->removeElement($vendor);
45 45
         }
46 46
     }
Please login to merge, or discard this patch.