Passed
Push — master ( 0663a0...89258b )
by Jan
04:32
created
src/DataTables/AttachmentDataTable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $dataTable->add('picture', TextColumn::class, [
84 84
             'label' => '',
85
-            'render' => function ($value, Attachment $context) {
85
+            'render' => function($value, Attachment $context) {
86 86
                 if ($context->isPicture()
87 87
                     && !$context->isExternal()
88 88
                     && $this->attachmentHelper->isFileExisting($context)) {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         $dataTable->add('name', TextColumn::class, [
102 102
             'label' => $this->translator->trans('attachment.edit.name'),
103
-            'render' => function ($value, Attachment $context) {
103
+            'render' => function($value, Attachment $context) {
104 104
                 //Link to external source
105 105
                 if ($context->isExternal()) {
106 106
                     return sprintf(
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
         $dataTable->add('attachment_type', TextColumn::class, [
126 126
             'field' => 'attachment_type.name',
127
-            'render' => function ($value, Attachment $context) {
127
+            'render' => function($value, Attachment $context) {
128 128
                 return sprintf(
129 129
                     '<a href="%s">%s</a>',
130 130
                     $this->entityURLGenerator->editURL($context->getAttachmentType()),
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $dataTable->add('element', TextColumn::class, [
137 137
             'label' => $this->translator->trans('attachment.table.element'),
138 138
             //'propertyPath' => 'element.name',
139
-            'render' => function ($value, Attachment $context) {
139
+            'render' => function($value, Attachment $context) {
140 140
                 return sprintf(
141 141
                     '<a href="%s">%s</a>',
142 142
                     $this->entityURLGenerator->infoURL($context->getElement()),
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
         ]);
151 151
 
152 152
         $dataTable->add('filesize', TextColumn::class, [
153
-            'render' => function ($value, Attachment $context) {
153
+            'render' => function($value, Attachment $context) {
154 154
                 if ($this->attachmentHelper->isFileExisting($context)) {
155 155
                     return $this->attachmentHelper->getHumanFileSize($context);
156 156
                 }
157 157
                 if ($context->isExternal()) {
158
-                    return '<i>' . $this->translator->trans('attachment.external') . '</i>';
158
+                    return '<i>'.$this->translator->trans('attachment.external').'</i>';
159 159
                 }
160 160
 
161 161
                 return sprintf(
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
         $dataTable->createAdapter(ORMAdapter::class, [
216 216
             'entity' => Attachment::class,
217
-            'query' => function (QueryBuilder $builder) {
217
+            'query' => function(QueryBuilder $builder) {
218 218
                 $this->getQuery($builder);
219 219
             },
220 220
         ]);
Please login to merge, or discard this patch.
src/Services/ElementTypeNameGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,8 +125,8 @@
 block discarded – undo
125 125
     {
126 126
         $type = $this->getLocalizedTypeLabel($entity);
127 127
         if ($use_html) {
128
-            return '<i>' . $type . ':</i> ' . $entity->getName();
128
+            return '<i>'.$type.':</i> '.$entity->getName();
129 129
         }
130
-        return $type . ": " . htmlspecialchars($entity->getName());
130
+        return $type.": ".htmlspecialchars($entity->getName());
131 131
     }
132 132
 }
133 133
\ No newline at end of file
Please login to merge, or discard this patch.
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/Controller/PartController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                 } catch (AttachmentDownloadException $ex) {
105 105
                     $this->addFlash(
106 106
                         'error',
107
-                        $translator->trans('attachment.download_failed') . ' ' . $ex->getMessage()
107
+                        $translator->trans('attachment.download_failed').' '.$ex->getMessage()
108 108
                     );
109 109
                 }
110 110
             }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             $this->addFlash('info', $translator->trans('part.edited_flash'));
116 116
             //Reload form, so the SIUnitType entries use the new part unit
117 117
             $form = $this->createForm(PartBaseType::class, $part);
118
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
118
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
119 119
             $this->addFlash('error', $translator->trans('part.edited_flash.invalid'));
120 120
         }
121 121
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     {
138 138
         $this->denyAccessUnlessGranted('delete', $part);
139 139
 
140
-        if ($this->isCsrfTokenValid('delete' . $part->getId(), $request->request->get('_token'))) {
140
+        if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) {
141 141
             $entityManager = $this->getDoctrine()->getManager();
142 142
 
143 143
             //Remove part
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                 } catch (AttachmentDownloadException $ex) {
191 191
                     $this->addFlash(
192 192
                         'error',
193
-                        $translator->trans('attachment.download_failed') . ' ' . $ex->getMessage()
193
+                        $translator->trans('attachment.download_failed').' '.$ex->getMessage()
194 194
                     );
195 195
                 }
196 196
             }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
203 203
         }
204 204
 
205
-        if ($form->isSubmitted() && ! $form->isValid()) {
205
+        if ($form->isSubmitted() && !$form->isValid()) {
206 206
             $this->addFlash('error', $translator->trans('part.created_flash.invalid'));
207 207
         }
208 208
 
Please login to merge, or discard this patch.
src/Form/AttachmentFormType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
         //Check the secure file checkbox, if file is in securefile location
130 130
         $builder->get('secureFile')->addEventListener(
131 131
             FormEvents::PRE_SET_DATA,
132
-            function (FormEvent $event) {
132
+            function(FormEvent $event) {
133 133
                 $attachment = $event->getForm()->getParent()->getData();
134 134
                 if ($attachment instanceof Attachment) {
135 135
                     $event->setData($attachment->isSecure());
Please login to merge, or discard this patch.