@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $sz = 'BKMGTP'; |
159 | 159 | $factor = (int) floor((strlen($bytes) - 1) / 3); |
160 | - return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor]; |
|
160 | + return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor]; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | MeasurementUnitAttachment::class => 'measurement_unit', StorelocationAttachment::class => 'storelocation', |
175 | 175 | SupplierAttachment::class => 'supplier', UserAttachment::class => 'user']; |
176 | 176 | |
177 | - $path = $this->pathResolver->getMediaPath() . DIRECTORY_SEPARATOR . $mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID(); |
|
177 | + $path = $this->pathResolver->getMediaPath().DIRECTORY_SEPARATOR.$mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID(); |
|
178 | 178 | return $path; |
179 | 179 | } |
180 | 180 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | //Sanatize filename |
199 | 199 | $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME); |
200 | - $newFilename = $attachment->getName() . '-' . uniqid('', false) . '.' . $file->getClientOriginalExtension(); |
|
200 | + $newFilename = $attachment->getName().'-'.uniqid('', false).'.'.$file->getClientOriginalExtension(); |
|
201 | 201 | |
202 | 202 | //Move our temporay attachment to its final location |
203 | 203 | $file_path = $file->move($folder, $newFilename)->getRealPath(); |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | if (isset($options['tag'])) { |
140 | - $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%' . $options['tag'] . '%'); |
|
140 | + $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%'); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | if (isset($options['search'])) { |
144 | 144 | $builder->AndWhere('part.name LIKE :search')->orWhere('part.description LIKE :search')->orWhere('part.comment LIKE :search') |
145 | - ->setParameter('search', '%' . $options['search'] . '%'); |
|
145 | + ->setParameter('search', '%'.$options['search'].'%'); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $dataTable |
156 | 156 | ->add('picture', TextColumn::class, [ |
157 | 157 | 'label' => '', |
158 | - 'render' => function ($value, Part $context) { |
|
158 | + 'render' => function($value, Part $context) { |
|
159 | 159 | $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context); |
160 | 160 | if ($preview_attachment === null) { |
161 | 161 | return ''; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ]) |
172 | 172 | ->add('name', TextColumn::class, [ |
173 | 173 | 'label' => $this->translator->trans('part.table.name'), |
174 | - 'render' => function ($value, Part $context) { |
|
174 | + 'render' => function($value, Part $context) { |
|
175 | 175 | return sprintf( |
176 | 176 | '<a href="%s">%s</a>', |
177 | 177 | $this->urlGenerator->infoURL($context), |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | ]) |
201 | 201 | ->add('storelocation', TextColumn::class, [ |
202 | 202 | 'label' => $this->translator->trans('part.table.storeLocations'), |
203 | - 'render' => function ($value, Part $context) { |
|
203 | + 'render' => function($value, Part $context) { |
|
204 | 204 | $tmp = array(); |
205 | 205 | foreach ($context->getPartLots() as $lot) { |
206 | 206 | //Ignore lots without storelocation |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | ]) |
220 | 220 | ->add('amount', TextColumn::class, [ |
221 | 221 | 'label' => $this->translator->trans('part.table.amount'), |
222 | - 'render' => function ($value, Part $context) { |
|
222 | + 'render' => function($value, Part $context) { |
|
223 | 223 | $amount = $context->getAmountSum(); |
224 | 224 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
225 | 225 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | ->add('minamount', TextColumn::class, [ |
228 | 228 | 'label' => $this->translator->trans('part.table.minamount'), |
229 | 229 | 'visible' => false, |
230 | - 'render' => function ($value, Part $context) { |
|
230 | + 'render' => function($value, Part $context) { |
|
231 | 231 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
232 | 232 | } |
233 | 233 | ]) |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | }, |
292 | 292 | 'entity' => Part::class, |
293 | 293 | 'criteria' => [ |
294 | - function (QueryBuilder $builder) use ($options) { |
|
294 | + function(QueryBuilder $builder) use ($options) { |
|
295 | 295 | $this->buildCriteria($builder, $options); |
296 | 296 | }, |
297 | 297 | new SearchCriteriaProvider() |
@@ -82,7 +82,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | ]); |
@@ -125,8 +125,8 @@ |
||
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 |
@@ -129,7 +129,7 @@ discard block |
||
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 |
||
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) { |
@@ -49,8 +49,8 @@ discard block |
||
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 |
||
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]; |