@@ -67,6 +67,6 @@ |
||
67 | 67 | */ |
68 | 68 | public function getIDString(): string |
69 | 69 | { |
70 | - return 'M' . sprintf('%06d', $this->getID()); |
|
70 | + return 'M'.sprintf('%06d', $this->getID()); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | \ No newline at end of file |
@@ -105,6 +105,6 @@ |
||
105 | 105 | */ |
106 | 106 | public function getIDString(): string |
107 | 107 | { |
108 | - return 'C' . sprintf('%09d', $this->getID()); |
|
108 | + return 'C'.sprintf('%09d', $this->getID()); |
|
109 | 109 | } |
110 | 110 | } |
@@ -75,8 +75,8 @@ |
||
75 | 75 | ->createAdapter(ORMAdapter::class, [ |
76 | 76 | 'entity' => Part::class, |
77 | 77 | 'criteria' => [ |
78 | - function (QueryBuilder $builder) use($options) { |
|
79 | - if(isset($options['cid'])) { |
|
78 | + function(QueryBuilder $builder) use($options) { |
|
79 | + if (isset($options['cid'])) { |
|
80 | 80 | $builder->andWhere('part.category = :cid') |
81 | 81 | ->setParameter('cid', $options['cid']); |
82 | 82 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | */ |
100 | 100 | public function getIDString(): string |
101 | 101 | { |
102 | - return 'L' . sprintf('%06d', $this->getID()); |
|
102 | + return 'L'.sprintf('%06d', $this->getID()); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | } |
106 | 106 | \ No newline at end of file |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | class Part extends AttachmentContainingDBElement |
50 | 50 | { |
51 | - const INSTOCK_UNKNOWN = -2; |
|
51 | + const INSTOCK_UNKNOWN = -2; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * @var Category |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function getIDString(): string |
172 | 172 | { |
173 | - return 'P' . sprintf('%06d', $this->getID()); |
|
173 | + return 'P'.sprintf('%06d', $this->getID()); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | |
249 | 249 | foreach ($all_orderdetails as $orderdetails) { |
250 | - if (! $orderdetails->getObsolete()) { |
|
250 | + if (!$orderdetails->getObsolete()) { |
|
251 | 251 | return false; |
252 | 252 | } |
253 | 253 | } |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | $prices = array(); |
611 | 611 | |
612 | 612 | foreach ($this->getOrderdetails($hide_obsolete) as $details) { |
613 | - $prices[] = $details->getPrice(! $float_array, $quantity, $multiplier); |
|
613 | + $prices[] = $details->getPrice(!$float_array, $quantity, $multiplier); |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | if (\is_string($delimeter)) { |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | */ |
829 | 829 | public function setInstockUnknown(bool $new_unknown) : self |
830 | 830 | { |
831 | - if($new_unknown == true) { |
|
831 | + if ($new_unknown == true) { |
|
832 | 832 | $this->instock = self::INSTOCK_UNKNOWN; |
833 | 833 | } else { |
834 | 834 | //Change only if instock is currently unknown. |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function generateEntityURL(DBElement $entity, string $method = 'info') : string |
63 | 63 | { |
64 | - switch($method) { |
|
64 | + switch ($method) { |
|
65 | 65 | case 'info': |
66 | 66 | return $this->entityURLGenerator->infoURL($entity); |
67 | 67 | case 'edit': |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | |
76 | 76 | public function parseBBCode(string $bbcode) : string |
77 | 77 | { |
78 | - if($bbcode === '') return ''; |
|
78 | + if ($bbcode === '') return ''; |
|
79 | 79 | |
80 | - $item = $this->cache->getItem('bbcode_' . md5($bbcode)); |
|
81 | - if(!$item->isHit()) { |
|
80 | + $item = $this->cache->getItem('bbcode_'.md5($bbcode)); |
|
81 | + if (!$item->isHit()) { |
|
82 | 82 | $xml = TextFormatter::parse($bbcode); |
83 | 83 | $item->set(TextFormatter::render($xml)); |
84 | 84 | $this->cache->save($item); |
@@ -75,7 +75,9 @@ |
||
75 | 75 | |
76 | 76 | public function parseBBCode(string $bbcode) : string |
77 | 77 | { |
78 | - if($bbcode === '') return ''; |
|
78 | + if($bbcode === '') { |
|
79 | + return ''; |
|
80 | + } |
|
79 | 81 | |
80 | 82 | $item = $this->cache->getItem('bbcode_' . md5($bbcode)); |
81 | 83 | if(!$item->isHit()) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | //Read the permission config file... |
57 | 57 | $config = Yaml::parse( |
58 | - file_get_contents(__DIR__ . '/../../config/permissions.yaml') |
|
58 | + file_get_contents(__DIR__.'/../../config/permissions.yaml') |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | $parent = $user->getGroup(); |
124 | - while($parent != null){ //The top group, has parent == null |
|
124 | + while ($parent != null) { //The top group, has parent == null |
|
125 | 125 | //Check if our current element gives a info about disallow/allow |
126 | 126 | $allowed = $this->dontInherit($parent, $permission, $operation); |
127 | 127 | if ($allowed !== null) { |
@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | public function getIDString(): string |
75 | 75 | { |
76 | - return 'G' . sprintf('%06d', $this->getID()); |
|
76 | + return 'G'.sprintf('%06d', $this->getID()); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | public function getPermissions(): PermissionsEmbed |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | public function getPermissionValue(string $permission_name, int $bit_n) : ?bool |
284 | 284 | { |
285 | 285 | $value = $this->getBitValue($permission_name, $bit_n); |
286 | - if($value == self::ALLOW) { |
|
286 | + if ($value == self::ALLOW) { |
|
287 | 287 | return true; |
288 | - } elseif($value == self::DISALLOW) { |
|
288 | + } elseif ($value == self::DISALLOW) { |
|
289 | 289 | return false; |
290 | 290 | } else { |
291 | 291 | return null; |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | */ |
301 | 301 | final protected static function readBitPair(int $data, int $n): int |
302 | 302 | { |
303 | - Assert::lessThanEq($n,31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.'); |
|
303 | + Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.'); |
|
304 | 304 | if ($n % 2 !== 0) { |
305 | 305 | throw new \InvalidArgumentException('$n must be dividable by 2, because we address bit pairs here!'); |
306 | 306 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | */ |
319 | 319 | final protected static function writeBitPair(int $data, int $n, int $new) : int |
320 | 320 | { |
321 | - Assert::lessThanEq($n,31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.'); |
|
321 | + Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.'); |
|
322 | 322 | Assert::lessThanEq($new, 3, '$new must be smaller than 3, because a bit pair is written! Got %s.'); |
323 | 323 | |
324 | 324 | if ($n % 2 !== 0) { |