Completed
Push — master ( 07dcbc...2d4def )
by Jan
04:20
created
src/Security/Voter/PartVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             if (false !== strpos($attribute, '.')) {
27 27
                 [$perm, $op] = explode('.', $attribute);
28 28
 
29
-                return $this->resolver->isValidOperation('parts_' . $perm, $op);
29
+                return $this->resolver->isValidOperation('parts_'.$perm, $op);
30 30
             }
31 31
 
32 32
             return $this->resolver->isValidOperation('parts', $attribute);
Please login to merge, or discard this patch.
src/Security/Voter/StructureVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     protected function supports($attribute, $subject)
58 58
     {
59
-        if(is_object($subject)) {
59
+        if (is_object($subject)) {
60 60
             $permission_name = $this->instanceToPermissionName($subject);
61 61
             //If permission name is null, then the subject is not supported
62 62
             return ($permission_name !== null) && $this->resolver->isValidOperation($permission_name, $attribute);
Please login to merge, or discard this patch.
src/Form/Permissions/PermissionGroupType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,13 +81,13 @@
 block discarded – undo
81 81
     {
82 82
         parent::configureOptions($resolver);
83 83
 
84
-        $resolver->setDefault('group_name', function (Options $options) {
84
+        $resolver->setDefault('group_name', function(Options $options) {
85 85
             return trim($options['name']);
86 86
         });
87 87
 
88 88
         $resolver->setDefault('inherit', false);
89 89
 
90
-        $resolver->setDefault('label', function (Options $options) {
90
+        $resolver->setDefault('label', function(Options $options) {
91 91
             if (!empty($this->perm_structure['groups'][$options['group_name']]['label'])) {
92 92
                 return $this->perm_structure['groups'][$options['group_name']]['label'];
93 93
             }
Please login to merge, or discard this patch.
src/DataTables/Column/EntityColumn.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,12 +71,12 @@
 block discarded – undo
71 71
 
72 72
         $resolver->setRequired('property');
73 73
 
74
-        $resolver->setDefault('field', function (Options $option) {
75
-            return $option['property'] . '.name';
74
+        $resolver->setDefault('field', function(Options $option) {
75
+            return $option['property'].'.name';
76 76
         });
77 77
 
78
-        $resolver->setDefault('render', function (Options $options) {
79
-            return function ($value, Part $context) use ($options) {
78
+        $resolver->setDefault('render', function(Options $options) {
79
+            return function($value, Part $context) use ($options) {
80 80
                 /** @var DBElement $entity */
81 81
                 $entity = $this->accessor->getValue($context, $options['property']);
82 82
 
Please login to merge, or discard this patch.
src/Entity/Parts/Part.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
      */
139 139
     public function getIDString(): string
140 140
     {
141
-        return 'P' . sprintf('%06d', $this->getID());
141
+        return 'P'.sprintf('%06d', $this->getID());
142 142
     }
143 143
 
144 144
     /**
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $attachments = $form['attachments'];
91 91
             foreach ($attachments as $attachment) {
92 92
                 /** @var $attachment FormInterface */
93
-                $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData());
93
+                $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData());
94 94
             }
95 95
 
96 96
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $this->addFlash('info', $translator->trans('part.edited_flash'));
100 100
             //Reload form, so the SIUnitType entries use the new part unit
101 101
             $form = $this->createForm(PartBaseType::class, $part);
102
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
102
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
103 103
             $this->addFlash('error', $translator->trans('part.edited_flash.invalid'));
104 104
         }
105 105
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     {
122 122
         $this->denyAccessUnlessGranted('delete', $part);
123 123
 
124
-        if ($this->isCsrfTokenValid('delete' . $part->getId(), $request->request->get('_token'))) {
124
+        if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) {
125 125
             $entityManager = $this->getDoctrine()->getManager();
126 126
 
127 127
             //Remove part
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             $attachments = $form['attachments'];
166 166
             foreach ($attachments as $attachment) {
167 167
                 /** @var $attachment FormInterface */
168
-                $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData());
168
+                $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData());
169 169
             }
170 170
 
171 171
             $em->persist($new_part);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
176 176
         }
177 177
 
178
-        if ($form->isSubmitted() && ! $form->isValid()) {
178
+        if ($form->isSubmitted() && !$form->isValid()) {
179 179
             $this->addFlash('error', $translator->trans('part.created_flash.invalid'));
180 180
         }
181 181
 
Please login to merge, or discard this patch.
src/Controller/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         }
141 141
 
142 142
         //Show permissions to user
143
-        $builder = $this->createFormBuilder()->add('permissions',PermissionsType::class, [
143
+        $builder = $this->createFormBuilder()->add('permissions', PermissionsType::class, [
144 144
             'mapped' => false,
145 145
             'disabled' => true,
146 146
             'inherit' => true,
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
          */
165 165
         $user = $this->getUser();
166 166
 
167
-        if(!$user instanceof User) {
167
+        if (!$user instanceof User) {
168 168
             return new \RuntimeException("This controller only works only for Part-DB User objects!");
169 169
         }
170 170
 
Please login to merge, or discard this patch.
src/Services/AmountFormatter.php 1 patch
Spacing   +7 added lines, -7 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 false;
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,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
         //Otherwise just output it
127 127
         if (!empty($options['unit'])) {
128
-            $format_string = '%.' . $options['decimals'] . 'f ' . $options['unit'];
128
+            $format_string = '%.'.$options['decimals'].'f '.$options['unit'];
129 129
         } else { //Dont add space after number if no unit was specified
130
-            $format_string = '%.' . $options['decimals'] . 'f';
130
+            $format_string = '%.'.$options['decimals'].'f';
131 131
         }
132 132
         return sprintf($format_string, $value);
133 133
     }
Please login to merge, or discard this patch.
src/Services/SIFormatter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function getPrefixByMagnitude(int $magnitude) : array
57 57
     {
58
-        $prefixes_pos = ['' ,'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
59
-        $prefixes_neg = ['' ,'m', 'μ', 'n', 'p', 'f', 'a', 'z', 'y'];
58
+        $prefixes_pos = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
59
+        $prefixes_neg = ['', 'm', 'μ', 'n', 'p', 'f', 'a', 'z', 'y'];
60 60
 
61 61
         if ($magnitude >= 0) {
62 62
             $nearest = (int) floor(abs($magnitude) / 3);
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
         $value /= $divisor;
106 106
         //Build the format string, e.g.: %.2d km
107 107
         if ($unit !== '' || $symbol !== '') {
108
-            $format_string = '%.' . $decimals . 'f ' . $symbol . $unit;
108
+            $format_string = '%.'.$decimals.'f '.$symbol.$unit;
109 109
         } else {
110
-            $format_string = '%.' . $decimals . 'f';
110
+            $format_string = '%.'.$decimals.'f';
111 111
         }
112 112
 
113 113
         return sprintf($format_string, $value);
Please login to merge, or discard this patch.