Completed
Push — master ( 1f7c12...27a001 )
by Jan
04:25
created
src/Command/ConvertBBCodeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                 ->select('e');
130 130
             //Add fields criteria
131 131
             foreach ($properties as $key => $property) {
132
-                $qb->orWhere('e.' . $property . ' LIKE ?' . $key);
132
+                $qb->orWhere('e.'.$property.' LIKE ?'.$key);
133 133
                 $qb->setParameter($key, static::BBCODE_CRITERIA);
134 134
             }
135 135
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             foreach ($results as $result) {
142 142
                 /** @var NamedDBElement $result */
143 143
                 $io->writeln(
144
-                    'Convert entity: ' . $result->getName() . ' (' . $result->getIDString() . ')',
144
+                    'Convert entity: '.$result->getName().' ('.$result->getIDString().')',
145 145
                     OutputInterface::VERBOSITY_VERBOSE
146 146
                 );
147 147
                 foreach ($properties as $property) {
Please login to merge, or discard this patch.
src/Services/GitVersionInfo.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function getGitBranchName()
51 51
     {
52
-        if (file_exists($this->project_dir . '/.git/HEAD')) {
53
-            $git = file($this->project_dir . '/.git/HEAD');
52
+        if (file_exists($this->project_dir.'/.git/HEAD')) {
53
+            $git = file($this->project_dir.'/.git/HEAD');
54 54
             $head = explode('/', $git[0], 3);
55 55
             return trim($head[2]);
56 56
         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function getGitCommitHash(int $length = 7)
67 67
     {
68
-        $filename = $this->project_dir . '/.git/refs/remotes/origin/' . $this->getGitBranchName();
68
+        $filename = $this->project_dir.'/.git/refs/remotes/origin/'.$this->getGitBranchName();
69 69
         if (file_exists($filename)) {
70 70
             $head = file($filename);
71 71
             $hash = $head[0];
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
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         }
143 143
 
144 144
         //Show permissions to user
145
-        $builder = $this->createFormBuilder()->add('permissions',PermissionsType::class, [
145
+        $builder = $this->createFormBuilder()->add('permissions', PermissionsType::class, [
146 146
             'mapped' => false,
147 147
             'disabled' => true,
148 148
             'inherit' => true,
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
         $page_need_reload = false;
170 170
 
171
-        if(!$user instanceof User) {
171
+        if (!$user instanceof User) {
172 172
             return new \RuntimeException("This controller only works only for Part-DB User objects!");
173 173
         }
174 174
 
Please login to merge, or discard this patch.
src/Form/UserSettingsType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
                 'required' => false,
78 78
                 'attr' => ['class' => 'selectpicker'],
79 79
                 'choices' => User::AVAILABLE_THEMES,
80
-                'choice_label' => function ($entity, $key, $value) {
80
+                'choice_label' => function($entity, $key, $value) {
81 81
                     return $value;
82 82
                 },
83 83
                 'placeholder' => $this->trans->trans('user_settings.theme.placeholder'),
Please login to merge, or discard this patch.
src/Form/UserAdminForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
             ->add('theme', ChoiceType::class, [
150 150
                 'required' => false,
151 151
                 'choices' => User::AVAILABLE_THEMES,
152
-                'choice_label' => function ($entity, $key, $value) {
152
+                'choice_label' => function($entity, $key, $value) {
153 153
                     return $value;
154 154
                 },
155 155
                 'attr' => ['class' => 'selectpicker'],
Please login to merge, or discard this patch.
src/Services/Attachments/AttachmentSubmitHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             $attachment->getName()
122 122
         );
123 123
 
124
-        return $safeName . '-' . uniqid('', false) . '.' . $extension;
124
+        return $safeName.'-'.uniqid('', false).'.'.$extension;
125 125
     }
126 126
 
127 127
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         //Ensure the given attachment class is known to mapping
142 142
         if (!isset($this->folder_mapping[get_class($attachment)])) {
143 143
             throw new \InvalidArgumentException(
144
-                'The given attachment class is not known! The passed class was: ' . get_class($attachment)
144
+                'The given attachment class is not known! The passed class was: '.get_class($attachment)
145 145
             );
146 146
         }
147 147
         //Ensure the attachment has an assigned element
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
 
154 154
         //Build path
155 155
         return
156
-            $base_path . DIRECTORY_SEPARATOR //Base path
157
-            . $this->folder_mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID();
156
+            $base_path.DIRECTORY_SEPARATOR //Base path
157
+            . $this->folder_mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID();
158 158
     }
159 159
 
160 160
     /**
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
         $fs = new Filesystem();
211 211
         $attachment_folder = $this->generateAttachmentPath($attachment, $options['secure_attachment']);
212
-        $tmp_path = $attachment_folder . DIRECTORY_SEPARATOR . $this->generateAttachmentFilename($attachment, 'tmp');
212
+        $tmp_path = $attachment_folder.DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, 'tmp');
213 213
 
214 214
         try {
215 215
             $response = $this->httpClient->request('GET', $url, [
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             ]);
218 218
 
219 219
             if (200 !== $response->getStatusCode()) {
220
-                throw new AttachmentDownloadException('Statuscode:' . $response->getStatusCode());
220
+                throw new AttachmentDownloadException('Statuscode:'.$response->getStatusCode());
221 221
             }
222 222
 
223 223
             //Open a temporary file in the attachment folder
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
             }
259 259
 
260 260
             //Rename the file to its new name and save path to attachment entity
261
-            $new_path = $attachment_folder . DIRECTORY_SEPARATOR . $this->generateAttachmentFilename($attachment, $new_ext);
261
+            $new_path = $attachment_folder.DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, $new_ext);
262 262
             $fs->rename($tmp_path, $new_path);
263 263
 
264 264
             //Make our file path relative to %BASE%
Please login to merge, or discard this patch.
src/Services/AttachmentHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
 
166 166
         $sz = 'BKMGTP';
167 167
         $factor = (int) floor((strlen($bytes) - 1) / 3);
168
-        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor];
168
+        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor];
169 169
     }
170 170
 
171 171
 
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
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             //Rebuild form, so it is based on the updated data. Important for the parent field!
120 120
             //We can not use dynamic form events here, because the parent entity list is build from database!
121 121
             $form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]);
122
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
122
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
123 123
             $this->addFlash('error', $this->translator->trans('entity.edit_flash.invalid'));
124 124
         }
125 125
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
             $em->flush();
162 162
             $this->addFlash('success', $this->translator->trans('entity.created_flash'));
163 163
 
164
-            return $this->redirectToRoute($this->route_base . '_edit', ['id' => $new_entity->getID()]);
164
+            return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
165 165
         }
166 166
 
167
-        if ($form->isSubmitted() && ! $form->isValid()) {
167
+        if ($form->isSubmitted() && !$form->isValid()) {
168 168
             $this->addFlash('error', $this->translator->trans('entity.created_flash.invalid'));
169 169
         }
170 170
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
             foreach ($errors as $name => $error) {
186 186
                 /** @var $error ConstraintViolationList */
187
-                $this->addFlash('error', $name . ':' . $error);
187
+                $this->addFlash('error', $name.':'.$error);
188 188
             }
189 189
         }
190 190
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             //Show errors to user:
204 204
             foreach ($errors as $name => $error) {
205 205
                 /** @var $error ConstraintViolationList */
206
-                $this->addFlash('error', $name . ':' . $error);
206
+                $this->addFlash('error', $name.':'.$error);
207 207
             }
208 208
         }
209 209
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             $this->addFlash('success', 'attachment_type.deleted');
248 248
         }
249 249
 
250
-        return $this->redirectToRoute($this->route_base .  '_new');
250
+        return $this->redirectToRoute($this->route_base.'_new');
251 251
     }
252 252
 
253 253
     protected function _exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request)
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
         $entities = $em->getRepository($this->entity_class)->findAll();
260 260
 
261
-        return $exporter->exportEntityFromRequest($entities,$request);
261
+        return $exporter->exportEntityFromRequest($entities, $request);
262 262
     }
263 263
 
264 264
     protected function _exportEntity(NamedDBElement $entity, EntityExporter $exporter, Request $request)
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $this->addFlash('info', $translator->trans('part.edited_flash'));
104 104
             //Reload form, so the SIUnitType entries use the new part unit
105 105
             $form = $this->createForm(PartBaseType::class, $part);
106
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
106
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
107 107
             $this->addFlash('error', $translator->trans('part.edited_flash.invalid'));
108 108
         }
109 109
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $this->denyAccessUnlessGranted('delete', $part);
127 127
 
128
-        if ($this->isCsrfTokenValid('delete' . $part->getId(), $request->request->get('_token'))) {
128
+        if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) {
129 129
             $entityManager = $this->getDoctrine()->getManager();
130 130
 
131 131
             //Remove part
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
180 180
         }
181 181
 
182
-        if ($form->isSubmitted() && ! $form->isValid()) {
182
+        if ($form->isSubmitted() && !$form->isValid()) {
183 183
             $this->addFlash('error', $translator->trans('part.created_flash.invalid'));
184 184
         }
185 185
 
Please login to merge, or discard this patch.