@@ -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 | |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | return $this->filterService->getUrlOfFilteredImage($asset_path, $filter_name); |
| 158 | 158 | } catch (\Imagine\Exception\RuntimeException $e) { |
| 159 | 159 | //If the filter fails, we can not serve the thumbnail and fall back to the original image and log an warning |
| 160 | - $this->logger->warning('Could not open thumbnail for attachment with ID ' . $attachment->getID() . ': ' . $e->getMessage()); |
|
| 160 | + $this->logger->warning('Could not open thumbnail for attachment with ID '.$attachment->getID().': '.$e->getMessage()); |
|
| 161 | 161 | return $this->assets->getUrl($asset_path); |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | protected function configureOptions(OptionsResolver $resolver): void |
| 107 | 107 | { |
| 108 | 108 | $resolver->setDefaults([ |
| 109 | - 'show_prefix' => static function (Options $options) { |
|
| 109 | + 'show_prefix' => static function(Options $options) { |
|
| 110 | 110 | if (null !== $options['measurement_unit']) { |
| 111 | 111 | /** @var MeasurementUnit $unit */ |
| 112 | 112 | $unit = $options['measurement_unit']; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | return false; |
| 118 | 118 | }, |
| 119 | - 'is_integer' => static function (Options $options) { |
|
| 119 | + 'is_integer' => static function(Options $options) { |
|
| 120 | 120 | if (null !== $options['measurement_unit']) { |
| 121 | 121 | /** @var MeasurementUnit $unit */ |
| 122 | 122 | $unit = $options['measurement_unit']; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | return true; |
| 128 | 128 | }, |
| 129 | - 'unit' => static function (Options $options) { |
|
| 129 | + 'unit' => static function(Options $options) { |
|
| 130 | 130 | if (null !== $options['measurement_unit']) { |
| 131 | 131 | /** @var MeasurementUnit $unit */ |
| 132 | 132 | $unit = $options['measurement_unit']; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $resolver->setAllowedTypes('decimals', 'int'); |
| 146 | 146 | |
| 147 | - $resolver->setNormalizer('decimals', static function (Options $options, $value) { |
|
| 147 | + $resolver->setNormalizer('decimals', static function(Options $options, $value) { |
|
| 148 | 148 | // If the unit is integer based, then dont show any decimals |
| 149 | 149 | if ($options['is_integer']) { |
| 150 | 150 | return 0; |