Passed
Push — master ( 2d425f...eb03d1 )
by Jan
04:57 queued 10s
created
src/Form/UserAdminForm.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 'attr' => [
95 95
                     'placeholder' => 'user.username.placeholder',
96 96
                 ],
97
-                'disabled' => ! $this->security->isGranted('edit_username', $entity),
97
+                'disabled' => !$this->security->isGranted('edit_username', $entity),
98 98
             ])
99 99
 
100 100
             ->add('group', StructuralEntityType::class, [
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 'required' => false,
103 103
                 'label' => 'group.label',
104 104
                 'disable_not_selectable' => true,
105
-                'disabled' => ! $this->security->isGranted('change_group', $entity),
105
+                'disabled' => !$this->security->isGranted('change_group', $entity),
106 106
             ])
107 107
 
108 108
             ->add('first_name', TextType::class, [
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     'placeholder' => 'user.firstName.placeholder',
113 113
                 ],
114 114
                 'required' => false,
115
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
115
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
116 116
             ])
117 117
 
118 118
             ->add('last_name', TextType::class, [
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     'placeholder' => 'user.lastName.placeholder',
123 123
                 ],
124 124
                 'required' => false,
125
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
125
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
126 126
             ])
127 127
 
128 128
             ->add('email', TextType::class, [
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                     'placeholder' => 'user.email.placeholder',
133 133
                 ],
134 134
                 'required' => false,
135
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
135
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
136 136
             ])
137 137
 
138 138
             ->add('department', TextType::class, [
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                     'placeholder' => 'user.department.placeholder',
143 143
                 ],
144 144
                 'required' => false,
145
-                'disabled' => ! $this->security->isGranted('edit_infos', $entity),
145
+                'disabled' => !$this->security->isGranted('edit_infos', $entity),
146 146
             ])
147 147
 
148 148
             //Config section
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 'placeholder' => 'user_settings.language.placeholder',
156 156
                 'label' => 'user.language_select',
157 157
                 'preferred_choices' => ['en', 'de'],
158
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
158
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
159 159
             ])
160 160
             ->add('timezone', TimezoneType::class, [
161 161
                 'required' => false,
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
                 'placeholder' => 'user_settings.timezone.placeholder',
167 167
                 'label' => 'user.timezone.label',
168 168
                 'preferred_choices' => ['Europe/Berlin'],
169
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
169
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
170 170
             ])
171 171
             ->add('theme', ChoiceType::class, [
172 172
                 'required' => false,
173 173
                 'choices' => User::AVAILABLE_THEMES,
174
-                'choice_label' => function ($entity, $key, $value) {
174
+                'choice_label' => function($entity, $key, $value) {
175 175
                     return $value;
176 176
                 },
177 177
                 'attr' => [
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
                 ],
180 180
                 'placeholder' => 'user_settings.theme.placeholder',
181 181
                 'label' => 'user.theme.label',
182
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
182
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
183 183
             ])
184 184
             ->add('currency', CurrencyEntityType::class, [
185 185
                 'required' => false,
186 186
                 'label' => 'user.currency.label',
187
-                'disabled' => ! $this->security->isGranted('change_user_settings', $entity),
187
+                'disabled' => !$this->security->isGranted('change_user_settings', $entity),
188 188
             ])
189 189
 
190 190
             ->add('new_password', RepeatedType::class, [
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                 'invalid_message' => 'password_must_match',
199 199
                 'required' => false,
200 200
                 'mapped' => false,
201
-                'disabled' => ! $this->security->isGranted('set_password', $entity),
201
+                'disabled' => !$this->security->isGranted('set_password', $entity),
202 202
                 'constraints' => [new Length([
203 203
                     'min' => 6,
204 204
                     'max' => 128,
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                     'class' => 'checkbox-custom',
212 212
                 ],
213 213
                 'label' => 'user.edit.needs_pw_change',
214
-                'disabled' => ! $this->security->isGranted('set_password', $entity),
214
+                'disabled' => !$this->security->isGranted('set_password', $entity),
215 215
             ])
216 216
 
217 217
             ->add('disabled', CheckboxType::class, [
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                     'class' => 'checkbox-custom',
221 221
                 ],
222 222
                 'label' => 'user.edit.user_disabled',
223
-                'disabled' => ! $this->security->isGranted('set_password', $entity)
223
+                'disabled' => !$this->security->isGranted('set_password', $entity)
224 224
                     || $entity === $this->security->getUser(),
225 225
             ])
226 226
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             ->add('permissions', PermissionsType::class, [
229 229
                 'mapped' => false,
230 230
                 'data' => $builder->getData(),
231
-                'disabled' => ! $this->security->isGranted('edit_permissions', $entity),
231
+                'disabled' => !$this->security->isGranted('edit_permissions', $entity),
232 232
             ])
233 233
         ;
234 234
         /*->add('comment', CKEditorType::class, ['required' => false,
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                 'data_class' => $options['attachment_class'],
248 248
             ],
249 249
             'by_reference' => false,
250
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
250
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
251 251
         ]);
252 252
 
253 253
         $builder->add('log_comment', TextType::class, [
Please login to merge, or discard this patch.
src/DataTables/LogDataTable.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         $dataTable->add('symbol', TextColumn::class, [
113 113
             'label' => '',
114
-            'render' => function ($value, AbstractLogEntry $context) {
114
+            'render' => function($value, AbstractLogEntry $context) {
115 115
                 switch ($context->getLevelString()) {
116 116
                     case LogLevel::DEBUG:
117 117
                         $symbol = 'fa-bug';
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         $dataTable->add('type', TextColumn::class, [
173 173
             'label' => $this->translator->trans('log.type'),
174 174
             'propertyPath' => 'type',
175
-            'render' => function (string $value, AbstractLogEntry $context) {
175
+            'render' => function(string $value, AbstractLogEntry $context) {
176 176
                 return $this->translator->trans('log.type.'.$value);
177 177
             },
178 178
         ]);
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
             'label' => $this->translator->trans('log.level'),
182 182
             'visible' => $options['mode'] === 'system_log',
183 183
             'propertyPath' => 'levelString',
184
-            'render' => function (string $value, AbstractLogEntry $context) {
184
+            'render' => function(string $value, AbstractLogEntry $context) {
185 185
                 return $value;
186 186
             },
187 187
         ]);
188 188
 
189 189
         $dataTable->add('user', TextColumn::class, [
190 190
             'label' => $this->translator->trans('log.user'),
191
-            'render' => function ($value, AbstractLogEntry $context) {
191
+            'render' => function($value, AbstractLogEntry $context) {
192 192
                 $user = $context->getUser();
193 193
 
194 194
                 return sprintf(
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $dataTable->add('target_type', TextColumn::class, [
203 203
             'label' => $this->translator->trans('log.target_type'),
204 204
             'visible' => false,
205
-            'render' => function ($value, AbstractLogEntry $context) {
205
+            'render' => function($value, AbstractLogEntry $context) {
206 206
                 $class = $context->getTargetClass();
207 207
                 if (null !== $class) {
208 208
                     return $this->elementTypeNameGenerator->getLocalizedTypeLabel($class);
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
             'label' => $this->translator->trans('log.extra'),
221 221
         ]);
222 222
 
223
-        $dataTable->add('timeTravel', IconLinkColumn::class,[
223
+        $dataTable->add('timeTravel', IconLinkColumn::class, [
224 224
             'label' => '',
225 225
             'icon' => 'fas fa-fw fa-eye',
226
-            'href' => function ($value, AbstractLogEntry $context) {
226
+            'href' => function($value, AbstractLogEntry $context) {
227 227
                 if (
228 228
                     ($context instanceof TimeTravelInterface
229 229
                         && $context->hasOldDataInformations())
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                 ) {
232 232
                     try {
233 233
                         $target = $this->logRepo->getTargetElement($context);
234
-                        if($target !== null) {
234
+                        if ($target !== null) {
235 235
                             $str = $this->entityURLGenerator->timeTravelURL($target, $context->getTimestamp());
236 236
                             return $str;
237 237
                         }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                 }
242 242
                 return null;
243 243
             },
244
-            'disabled' => function ($value, AbstractLogEntry $context) {
244
+            'disabled' => function($value, AbstractLogEntry $context) {
245 245
                 return
246 246
                     !$this->security->isGranted('@tools.timetravel')
247 247
                     || !$this->security->isGranted('show_history', $context->getTargetClass());
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
         $dataTable->createAdapter(ORMAdapter::class, [
259 259
             'entity' => AbstractLogEntry::class,
260
-            'query' => function (QueryBuilder $builder) use ($options): void {
260
+            'query' => function(QueryBuilder $builder) use ($options): void {
261 261
                 $this->getQuery($builder, $options);
262 262
             },
263 263
         ]);
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
             ->leftJoin('log.user', 'user');
272 272
 
273 273
         if ($options['mode'] === 'last_activity') {
274
-            $builder->where('log INSTANCE OF ' . ElementCreatedLogEntry::class)
275
-                ->orWhere('log INSTANCE OF ' . ElementDeletedLogEntry::class)
276
-                ->orWhere('log INSTANCE OF ' . ElementEditedLogEntry::class)
277
-                ->orWhere('log INSTANCE OF ' . CollectionElementDeleted::class)
278
-                ->andWhere('log.target_type NOT IN (:disallowed)');;
274
+            $builder->where('log INSTANCE OF '.ElementCreatedLogEntry::class)
275
+                ->orWhere('log INSTANCE OF '.ElementDeletedLogEntry::class)
276
+                ->orWhere('log INSTANCE OF '.ElementEditedLogEntry::class)
277
+                ->orWhere('log INSTANCE OF '.CollectionElementDeleted::class)
278
+                ->andWhere('log.target_type NOT IN (:disallowed)'); ;
279 279
 
280 280
             $builder->setParameter('disallowed', [
281 281
                 AbstractLogEntry::targetTypeClassToID(User::class),
Please login to merge, or discard this patch.
src/Repository/LogEntryRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $qb = $this->createQueryBuilder('log');
95 95
         $qb->select('log')
96 96
             //->where('log INSTANCE OF App\Entity\LogSystem\ElementEditedLogEntry')
97
-            ->where('log INSTANCE OF ' . ElementDeletedLogEntry::class)
97
+            ->where('log INSTANCE OF '.ElementDeletedLogEntry::class)
98 98
             ->andWhere('log.target_type = :target_type')
99 99
             ->andWhere('log.target_id = :target_id')
100 100
             ->orderBy('log.timestamp', 'DESC')
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                                'target_id' => $id,
106 106
                            ]);
107 107
 
108
-        $query =  $qb->getQuery();
108
+        $query = $qb->getQuery();
109 109
 
110 110
         $results = $query->execute();
111 111
 
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
         $qb = $this->createQueryBuilder('log');
127 127
         $qb->select('log')
128 128
             //->where('log INSTANCE OF App\Entity\LogSystem\ElementEditedLogEntry')
129
-            ->where('log INSTANCE OF ' . ElementEditedLogEntry::class)
130
-            ->orWhere('log INSTANCE OF ' . CollectionElementDeleted::class)
129
+            ->where('log INSTANCE OF '.ElementEditedLogEntry::class)
130
+            ->orWhere('log INSTANCE OF '.CollectionElementDeleted::class)
131 131
             ->andWhere('log.target_type = :target_type')
132 132
             ->andWhere('log.target_id = :target_id')
133 133
             ->andWhere('log.timestamp >= :until')
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $qb = $this->createQueryBuilder('log');
155 155
         $qb->select('count(log)')
156
-            ->where('log INSTANCE OF ' . ElementCreatedLogEntry::class)
156
+            ->where('log INSTANCE OF '.ElementCreatedLogEntry::class)
157 157
             ->andWhere('log.target_type = :target_type')
158 158
             ->andWhere('log.target_id = :target_id')
159 159
             ->andWhere('log.timestamp >= :until')
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $qb = $this->createQueryBuilder('log');
212 212
         $qb->select('log')
213 213
             //->where('log INSTANCE OF App\Entity\LogSystem\ElementEditedLogEntry')
214
-            ->where('log INSTANCE OF ' . $class)
214
+            ->where('log INSTANCE OF '.$class)
215 215
             ->andWhere('log.target_type = :target_type')
216 216
             ->andWhere('log.target_id = :target_id')
217 217
             ->orderBy('log.timestamp', 'DESC');
Please login to merge, or discard this patch.
src/EventSubscriber/EventLoggerSubscriber.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 
130 130
                 $log->setUndoneEvent($undoEvent, $this->eventUndoHelper->getMode());
131 131
 
132
-                if($undoEvent instanceof ElementDeletedLogEntry && $undoEvent->getTargetClass() === $log->getTargetClass()) {
132
+                if ($undoEvent instanceof ElementDeletedLogEntry && $undoEvent->getTargetClass() === $log->getTargetClass()) {
133 133
                     $log->setTargetElementID($undoEvent->getTargetID());
134 134
                 }
135
-                if($undoEvent instanceof CollectionElementDeleted && $undoEvent->getDeletedElementClass() === $log->getTargetClass()) {
135
+                if ($undoEvent instanceof CollectionElementDeleted && $undoEvent->getDeletedElementClass() === $log->getTargetClass()) {
136 136
                     $log->setTargetElementID($undoEvent->getDeletedElementID());
137 137
                 }
138 138
             }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
             return $fields;
247 247
         }
248 248
 
249
-        return array_filter($fields, function ($value, $key) use ($element) {
249
+        return array_filter($fields, function($value, $key) use ($element) {
250 250
             //Associative array (save changed data) case
251 251
             if (is_string($key)) {
252 252
                 return $this->shouldFieldBeSaved($element, $key);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         $old_data = $this->filterFieldRestrictions($entity, $old_data);
292 292
 
293 293
         //Restrict length of string fields, to save memory...
294
-        $old_data = array_map(function ($value) {
294
+        $old_data = array_map(function($value) {
295 295
             if (is_string($value)) {
296 296
                 return mb_strimwidth($value, 0, self::MAX_STRING_LENGTH, '...');
297 297
             }
Please login to merge, or discard this patch.
src/Controller/AdminPages/BaseAdminController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             $this->timeTravel->revertEntityToTimestamp($entity, $timeTravel_timestamp);
132 132
         }
133 133
 
134
-        if ($this->isGranted('show_history', $entity) ) {
134
+        if ($this->isGranted('show_history', $entity)) {
135 135
             $table = $this->dataTableFactory->createFromType(
136 136
                 LogDataTable::class,
137 137
                 [
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $form->handleRequest($request);
158 158
         if ($form->isSubmitted() && $form->isValid()) {
159 159
             //Check if we editing a user and if we need to change the password of it
160
-            if ($entity instanceof User && ! empty($form['new_password']->getData())) {
160
+            if ($entity instanceof User && !empty($form['new_password']->getData())) {
161 161
                 $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
162 162
                 $entity->setPassword($password);
163 163
                 //By default the user must change the password afterwards
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             //Rebuild form, so it is based on the updated data. Important for the parent field!
193 193
             //We can not use dynamic form events here, because the parent entity list is build from database!
194 194
             $form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]);
195
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
195
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
196 196
             $this->addFlash('error', 'entity.edit_flash.invalid');
197 197
         }
198 198
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $form->handleRequest($request);
220 220
 
221 221
         if ($form->isSubmitted() && $form->isValid()) {
222
-            if ($new_entity instanceof User && ! empty($form['new_password']->getData())) {
222
+            if ($new_entity instanceof User && !empty($form['new_password']->getData())) {
223 223
                 $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData());
224 224
                 $new_entity->setPassword($password);
225 225
                 //By default the user must change the password afterwards
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
255 255
         }
256 256
 
257
-        if ($form->isSubmitted() && ! $form->isValid()) {
257
+        if ($form->isSubmitted() && !$form->isValid()) {
258 258
             $this->addFlash('error', 'entity.created_flash.invalid');
259 259
         }
260 260
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 'csv_separator' => $data['csv_separator'],
275 275
             ];
276 276
 
277
-            $this->commentHelper->setMessage('Import ' . $file->getClientOriginalName());
277
+            $this->commentHelper->setMessage('Import '.$file->getClientOriginalName());
278 278
 
279 279
 
280 280
 
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
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             $timeTravel->revertEntityToTimestamp($part, $timeTravel_timestamp);
111 111
         }
112 112
 
113
-        if ($this->isGranted('show_history', $part) ) {
113
+        if ($this->isGranted('show_history', $part)) {
114 114
             $table = $dataTable->createFromType(LogDataTable::class, [
115 115
                 'filter_elements' => $historyHelper->getAssociatedElements($part),
116 116
                 'mode' => 'element_history'
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $this->addFlash('info', 'part.edited_flash');
183 183
             //Reload form, so the SIUnitType entries use the new part unit
184 184
             $form = $this->createForm(PartBaseType::class, $part);
185
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
185
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
186 186
             $this->addFlash('error', 'part.edited_flash.invalid');
187 187
         }
188 188
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
280 280
         }
281 281
 
282
-        if ($form->isSubmitted() && ! $form->isValid()) {
282
+        if ($form->isSubmitted() && !$form->isValid()) {
283 283
             $this->addFlash('error', 'part.created_flash.invalid');
284 284
         }
285 285
 
Please login to merge, or discard this patch.
src/Services/LogSystem/LogEntryExtraFormatter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         foreach ($arr as $key => $value) {
91 91
             $str = '';
92 92
             if (is_string($key)) {
93
-                $str .= '<error>' . $this->translator->trans($key) . '</error>: ';
93
+                $str .= '<error>'.$this->translator->trans($key).'</error>: ';
94 94
             }
95 95
             $str .= $value;
96 96
             if (!empty($str)) {
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 '%s <i class="fas fa-long-arrow-alt-right"></i> %s (%s)',
164 164
                 $context->getOldInstock(),
165 165
                 $context->getNewInstock(),
166
-                (! $context->isWithdrawal() ? '+' : '-').$context->getDifference(true)
166
+                (!$context->isWithdrawal() ? '+' : '-').$context->getDifference(true)
167 167
             );
168 168
             $array['log.instock_changed.comment'] = htmlspecialchars($context->getComment());
169 169
         }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         foreach ($arr as $key => $value) {
199 199
             $str = '';
200 200
             if (is_string($key)) {
201
-                $str .= '<b>' . $this->translator->trans($key) . '</b>: ';
201
+                $str .= '<b>'.$this->translator->trans($key).'</b>: ';
202 202
             }
203 203
             $str .= $value;
204 204
             if (!empty($str)) {
Please login to merge, or discard this patch.
src/Services/LogSystem/TimeTravel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         $this->setField($element, 'id', $id);
62 62
 
63 63
         //Let database determine when it will be created
64
-        $this->setField($element,'addedDate', null);
64
+        $this->setField($element, 'addedDate', null);
65 65
 
66 66
         return $element;
67 67
     }
Please login to merge, or discard this patch.