@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $secure_class_name = str_replace('\\', '_', $class_name); |
| 62 | 62 | $key = 'list_'.$this->keyGenerator->generateKey().'_'.$secure_class_name.$parent_id; |
| 63 | 63 | |
| 64 | - return $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
| 64 | + return $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
| 65 | 65 | // Invalidate when groups, a element with the class or the user changes |
| 66 | 66 | $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]); |
| 67 | 67 | /** @var StructuralDBElementRepository $repo */ |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | { |
| 102 | 102 | $em = $this->em; |
| 103 | 103 | |
| 104 | - $this->execute($element, static function (AbstractStructuralDBElement $element) use ($em): void { |
|
| 104 | + $this->execute($element, static function(AbstractStructuralDBElement $element) use ($em): void { |
|
| 105 | 105 | $em->remove($element); |
| 106 | 106 | }); |
| 107 | 107 | |
@@ -173,17 +173,17 @@ discard block |
||
| 173 | 173 | $icon = "fa-fw fa-treeview fa-solid "; |
| 174 | 174 | switch ($class) { |
| 175 | 175 | case Category::class: |
| 176 | - return $icon . 'fa-tags'; |
|
| 176 | + return $icon.'fa-tags'; |
|
| 177 | 177 | case Storelocation::class: |
| 178 | - return $icon . 'fa-cube'; |
|
| 178 | + return $icon.'fa-cube'; |
|
| 179 | 179 | case Footprint::class: |
| 180 | - return $icon . 'fa-microchip'; |
|
| 180 | + return $icon.'fa-microchip'; |
|
| 181 | 181 | case Manufacturer::class: |
| 182 | - return $icon . 'fa-industry'; |
|
| 182 | + return $icon.'fa-industry'; |
|
| 183 | 183 | case Supplier::class: |
| 184 | - return $icon . 'fa-truck'; |
|
| 184 | + return $icon.'fa-truck'; |
|
| 185 | 185 | case Project::class: |
| 186 | - return $icon . 'fa-archive'; |
|
| 186 | + return $icon.'fa-archive'; |
|
| 187 | 187 | default: |
| 188 | 188 | return null; |
| 189 | 189 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $secure_class_name = str_replace('\\', '_', $class); |
| 220 | 220 | $key = 'treeview_'.$this->keyGenerator->generateKey().'_'.$secure_class_name; |
| 221 | 221 | |
| 222 | - return $this->cache->get($key, function (ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
| 222 | + return $this->cache->get($key, function(ItemInterface $item) use ($repo, $parent, $secure_class_name) { |
|
| 223 | 223 | // Invalidate when groups, a element with the class or the user changes |
| 224 | 224 | $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]); |
| 225 | 225 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function getLastTreeUpdate(): \DateTimeInterface |
| 45 | 45 | { |
| 46 | - return $this->cache->get(self::CACHE_KEY, function (ItemInterface $item) { |
|
| 46 | + return $this->cache->get(self::CACHE_KEY, function(ItemInterface $item) { |
|
| 47 | 47 | $item->expiresAfter(self::TTL); |
| 48 | 48 | |
| 49 | 49 | //This tag and therfore this whole cache gets cleared by TreeCacheInvalidationListener when a structural element is changed |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $context->getOldStock(), |
| 187 | 187 | '<i class="fa-solid fa-right-long"></i>', |
| 188 | 188 | $context->getNewStock(), |
| 189 | - ($context->getNewStock() > $context->getOldStock() ? '+' : '-'). $context->getChangeAmount(), |
|
| 189 | + ($context->getNewStock() > $context->getOldStock() ? '+' : '-').$context->getChangeAmount(), |
|
| 190 | 190 | ); |
| 191 | 191 | if (!empty($context->getComment())) { |
| 192 | 192 | $array['log.part_stock_changed.comment'] = htmlspecialchars($context->getComment()); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | if ($context->getInstockChangeType() === PartStockChangedLogEntry::TYPE_MOVE) { |
| 195 | 195 | $array['log.part_stock_changed.move_target'] = |
| 196 | 196 | $this->elementTypeNameGenerator->getLocalizedTypeLabel(PartLot::class) |
| 197 | - .' ' . $context->getMoveToTargetID(); |
|
| 197 | + .' '.$context->getMoveToTargetID(); |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
@@ -67,14 +67,14 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * Creates a data URI (RFC 2397). |
|
| 71 | - * Based on the Twig implementaion from HTMLExtension |
|
| 72 | - * |
|
| 73 | - * Length validation is not performed on purpose, validation should |
|
| 74 | - * be done before calling this filter. |
|
| 75 | - * |
|
| 76 | - * @return string The generated data URI |
|
| 77 | - */ |
|
| 70 | + * Creates a data URI (RFC 2397). |
|
| 71 | + * Based on the Twig implementaion from HTMLExtension |
|
| 72 | + * |
|
| 73 | + * Length validation is not performed on purpose, validation should |
|
| 74 | + * be done before calling this filter. |
|
| 75 | + * |
|
| 76 | + * @return string The generated data URI |
|
| 77 | + */ |
|
| 78 | 78 | private function dataUri(string $data, string $mime): string |
| 79 | 79 | { |
| 80 | 80 | $repr = 'data:'; |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | { |
| 64 | 64 | $svg = $this->generateSVG($options, $target); |
| 65 | 65 | $base64 = $this->dataUri($svg, 'image/svg+xml'); |
| 66 | - return '<img src="'.$base64.'" width="100%" style="min-height: 25px;" alt="'. $this->getContent($options, $target) . '" />'; |
|
| 66 | + return '<img src="'.$base64.'" width="100%" style="min-height: 25px;" alt="'.$this->getContent($options, $target).'" />'; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | public function replace(string $lines, object $target): string |
| 90 | 90 | { |
| 91 | 91 | $patterns = [ |
| 92 | - '/(\[\[[A-Z_0-9]+\]\])/' => function ($match) use ($target) { |
|
| 92 | + '/(\[\[[A-Z_0-9]+\]\])/' => function($match) use ($target) { |
|
| 93 | 93 | return $this->handlePlaceholder($match[0], $target); |
| 94 | 94 | }, |
| 95 | 95 | ]; |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $output = []; |
| 62 | 62 | |
| 63 | - foreach($finder as $file) { |
|
| 63 | + foreach ($finder as $file) { |
|
| 64 | 64 | $folder = $file->getRelativePath(); |
| 65 | 65 | //Normalize path (replace \ with /) |
| 66 | 66 | $folder = str_replace('\\', '/', $folder); |
| 67 | 67 | |
| 68 | - if(!isset($output[$folder])) { |
|
| 68 | + if (!isset($output[$folder])) { |
|
| 69 | 69 | $output[$folder] = []; |
| 70 | 70 | } |
| 71 | 71 | //Add file to group |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function getListOfRessources(): array |
| 86 | 86 | { |
| 87 | 87 | try { |
| 88 | - return $this->cache->get('attachment_builtin_ressources', function () { |
|
| 88 | + return $this->cache->get('attachment_builtin_ressources', function() { |
|
| 89 | 89 | $results = []; |
| 90 | 90 | |
| 91 | 91 | $finder = new Finder(); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | protected function configureOptions(OptionsResolver $resolver): void |
| 168 | 168 | { |
| 169 | 169 | $resolver->setDefaults([ |
| 170 | - 'limit' => 15, //Given only 15 entries |
|
| 170 | + 'limit' => 15, //Given only 15 entries |
|
| 171 | 171 | //'allowed_extensions' => [], //Filter the filenames. For example ['jpg', 'jpeg'] to only get jpegs. |
| 172 | 172 | //'placeholders' => Attachment::BUILTIN_PLACEHOLDER, //By default use all builtin ressources, |
| 173 | 173 | 'empty_returns_all' => false, //Return the whole list of ressources when empty keyword is given |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | //Check if the extension is blacklisted and replace the file extension with txt if needed |
| 234 | - if(in_array($ext, self::BLACKLISTED_EXTENSIONS)) { |
|
| 234 | + if (in_array($ext, self::BLACKLISTED_EXTENSIONS)) { |
|
| 235 | 235 | $new_path = $this->generateAttachmentPath($attachment, $attachment->isSecure()) |
| 236 | 236 | .DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, 'txt'); |
| 237 | 237 | |