Completed
Push — master ( 408d98...51be17 )
by Jan
04:01
created
src/DataTables/PartsDataTable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $dataTable//->add("id", TextColumn::class)
60 60
             ->add('name', TextColumn::class, ['label' => 'name.label',
61
-            'render' => function ($value, Part $context) {
61
+            'render' => function($value, Part $context) {
62 62
                 return $this->urlGenerator->infoHTML($context);
63
-            }, ])
63
+            },])
64 64
             ->add('description', TextColumn::class, ['label' => 'description.label'])
65 65
             ->add('category', TextColumn::class, ['field' => 'category.name', 'label' => 'category.label'])
66 66
             ->add('instock', TextColumn::class, ['label' => 'instock.label_short'])
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             ->createAdapter(ORMAdapter::class, [
71 71
                 'entity' => Part::class,
72 72
                 'criteria' => [
73
-                function (QueryBuilder $builder) use ($options) {
73
+                function(QueryBuilder $builder) use ($options) {
74 74
                     if (isset($options['cid'])) {
75 75
                         $builder->andWhere('part.category = :cid')
76 76
                             ->setParameter('cid', $options['cid']);
Please login to merge, or discard this patch.
src/Form/PartType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
                     'disabled' => !$this->security->isGranted('name.edit', $part), ])
65 65
             ->add('description', TextType::class, ['required' => false, 'empty_data' => '',
66 66
                 'label' => 'description.label', 'help' => 'bbcode.hint', 'attr' => ['placeholder' => 'part.description.placeholder'],
67
-                'disabled' => !$this->security->isGranted('description.edit', $part), 'empty_data' => '' ])
67
+                'disabled' => !$this->security->isGranted('description.edit', $part), 'empty_data' => ''])
68 68
             ->add('instock', IntegerType::class,
69 69
                 ['attr' => ['min' => 0, 'placeholder' => 'part.instock.placeholder'], 'label' => 'instock.label',
70 70
                 'disabled' => !$this->security->isGranted('instock.edit', $part), ])
Please login to merge, or discard this patch.
src/Services/PermissionResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@
 block discarded – undo
179 179
      */
180 180
     public function listOperationsForPermission(string $permission): array
181 181
     {
182
-        if(!$this->isValidPermission($permission)) {
182
+        if (!$this->isValidPermission($permission)) {
183 183
             throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission));
184 184
         }
185 185
         $operations = $this->permission_structure['perms'][$permission]['operations'];
Please login to merge, or discard this patch.
src/Services/EntityExporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         }
98 98
 
99 99
         //Ensure that we always serialize an array. This makes it easier to import the data again.
100
-        if(is_array($entity)) {
100
+        if (is_array($entity)) {
101 101
             $entity_array = $entity;
102 102
         } else {
103 103
             $entity_array = [$entity];
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             }
131 131
 
132 132
 
133
-            $filename = "export_" . $entity_name . "_" . $level . "." . $format;
133
+            $filename = "export_".$entity_name."_".$level.".".$format;
134 134
 
135 135
             // Create the disposition of the file
136 136
             $disposition = $response->headers->makeDisposition(
Please login to merge, or discard this patch.
src/Services/EntityImporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,11 +137,11 @@
 block discarded – undo
137 137
         }
138 138
 
139 139
         //The [] behind class_name denotes that we expect an array.
140
-        $entities = $this->serializer->deserialize($content, $class_name . '[]', $options['format'],
140
+        $entities = $this->serializer->deserialize($content, $class_name.'[]', $options['format'],
141 141
             ['groups' => $groups, 'csv_delimiter' => $options['csv_separator']]);
142 142
 
143 143
         //Ensure we have an array of entitity elements.
144
-        if(!is_array($entities)) {
144
+        if (!is_array($entities)) {
145 145
             $entities = [$entities];
146 146
         }
147 147
 
Please login to merge, or discard this patch.
src/Services/StructuralElementRecursionHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
             $em->remove($element);
96 96
         });
97 97
 
98
-        if($flush) {
98
+        if ($flush) {
99 99
             $em->flush();
100 100
         }
101 101
     }
Please login to merge, or discard this patch.
src/Form/ImportType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@
 block discarded – undo
62 62
         //Disable import if user is not allowed to create elements.
63 63
         $entity = new $data['entity_class'];
64 64
         $perm_name = "create";
65
-        $disabled = ! $this->security->isGranted($perm_name, $entity);
65
+        $disabled = !$this->security->isGranted($perm_name, $entity);
66 66
 
67 67
         $builder
68 68
 
69 69
             ->add('format', ChoiceType::class, ['choices' =>
70
-                ['JSON' => 'json', 'XML' => 'xml','CSV'=>'csv' ,'YAML' => 'yaml'], 'label' => 'export.format',
70
+                ['JSON' => 'json', 'XML' => 'xml', 'CSV'=>'csv', 'YAML' => 'yaml'], 'label' => 'export.format',
71 71
                 'disabled' => $disabled])
72 72
             ->add('csv_separator', TextType::class, ['data' => ';', 'label' => 'import.csv_separator',
73 73
                 'disabled' => $disabled]);
74
-            if($data['entity_class'] instanceof StructuralDBElement) {
74
+            if ($data['entity_class'] instanceof StructuralDBElement) {
75 75
                 $builder->
76 76
                 add('parent', EntityType::class, ['class' => $data['entity_class'], 'choice_label' => 'full_path',
77 77
                     'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'required' => false,
Please login to merge, or discard this patch.
src/Twig/AppExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
     public function getTests()
69 69
     {
70 70
         return [
71
-            new TwigTest('instanceof', function ($var, $instance) {
71
+            new TwigTest('instanceof', function($var, $instance) {
72 72
                 return $var instanceof $instance;
73 73
             } )
74 74
         ];
Please login to merge, or discard this patch.
src/Controller/AdminPages/BaseAdminController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $em->flush();
97 97
             //$this->addFlash('success', $translator->trans('part.created_flash'));
98 98
 
99
-            return $this->redirectToRoute($this->route_base . '_edit', ['id' => $new_entity->getID()]);
99
+            return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
100 100
         }
101 101
 
102 102
         //Import form
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
             foreach ($errors as $name => $error) {
117 117
                 /** @var $error ConstraintViolationList */
118
-                $this->addFlash('error', $name . ":" . $error);
118
+                $this->addFlash('error', $name.":".$error);
119 119
             }
120 120
         }
121 121
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $this->addFlash('success', 'attachment_type.deleted');
156 156
         }
157 157
 
158
-        return $this->redirectToRoute($this->route_base .  '_new');
158
+        return $this->redirectToRoute($this->route_base.'_new');
159 159
     }
160 160
 
161 161
     protected function _exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request)
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         $entities = $em->getRepository($this->entity_class)->findAll();
168 168
 
169
-        return $exporter->exportEntityFromRequest($entities,$request);
169
+        return $exporter->exportEntityFromRequest($entities, $request);
170 170
     }
171 171
 
172 172
     protected function _exportEntity(NamedDBElement $entity, EntityExporter $exporter, Request $request)
Please login to merge, or discard this patch.