Completed
Push — master ( d79f58...e0b171 )
by Jan
03:56 queued 10s
created
src/Entity/Parts/PartLot.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function getIDString(): string
117 117
     {
118
-        return 'PL' . $this->getID();
118
+        return 'PL'.$this->getID();
119 119
     }
120 120
 
121 121
     /**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
     public function setAmount(float $new_amount): PartLot
270 270
     {
271
-        $this->amount  = $new_amount;
271
+        $this->amount = $new_amount;
272 272
         return $this;
273 273
     }
274 274
 
Please login to merge, or discard this patch.
src/EntityListeners/TreeCacheInvalidationListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 
79 79
         /* If any group change, then invalidate all cached trees. Users Permissions can be inherited from groups,
80 80
             so a change in any group can cause big permisssion changes for users. So to be sure, invalidate all trees */
81
-        if($element instanceof Group) {
81
+        if ($element instanceof Group) {
82 82
             $tag = "groups";
83 83
             $this->cache->invalidateTags([$tag]);
84 84
         }
Please login to merge, or discard this patch.
src/Services/UserCacheKeyGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,10 +64,10 @@
 block discarded – undo
64 64
         //If the user is null, then treat it as anonymous user.
65 65
         //When the anonymous user is passed as user then use this path too.
66 66
         if ($user === null || $user->getID() === User::ID_ANONYMOUS) {
67
-            return 'user$_' . User::ID_ANONYMOUS;
67
+            return 'user$_'.User::ID_ANONYMOUS;
68 68
         }
69 69
 
70 70
         //In the most cases we can just use the username (its unique)
71
-        return "user_" . $user->getUsername();
71
+        return "user_".$user->getUsername();
72 72
     }
73 73
 }
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
src/Services/TreeBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         $tree_node = new TreeViewNode($element->__toString(), $href, $children_nodes);
104 104
 
105
-        if($children_nodes != null) {
105
+        if ($children_nodes != null) {
106 106
             $tree_node->addTag((string) count($children_nodes));
107 107
         }
108 108
 
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
         $parent_id = $parent != null ? $parent->getID() : "0";
178 178
         // Backslashes are not allowed in cache keys
179 179
         $secure_class_name = str_replace("\\", '_', $class_name);
180
-        $key = "list_" . $this->keyGenerator->generateKey() . "_" . $secure_class_name . $parent_id;
180
+        $key = "list_".$this->keyGenerator->generateKey()."_".$secure_class_name.$parent_id;
181 181
 
182
-        $ret = $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) {
182
+        $ret = $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) {
183 183
             // Invalidate when groups, a element with the class or the user changes
184 184
             $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]);
185 185
             /**
Please login to merge, or discard this patch.
src/Services/ToolsTreeBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,9 +66,9 @@
 block discarded – undo
66 66
      */
67 67
     public function getTree() : array
68 68
     {
69
-        $key = "tree_tools_" .  $this->keyGenerator->generateKey();
69
+        $key = "tree_tools_".$this->keyGenerator->generateKey();
70 70
 
71
-        return $this->cache->get($key, function (ItemInterface $item) {
71
+        return $this->cache->get($key, function(ItemInterface $item) {
72 72
             //Invalidate tree, whenever group or the user changes
73 73
             $item->tag(["tree_tools", "groups", $this->keyGenerator->generateKey()]);
74 74
 
Please login to merge, or discard this patch.
src/Migrations/Version20190812154222.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
30 30
 
31 31
         /** Migrate the part locations for parts with known instock */
32 32
         $this->addSql(
33
-            'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) ' .
34
-                'SELECT parts.id, parts.id_storelocation,  parts.instock, 0, NOW(), NOW() FROM parts ' .
33
+            'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) '.
34
+                'SELECT parts.id, parts.id_storelocation,  parts.instock, 0, NOW(), NOW() FROM parts '.
35 35
                 'WHERE parts.instock >= 0'
36 36
         );
37 37
 
38 38
         //Migrate part locations for parts with unknown instock
39 39
         $this->addSql(
40
-            'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) ' .
41
-            'SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts ' .
40
+            'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) '.
41
+            'SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts '.
42 42
             'WHERE parts.instock = -2'
43 43
         );
44 44
 
Please login to merge, or discard this patch.
src/Controller/AdminPages/BaseAdminController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             //Rebuild form, so it is based on the updated data. Important for the parent field!
81 81
             //We can not use dynamic form events here, because the parent entity list is build from database!
82 82
             $form = $this->createForm($this->form_class, $entity);
83
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
83
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
84 84
             $this->addFlash('error', $this->translator->trans('entity.edit_flash.invalid'));
85 85
         }
86 86
 
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
             $em->flush();
108 108
             $this->addFlash('success', $this->translator->trans('entity.created_flash'));
109 109
 
110
-            return $this->redirectToRoute($this->route_base . '_edit', ['id' => $new_entity->getID()]);
111
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
110
+            return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
111
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
112 112
             $this->addFlash('error', $this->translator->trans('entity.created_flash.invalid'));
113 113
         }
114 114
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
             foreach ($errors as $name => $error) {
130 130
                 /** @var $error ConstraintViolationList */
131
-                $this->addFlash('error', $name . ':' . $error);
131
+                $this->addFlash('error', $name.':'.$error);
132 132
             }
133 133
         }
134 134
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             //Show errors to user:
148 148
             foreach ($errors as $name => $error) {
149 149
                 /** @var $error ConstraintViolationList */
150
-                $this->addFlash('error', $name . ':' . $error);
150
+                $this->addFlash('error', $name.':'.$error);
151 151
             }
152 152
         }
153 153
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $this->addFlash('success', 'attachment_type.deleted');
189 189
         }
190 190
 
191
-        return $this->redirectToRoute($this->route_base .  '_new');
191
+        return $this->redirectToRoute($this->route_base.'_new');
192 192
     }
193 193
 
194 194
     protected function _exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request)
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
         $entities = $em->getRepository($this->entity_class)->findAll();
201 201
 
202
-        return $exporter->exportEntityFromRequest($entities,$request);
202
+        return $exporter->exportEntityFromRequest($entities, $request);
203 203
     }
204 204
 
205 205
     protected function _exportEntity(NamedDBElement $entity, EntityExporter $exporter, Request $request)
Please login to merge, or discard this patch.
src/Form/Part/PartBaseType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             ->add('description', CKEditorType::class, ['required' => false, 'empty_data' => '',
78 78
                 'label' => 'description.label', 'help' => 'bbcode.hint', 'config_name' => 'description_config',
79 79
                 'attr' => ['placeholder' => 'part.description.placeholder', 'rows' => 2],
80
-                'disabled' => !$this->security->isGranted('description.edit', $part) ])
80
+                'disabled' => !$this->security->isGranted('description.edit', $part)])
81 81
             ->add('minAmount', SIUnitType::class,
82 82
                 ['attr' => ['min' => 0, 'placeholder' => 'part.mininstock.placeholder'], 'label' => 'mininstock.label',
83 83
                     'measurement_unit' => $part->getPartUnit(),
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 'disabled' => !$this->security->isGranted('move', $part), ])
91 91
             ->add('tags', TextType::class, ['required' => false, 'label' => 'part.tags', 'empty_data' => "",
92 92
                 'attr' => ['data-role' => 'tagsinput'],
93
-                'disabled' => !$this->security->isGranted('edit', $part) ]);
93
+                'disabled' => !$this->security->isGranted('edit', $part)]);
94 94
 
95 95
         //Manufacturer section
96 96
         $builder->add('manufacturer', StructuralEntityType::class, ['class' => Manufacturer::class,
Please login to merge, or discard this patch.
src/Services/AmountFormatter.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     protected function configureOptions(OptionsResolver $resolver)
53 53
     {
54 54
         $resolver->setDefaults([
55
-            'show_prefix' => function (Options $options) {
55
+            'show_prefix' => function(Options $options) {
56 56
                 if ($options['measurement_unit'] !== null) {
57 57
                     /** @var MeasurementUnit $unit */
58 58
                     $unit = $options['measurement_unit'];
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 }
61 61
                 return true;
62 62
             },
63
-            'is_integer' => function (Options $options) {
63
+            'is_integer' => function(Options $options) {
64 64
                 if ($options['measurement_unit'] !== null) {
65 65
                     /** @var MeasurementUnit $unit */
66 66
                     $unit = $options['measurement_unit'];
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 }
69 69
                 return true;
70 70
             },
71
-            'unit' => function (Options $options) {
71
+            'unit' => function(Options $options) {
72 72
                 if ($options['measurement_unit'] !== null) {
73 73
                     /** @var MeasurementUnit $unit */
74 74
                     $unit = $options['measurement_unit'];
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
                 return '';
78 78
             },
79 79
             'decimals' => 2,
80
-            'error_mapping' => [ '.' => 'value']
80
+            'error_mapping' => ['.' => 'value']
81 81
         ]);
82 82
 
83 83
         $resolver->setAllowedTypes('decimals', 'int');
84 84
 
85
-        $resolver->setNormalizer('decimals', function (Options $options, $value) {
85
+        $resolver->setNormalizer('decimals', function(Options $options, $value) {
86 86
             // If the unit is integer based, then dont show any decimals
87 87
             if ($options['is_integer']) {
88 88
                 return 0;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         //Otherwise just output it
128
-        $format_string = '%.' . $options['decimals'] . 'f ' . $options['unit'];
128
+        $format_string = '%.'.$options['decimals'].'f '.$options['unit'];
129 129
         return sprintf($format_string, $value);
130 130
     }
131 131
 }
132 132
\ No newline at end of file
Please login to merge, or discard this patch.