@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $optionsResolver->setAllowedTypes('mode', 'string'); |
| 91 | 91 | $optionsResolver->setAllowedTypes('filter', ['null', LogFilter::class]); |
| 92 | 92 | |
| 93 | - $optionsResolver->setNormalizer('filter_elements', static function (Options $options, $value) { |
|
| 93 | + $optionsResolver->setNormalizer('filter_elements', static function(Options $options, $value) { |
|
| 94 | 94 | if (!is_array($value)) { |
| 95 | 95 | return [$value]; |
| 96 | 96 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | //This special $$rowClass column is used to set the row class depending on the log level. The class gets set by the frontend controller |
| 111 | 111 | $dataTable->add('dont_matter', RowClassColumn::class, [ |
| 112 | - 'render' => static function ($value, AbstractLogEntry $context) { |
|
| 112 | + 'render' => static function($value, AbstractLogEntry $context) { |
|
| 113 | 113 | switch ($context->getLevel()) { |
| 114 | 114 | case AbstractLogEntry::LEVEL_EMERGENCY: |
| 115 | 115 | case AbstractLogEntry::LEVEL_ALERT: |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $dataTable->add('symbol', TextColumn::class, [ |
| 130 | 130 | 'label' => '', |
| 131 | 131 | 'className' => 'no-colvis', |
| 132 | - 'render' => static function ($value, AbstractLogEntry $context) { |
|
| 132 | + 'render' => static function($value, AbstractLogEntry $context) { |
|
| 133 | 133 | switch ($context->getLevelString()) { |
| 134 | 134 | case LogLevel::DEBUG: |
| 135 | 135 | $symbol = 'fa-bug'; |
@@ -190,13 +190,13 @@ discard block |
||
| 190 | 190 | $dataTable->add('type', TextColumn::class, [ |
| 191 | 191 | 'label' => $this->translator->trans('log.type'), |
| 192 | 192 | 'propertyPath' => 'type', |
| 193 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
| 193 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
| 194 | 194 | $text = $this->translator->trans('log.type.'.$value); |
| 195 | 195 | |
| 196 | 196 | if ($context instanceof PartStockChangedLogEntry) { |
| 197 | 197 | $text .= sprintf( |
| 198 | 198 | ' (<i>%s</i>)', |
| 199 | - $this->translator->trans('log.part_stock_changed.' . $context->getInstockChangeType()) |
|
| 199 | + $this->translator->trans('log.part_stock_changed.'.$context->getInstockChangeType()) |
|
| 200 | 200 | ); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -208,14 +208,14 @@ discard block |
||
| 208 | 208 | 'label' => $this->translator->trans('log.level'), |
| 209 | 209 | 'visible' => 'system_log' === $options['mode'], |
| 210 | 210 | 'propertyPath' => 'levelString', |
| 211 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
| 211 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
| 212 | 212 | return $this->translator->trans('log.level.'.$value); |
| 213 | 213 | }, |
| 214 | 214 | ]); |
| 215 | 215 | |
| 216 | 216 | $dataTable->add('user', TextColumn::class, [ |
| 217 | 217 | 'label' => $this->translator->trans('log.user'), |
| 218 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 218 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 219 | 219 | $user = $context->getUser(); |
| 220 | 220 | |
| 221 | 221 | //If user was deleted, show the info from the username field |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $dataTable->add('target_type', TextColumn::class, [ |
| 239 | 239 | 'label' => $this->translator->trans('log.target_type'), |
| 240 | 240 | 'visible' => false, |
| 241 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 241 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 242 | 242 | $class = $context->getTargetClass(); |
| 243 | 243 | if (null !== $class) { |
| 244 | 244 | return $this->elementTypeNameGenerator->getLocalizedTypeLabel($class); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $dataTable->add('timeTravel', IconLinkColumn::class, [ |
| 261 | 261 | 'label' => '', |
| 262 | 262 | 'icon' => 'fas fa-fw fa-eye', |
| 263 | - 'href' => function ($value, AbstractLogEntry $context) { |
|
| 263 | + 'href' => function($value, AbstractLogEntry $context) { |
|
| 264 | 264 | if ( |
| 265 | 265 | ($context instanceof TimeTravelInterface |
| 266 | 266 | && $context->hasOldDataInformations()) |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | return null; |
| 280 | 280 | }, |
| 281 | - 'disabled' => function ($value, AbstractLogEntry $context) { |
|
| 281 | + 'disabled' => function($value, AbstractLogEntry $context) { |
|
| 282 | 282 | return !$this->security->isGranted('show_history', $context->getTargetClass()); |
| 283 | 283 | }, |
| 284 | 284 | ]); |
@@ -291,11 +291,11 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 293 | 293 | 'entity' => AbstractLogEntry::class, |
| 294 | - 'query' => function (QueryBuilder $builder) use ($options): void { |
|
| 294 | + 'query' => function(QueryBuilder $builder) use ($options): void { |
|
| 295 | 295 | $this->getQuery($builder, $options); |
| 296 | 296 | }, |
| 297 | 297 | 'criteria' => [ |
| 298 | - function (QueryBuilder $builder) use ($options): void { |
|
| 298 | + function(QueryBuilder $builder) use ($options): void { |
|
| 299 | 299 | $this->buildCriteria($builder, $options); |
| 300 | 300 | }, |
| 301 | 301 | new SearchCriteriaProvider(), |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | private $urlGenerator; |
| 76 | 76 | |
| 77 | 77 | public function __construct(EntityURLGenerator $urlGenerator, TranslatorInterface $translator, |
| 78 | - NodesListBuilder $treeBuilder, AmountFormatter $amountFormatter,PartDataTableHelper $partDataTableHelper, |
|
| 78 | + NodesListBuilder $treeBuilder, AmountFormatter $amountFormatter, PartDataTableHelper $partDataTableHelper, |
|
| 79 | 79 | AttachmentURLGenerator $attachmentURLGenerator, Security $security) |
| 80 | 80 | { |
| 81 | 81 | $this->urlGenerator = $urlGenerator; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $dataTable |
| 108 | 108 | //Color the table rows depending on the review and favorite status |
| 109 | 109 | ->add('dont_matter', RowClassColumn::class, [ |
| 110 | - 'render' => function ($value, Part $context) { |
|
| 110 | + 'render' => function($value, Part $context) { |
|
| 111 | 111 | if ($context->isNeedsReview()) { |
| 112 | 112 | return 'table-secondary'; |
| 113 | 113 | } |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | ->add('picture', TextColumn::class, [ |
| 124 | 124 | 'label' => '', |
| 125 | 125 | 'className' => 'no-colvis', |
| 126 | - 'render' => function ($value, Part $context) { |
|
| 126 | + 'render' => function($value, Part $context) { |
|
| 127 | 127 | return $this->partDataTableHelper->renderPicture($context); |
| 128 | 128 | }, |
| 129 | 129 | ]) |
| 130 | 130 | ->add('name', TextColumn::class, [ |
| 131 | 131 | 'label' => $this->translator->trans('part.table.name'), |
| 132 | - 'render' => function ($value, Part $context) { |
|
| 132 | + 'render' => function($value, Part $context) { |
|
| 133 | 133 | return $this->partDataTableHelper->renderName($context); |
| 134 | 134 | }, |
| 135 | 135 | ]) |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | if ($this->security->isGranted('@storelocations.read')) { |
| 168 | 168 | $dataTable->add('storelocation', TextColumn::class, [ |
| 169 | 169 | 'label' => $this->translator->trans('part.table.storeLocations'), |
| 170 | - 'render' => function ($value, Part $context) { |
|
| 170 | + 'render' => function($value, Part $context) { |
|
| 171 | 171 | $tmp = []; |
| 172 | 172 | foreach ($context->getPartLots() as $lot) { |
| 173 | 173 | //Ignore lots without storelocation |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $dataTable->add('amount', TextColumn::class, [ |
| 190 | 190 | 'label' => $this->translator->trans('part.table.amount'), |
| 191 | - 'render' => function ($value, Part $context) { |
|
| 191 | + 'render' => function($value, Part $context) { |
|
| 192 | 192 | $amount = $context->getAmountSum(); |
| 193 | 193 | $expiredAmount = $context->getExpiredAmountSum(); |
| 194 | 194 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | ->add('minamount', TextColumn::class, [ |
| 210 | 210 | 'label' => $this->translator->trans('part.table.minamount'), |
| 211 | 211 | 'visible' => false, |
| 212 | - 'render' => function ($value, Part $context) { |
|
| 212 | + 'render' => function($value, Part $context) { |
|
| 213 | 213 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
| 214 | 214 | }, |
| 215 | 215 | ]); |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | ->add('edit', IconLinkColumn::class, [ |
| 272 | 272 | 'label' => $this->translator->trans('part.table.edit'), |
| 273 | 273 | 'visible' => false, |
| 274 | - 'href' => function ($value, Part $context) { |
|
| 274 | + 'href' => function($value, Part $context) { |
|
| 275 | 275 | return $this->urlGenerator->editURL($context); |
| 276 | 276 | }, |
| 277 | - 'disabled' => function ($value, Part $context) { |
|
| 277 | + 'disabled' => function($value, Part $context) { |
|
| 278 | 278 | return !$this->security->isGranted('edit', $context); |
| 279 | 279 | }, |
| 280 | 280 | 'title' => $this->translator->trans('part.table.edit.title'), |
@@ -283,12 +283,12 @@ discard block |
||
| 283 | 283 | ->addOrderBy('name') |
| 284 | 284 | ->createAdapter(FetchJoinORMAdapter::class, [ |
| 285 | 285 | 'simple_total_query' => true, |
| 286 | - 'query' => function (QueryBuilder $builder): void { |
|
| 286 | + 'query' => function(QueryBuilder $builder): void { |
|
| 287 | 287 | $this->getQuery($builder); |
| 288 | 288 | }, |
| 289 | 289 | 'entity' => Part::class, |
| 290 | 290 | 'criteria' => [ |
| 291 | - function (QueryBuilder $builder) use ($options): void { |
|
| 291 | + function(QueryBuilder $builder) use ($options): void { |
|
| 292 | 292 | $this->buildCriteria($builder, $options); |
| 293 | 293 | }, |
| 294 | 294 | new SearchCriteriaProvider(), |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | ->addSelect( |
| 315 | 315 | '( |
| 316 | 316 | SELECT IFNULL(SUM(partLot.amount), 0.0) |
| 317 | - FROM '. PartLot::class. ' partLot |
|
| 317 | + FROM '. PartLot::class.' partLot |
|
| 318 | 318 | WHERE partLot.part = part.id |
| 319 | 319 | AND partLot.instock_unknown = false |
| 320 | 320 | AND (partLot.expiration_date IS NULL OR partLot.expiration_date > CURRENT_DATE()) |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | ->add('picture', TextColumn::class, [ |
| 63 | 63 | 'label' => '', |
| 64 | 64 | 'className' => 'no-colvis', |
| 65 | - 'render' => function ($value, ProjectBOMEntry $context) { |
|
| 66 | - if($context->getPart() === null) { |
|
| 65 | + 'render' => function($value, ProjectBOMEntry $context) { |
|
| 66 | + if ($context->getPart() === null) { |
|
| 67 | 67 | return ''; |
| 68 | 68 | } |
| 69 | 69 | return $this->partDataTableHelper->renderPicture($context->getPart()); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | ->add('quantity', TextColumn::class, [ |
| 79 | 79 | 'label' => $this->translator->trans('project.bom.quantity'), |
| 80 | 80 | 'className' => 'text-center', |
| 81 | - 'render' => function ($value, ProjectBOMEntry $context) { |
|
| 81 | + 'render' => function($value, ProjectBOMEntry $context) { |
|
| 82 | 82 | //If we have a non-part entry, only show the rounded quantity |
| 83 | 83 | if ($context->getPart() === null) { |
| 84 | 84 | return round($context->getQuantity()); |
@@ -91,13 +91,13 @@ discard block |
||
| 91 | 91 | ->add('name', TextColumn::class, [ |
| 92 | 92 | 'label' => $this->translator->trans('part.table.name'), |
| 93 | 93 | 'orderable' => false, |
| 94 | - 'render' => function ($value, ProjectBOMEntry $context) { |
|
| 95 | - if($context->getPart() === null) { |
|
| 94 | + 'render' => function($value, ProjectBOMEntry $context) { |
|
| 95 | + if ($context->getPart() === null) { |
|
| 96 | 96 | return $context->getName(); |
| 97 | 97 | } |
| 98 | - if($context->getPart() !== null) { |
|
| 98 | + if ($context->getPart() !== null) { |
|
| 99 | 99 | $tmp = $this->partDataTableHelper->renderName($context->getPart()); |
| 100 | - if(!empty($context->getName())) { |
|
| 100 | + if (!empty($context->getName())) { |
|
| 101 | 101 | $tmp .= '<br><b>'.htmlspecialchars($context->getName()).'</b>'; |
| 102 | 102 | } |
| 103 | 103 | return $tmp; |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | ->add('description', MarkdownColumn::class, [ |
| 109 | 109 | 'label' => $this->translator->trans('part.table.description'), |
| 110 | - 'data' => function (ProjectBOMEntry $context) { |
|
| 111 | - if($context->getPart() !== null) { |
|
| 110 | + 'data' => function(ProjectBOMEntry $context) { |
|
| 111 | + if ($context->getPart() !== null) { |
|
| 112 | 112 | return $context->getPart()->getDescription(); |
| 113 | 113 | } |
| 114 | 114 | //For non-part BOM entries show the comment field |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | ->add('mountnames', TextColumn::class, [ |
| 135 | 135 | 'label' => 'project.bom.mountnames', |
| 136 | - 'render' => function ($value, ProjectBOMEntry $context) { |
|
| 136 | + 'render' => function($value, ProjectBOMEntry $context) { |
|
| 137 | 137 | $html = ''; |
| 138 | 138 | |
| 139 | 139 | foreach (explode(',', $context->getMountnames()) as $mountname) { |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 158 | 158 | 'entity' => Attachment::class, |
| 159 | - 'query' => function (QueryBuilder $builder) use ($options): void { |
|
| 159 | + 'query' => function(QueryBuilder $builder) use ($options): void { |
|
| 160 | 160 | $this->getQuery($builder, $options); |
| 161 | 161 | }, |
| 162 | 162 | 'criteria' => [ |
| 163 | - function (QueryBuilder $builder) use ($options): void { |
|
| 163 | + function(QueryBuilder $builder) use ($options): void { |
|
| 164 | 164 | $this->buildCriteria($builder, $options); |
| 165 | 165 | }, |
| 166 | 166 | new SearchCriteriaProvider(), |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | public function configure(DataTable $dataTable, array $options): void |
| 63 | 63 | { |
| 64 | 64 | $dataTable->add('dont_matter', RowClassColumn::class, [ |
| 65 | - 'render' => function ($value, Attachment $context) { |
|
| 65 | + 'render' => function($value, Attachment $context) { |
|
| 66 | 66 | //Mark attachments with missing files yellow |
| 67 | - if(!$this->attachmentHelper->isFileExisting($context)){ |
|
| 67 | + if (!$this->attachmentHelper->isFileExisting($context)) { |
|
| 68 | 68 | return 'table-warning'; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $dataTable->add('picture', TextColumn::class, [ |
| 76 | 76 | 'label' => '', |
| 77 | 77 | 'className' => 'no-colvis', |
| 78 | - 'render' => function ($value, Attachment $context) { |
|
| 78 | + 'render' => function($value, Attachment $context) { |
|
| 79 | 79 | if ($context->isPicture() |
| 80 | 80 | && !$context->isExternal() |
| 81 | 81 | && $this->attachmentHelper->isFileExisting($context)) { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $dataTable->add('name', TextColumn::class, [ |
| 102 | 102 | 'label' => '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( |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $dataTable->add('attachment_type', TextColumn::class, [ |
| 126 | 126 | 'label' => 'attachment.table.type', |
| 127 | 127 | 'field' => 'attachment_type.name', |
| 128 | - 'render' => function ($value, Attachment $context) { |
|
| 128 | + 'render' => function($value, Attachment $context) { |
|
| 129 | 129 | return sprintf( |
| 130 | 130 | '<a href="%s">%s</a>', |
| 131 | 131 | $this->entityURLGenerator->editURL($context->getAttachmentType()), |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $dataTable->add('element', TextColumn::class, [ |
| 138 | 138 | 'label' => 'attachment.table.element', |
| 139 | 139 | //'propertyPath' => 'element.name', |
| 140 | - 'render' => function ($value, Attachment $context) { |
|
| 140 | + 'render' => function($value, Attachment $context) { |
|
| 141 | 141 | return sprintf( |
| 142 | 142 | '<a href="%s">%s</a>', |
| 143 | 143 | $this->entityURLGenerator->infoURL($context->getElement()), |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $dataTable->add('filesize', TextColumn::class, [ |
| 155 | 155 | 'label' => $this->translator->trans('attachment.table.filesize'), |
| 156 | - 'render' => function ($value, Attachment $context) { |
|
| 156 | + 'render' => function($value, Attachment $context) { |
|
| 157 | 157 | if ($context->isExternal()) { |
| 158 | 158 | return sprintf( |
| 159 | 159 | '<span class="badge bg-primary"> |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 213 | 213 | 'entity' => Attachment::class, |
| 214 | - 'query' => function (QueryBuilder $builder): void { |
|
| 214 | + 'query' => function(QueryBuilder $builder): void { |
|
| 215 | 215 | $this->getQuery($builder); |
| 216 | 216 | }, |
| 217 | 217 | 'criteria' => [ |
| 218 | - function (QueryBuilder $builder) use ($options): void { |
|
| 218 | + function(QueryBuilder $builder) use ($options): void { |
|
| 219 | 219 | $this->buildCriteria($builder, $options); |
| 220 | 220 | }, |
| 221 | 221 | new SearchCriteriaProvider(), |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | //We do the most stuff here in the filter class |
| 239 | 239 | if (isset($options['filter'])) { |
| 240 | - if(!$options['filter'] instanceof AttachmentFilter) { |
|
| 240 | + if (!$options['filter'] instanceof AttachmentFilter) { |
|
| 241 | 241 | throw new \Exception('filter must be an instance of AttachmentFilter!'); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -60,12 +60,12 @@ |
||
| 60 | 60 | |
| 61 | 61 | $resolver->setRequired('property'); |
| 62 | 62 | |
| 63 | - $resolver->setDefault('field', static function (Options $option) { |
|
| 63 | + $resolver->setDefault('field', static function(Options $option) { |
|
| 64 | 64 | return $option['property'].'.name'; |
| 65 | 65 | }); |
| 66 | 66 | |
| 67 | - $resolver->setDefault('render', function (Options $options) { |
|
| 68 | - return function ($value, $context) use ($options) { |
|
| 67 | + $resolver->setDefault('render', function(Options $options) { |
|
| 68 | + return function($value, $context) use ($options) { |
|
| 69 | 69 | if ($this->accessor->isReadable($context, $options['property'])) { |
| 70 | 70 | $entity = $this->accessor->getValue($context, $options['property']); |
| 71 | 71 | } else { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | } |
| 60 | 60 | if ($context->getBuiltProject() !== null) { |
| 61 | 61 | $icon = sprintf('<i class="fa-solid fa-box-archive fa-fw me-1" title="%s"></i>', |
| 62 | - $this->translator->trans('part.info.projectBuildPart.hint') . ': ' . $context->getBuiltProject()->getName()); |
|
| 62 | + $this->translator->trans('part.info.projectBuildPart.hint').': '.$context->getBuiltProject()->getName()); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | //Replace all special characters with underscores |
| 54 | 54 | $property = preg_replace('/[^a-zA-Z0-9_]/', '_', $property); |
| 55 | 55 | //Add a random number to the end of the property name for uniqueness |
| 56 | - return $property . '_' . uniqid("", false); |
|
| 56 | + return $property.'_'.uniqid("", false); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $expression = sprintf("%s %s :%s", $property, $comparison_operator, $parameterIdentifier); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if($this->useHaving || $this->isAggregateFunctionString($property)) { //If the property is an aggregate function, we have to use the "having" instead of the "where" |
|
| 75 | + if ($this->useHaving || $this->isAggregateFunctionString($property)) { //If the property is an aggregate function, we have to use the "having" instead of the "where" |
|
| 76 | 76 | $queryBuilder->andHaving($expression); |
| 77 | 77 | } else { |
| 78 | 78 | $queryBuilder->andWhere($expression); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | public function apply(QueryBuilder $queryBuilder): void |
| 63 | 63 | { |
| 64 | 64 | //Do not apply a filter if value is null (filter is set to ignore) |
| 65 | - if(!$this->isEnabled()) { |
|
| 65 | + if (!$this->isEnabled()) { |
|
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -86,16 +86,16 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function apply(QueryBuilder $queryBuilder): void |
| 88 | 88 | { |
| 89 | - if(!$this->isEnabled()) { |
|
| 89 | + if (!$this->isEnabled()) { |
|
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if(!in_array($this->operator, self::ALLOWED_OPERATOR_VALUES, true)) { |
|
| 94 | - throw new \RuntimeException('Invalid operator '. $this->operator . ' provided. Valid operators are '. implode(', ', self::ALLOWED_OPERATOR_VALUES)); |
|
| 93 | + if (!in_array($this->operator, self::ALLOWED_OPERATOR_VALUES, true)) { |
|
| 94 | + throw new \RuntimeException('Invalid operator '.$this->operator.' provided. Valid operators are '.implode(', ', self::ALLOWED_OPERATOR_VALUES)); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | //Equal and not equal can be handled easily |
| 98 | - if($this->operator === '=' || $this->operator === '!=') { |
|
| 98 | + if ($this->operator === '=' || $this->operator === '!=') { |
|
| 99 | 99 | |
| 100 | 100 | $this->addSimpleAndConstraint($queryBuilder, $this->property, $this->identifier, $this->operator, $this->value); |
| 101 | 101 | return; |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | if ($this->operator === 'LIKE') { |
| 107 | 107 | $like_value = $this->value; |
| 108 | 108 | } else if ($this->operator === 'STARTS') { |
| 109 | - $like_value = $this->value . '%'; |
|
| 109 | + $like_value = $this->value.'%'; |
|
| 110 | 110 | } else if ($this->operator === 'ENDS') { |
| 111 | - $like_value = '%' . $this->value; |
|
| 111 | + $like_value = '%'.$this->value; |
|
| 112 | 112 | } else if ($this->operator === 'CONTAINS') { |
| 113 | - $like_value = '%' . $this->value . '%'; |
|
| 113 | + $like_value = '%'.$this->value.'%'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | if ($like_value !== null) { |