@@ -94,7 +94,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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, [ |
@@ -111,7 +111,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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), |
@@ -94,7 +94,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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'); |
@@ -129,10 +129,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -90,7 +90,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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)) { |
@@ -61,7 +61,7 @@ |
||
| 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 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $optionsResolver->setAllowedTypes('search', ['null', 'string']); |
| 114 | 114 | |
| 115 | 115 | //Configure search options |
| 116 | - $optionsResolver->setDefault('search_options', function (OptionsResolver $resolver) { |
|
| 116 | + $optionsResolver->setDefault('search_options', function(OptionsResolver $resolver) { |
|
| 117 | 117 | $resolver->setDefaults([ |
| 118 | 118 | 'name' => true, |
| 119 | 119 | 'category' => true, |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $dataTable |
| 150 | 150 | ->add('picture', TextColumn::class, [ |
| 151 | 151 | 'label' => '', |
| 152 | - 'render' => function ($value, Part $context) { |
|
| 152 | + 'render' => function($value, Part $context) { |
|
| 153 | 153 | $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context); |
| 154 | 154 | if (null === $preview_attachment) { |
| 155 | 155 | return ''; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | ]) |
| 167 | 167 | ->add('name', TextColumn::class, [ |
| 168 | 168 | 'label' => $this->translator->trans('part.table.name'), |
| 169 | - 'render' => function ($value, Part $context) { |
|
| 169 | + 'render' => function($value, Part $context) { |
|
| 170 | 170 | return sprintf( |
| 171 | 171 | '<a href="%s">%s</a>', |
| 172 | 172 | $this->urlGenerator->infoURL($context), |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | ]) |
| 196 | 196 | ->add('storelocation', TextColumn::class, [ |
| 197 | 197 | 'label' => $this->translator->trans('part.table.storeLocations'), |
| 198 | - 'render' => function ($value, Part $context) { |
|
| 198 | + 'render' => function($value, Part $context) { |
|
| 199 | 199 | $tmp = []; |
| 200 | 200 | foreach ($context->getPartLots() as $lot) { |
| 201 | 201 | //Ignore lots without storelocation |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | ]) |
| 215 | 215 | ->add('amount', TextColumn::class, [ |
| 216 | 216 | 'label' => $this->translator->trans('part.table.amount'), |
| 217 | - 'render' => function ($value, Part $context) { |
|
| 217 | + 'render' => function($value, Part $context) { |
|
| 218 | 218 | $amount = $context->getAmountSum(); |
| 219 | 219 | |
| 220 | 220 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | ->add('minamount', TextColumn::class, [ |
| 224 | 224 | 'label' => $this->translator->trans('part.table.minamount'), |
| 225 | 225 | 'visible' => false, |
| 226 | - 'render' => function ($value, Part $context) { |
|
| 226 | + 'render' => function($value, Part $context) { |
|
| 227 | 227 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
| 228 | 228 | }, |
| 229 | 229 | ]) |
@@ -287,12 +287,12 @@ discard block |
||
| 287 | 287 | ->addOrderBy('name') |
| 288 | 288 | ->createAdapter(FetchJoinORMAdapter::class, [ |
| 289 | 289 | 'simple_total_query' => true, |
| 290 | - 'query' => function (QueryBuilder $builder): void { |
|
| 290 | + 'query' => function(QueryBuilder $builder): void { |
|
| 291 | 291 | $this->getQuery($builder); |
| 292 | 292 | }, |
| 293 | 293 | 'entity' => Part::class, |
| 294 | 294 | 'criteria' => [ |
| 295 | - function (QueryBuilder $builder) use ($options): void { |
|
| 295 | + function(QueryBuilder $builder) use ($options): void { |
|
| 296 | 296 | $this->buildCriteria($builder, $options); |
| 297 | 297 | }, |
| 298 | 298 | new SearchCriteriaProvider(), |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | public function getAmount(): float |
| 295 | 295 | { |
| 296 | - if ($this->part instanceof Part && ! $this->part->useFloatAmount()) { |
|
| 296 | + if ($this->part instanceof Part && !$this->part->useFloatAmount()) { |
|
| 297 | 297 | return round($this->amount); |
| 298 | 298 | } |
| 299 | 299 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | public function __clone() |
| 330 | 330 | { |
| 331 | - if($this->id) { |
|
| 331 | + if ($this->id) { |
|
| 332 | 332 | $this->addedDate = null; |
| 333 | 333 | } |
| 334 | 334 | parent::__clone(); |