@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | public function canAdd(PartLot $partLot): bool |
29 | 29 | { |
30 | 30 | //We cannot add or withdraw parts from lots with unknown instock value. |
31 | - if($partLot->isInstockUnknown()) { |
|
31 | + if ($partLot->isInstockUnknown()) { |
|
32 | 32 | return false; |
33 | 33 | } |
34 | 34 | |
35 | 35 | //So far all other restrictions are defined at the storelocation level |
36 | - if($partLot->getStorageLocation() === null) { |
|
36 | + if ($partLot->getStorageLocation() === null) { |
|
37 | 37 | return true; |
38 | 38 | } |
39 | 39 | |
40 | 40 | //We can not add parts if the storage location of the lot is marked as full |
41 | - if($partLot->getStorageLocation()->isFull()) { |
|
41 | + if ($partLot->getStorageLocation()->isFull()) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $oldAmount = $partLot->getAmount(); |
97 | 97 | $partLot->setAmount($oldAmount - $amount); |
98 | 98 | |
99 | - $event = PartStockChangedLogEntry::withdraw($partLot, $oldAmount, $partLot->getAmount(), $part->getAmountSum() , $comment); |
|
99 | + $event = PartStockChangedLogEntry::withdraw($partLot, $oldAmount, $partLot->getAmount(), $part->getAmountSum(), $comment); |
|
100 | 100 | $this->eventLogger->log($event); |
101 | 101 | |
102 | 102 | //Apply the comment also to global events, so it gets associated with the elementChanged log entry |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $oldAmount = $partLot->getAmount(); |
137 | 137 | $partLot->setAmount($oldAmount + $amount); |
138 | 138 | |
139 | - $event = PartStockChangedLogEntry::add($partLot, $oldAmount, $partLot->getAmount(), $part->getAmountSum() , $comment); |
|
139 | + $event = PartStockChangedLogEntry::add($partLot, $oldAmount, $partLot->getAmount(), $part->getAmountSum(), $comment); |
|
140 | 140 | $this->eventLogger->log($event); |
141 | 141 | |
142 | 142 | //Apply the comment also to global events, so it gets associated with the elementChanged log entry |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $part = $origin->getPart(); |
166 | 166 | |
167 | 167 | //Ensure that both part lots belong to the same part |
168 | - if($origin->getPart() !== $target->getPart()) { |
|
168 | + if ($origin->getPart() !== $target->getPart()) { |
|
169 | 169 | throw new \RuntimeException("Cannot move instock between different parts!"); |
170 | 170 | } |
171 | 171 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | //And add it to the target |
192 | 192 | $target->setAmount($target->getAmount() + $amount); |
193 | 193 | |
194 | - $event = PartStockChangedLogEntry::move($origin, $oldOriginAmount, $origin->getAmount(), $part->getAmountSum() , $comment, $target); |
|
194 | + $event = PartStockChangedLogEntry::move($origin, $oldOriginAmount, $origin->getAmount(), $part->getAmountSum(), $comment, $target); |
|
195 | 195 | $this->eventLogger->log($event); |
196 | 196 | |
197 | 197 | //Apply the comment also to global events, so it gets associated with the elementChanged log entry |
@@ -85,7 +85,7 @@ |
||
85 | 85 | } else { |
86 | 86 | // We have to sort the pricedetails manually |
87 | 87 | $array = $pricedetails->map( |
88 | - static function (Pricedetail $pricedetail) { |
|
88 | + static function(Pricedetail $pricedetail) { |
|
89 | 89 | return $pricedetail->getMinDiscountQuantity(); |
90 | 90 | } |
91 | 91 | )->toArray(); |
@@ -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 | ]; |