@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | //Check if both elements compared, are from the same type |
129 | 129 | // (we have to check inheritance, or we get exceptions when using doctrine entities (they have a proxy type): |
130 | - if (! is_a($another_element, $class_name) && ! is_a($this, get_class($another_element))) { |
|
130 | + if (!is_a($another_element, $class_name) && !is_a($this, get_class($another_element))) { |
|
131 | 131 | throw new InvalidArgumentException('isChildOf() only works for objects of the same type!'); |
132 | 132 | } |
133 | 133 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $tmp[] = $this; |
244 | 244 | |
245 | 245 | //We only allow 20 levels depth |
246 | - while (! end($tmp)->isRoot() && count($tmp) < 20) { |
|
246 | + while (!end($tmp)->isRoot() && count($tmp) < 20) { |
|
247 | 247 | $tmp[] = end($tmp)->parent; |
248 | 248 | } |
249 | 249 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public function setChildren($elements): self |
324 | 324 | { |
325 | - if (! is_array($elements) && ! $elements instanceof Collection) { |
|
325 | + if (!is_array($elements) && !$elements instanceof Collection) { |
|
326 | 326 | throw new InvalidArgumentException('$elements must be an array or Collection!'); |
327 | 327 | } |
328 | 328 |
@@ -119,7 +119,7 @@ |
||
119 | 119 | |
120 | 120 | public function hasOldDataInformations(): bool |
121 | 121 | { |
122 | - return ! empty($this->extra['d']); |
|
122 | + return !empty($this->extra['d']); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | public function getOldData(): array |
@@ -109,7 +109,7 @@ |
||
109 | 109 | |
110 | 110 | public function hasOldDataInformations(): bool |
111 | 111 | { |
112 | - return ! empty($this->extra['o']); |
|
112 | + return !empty($this->extra['o']); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | public function getOldData(): array |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function setElement(AbstractDBElement $element): self |
193 | 193 | { |
194 | - if (! is_a($element, static::ALLOWED_ELEMENT_CLASS)) { |
|
194 | + if (!is_a($element, static::ALLOWED_ELEMENT_CLASS)) { |
|
195 | 195 | throw new InvalidArgumentException(sprintf('The element associated with a %s must be a %s!', static::class, static::ALLOWED_ELEMENT_CLASS)); |
196 | 196 | } |
197 | 197 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | protected function formatWithUnit(float $value, string $format = '%g'): string |
410 | 410 | { |
411 | 411 | $str = \sprintf($format, $value); |
412 | - if (! empty($this->unit)) { |
|
412 | + if (!empty($this->unit)) { |
|
413 | 413 | return $str.' '.$this->unit; |
414 | 414 | } |
415 | 415 |
@@ -103,7 +103,7 @@ |
||
103 | 103 | 'currency' => Currency::class, |
104 | 104 | ]; |
105 | 105 | |
106 | - if (! isset($arr[$type])) { |
|
106 | + if (!isset($arr[$type])) { |
|
107 | 107 | throw new \InvalidArgumentException('No count for the given type available!'); |
108 | 108 | } |
109 | 109 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | public function setMode(string $mode): void |
45 | 45 | { |
46 | - if (! in_array($mode, self::ALLOWED_MODES, true)) { |
|
46 | + if (!in_array($mode, self::ALLOWED_MODES, true)) { |
|
47 | 47 | throw new \InvalidArgumentException('Invalid mode passed!'); |
48 | 48 | } |
49 | 49 | $this->mode = $mode; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function revertEntityToTimestamp(AbstractDBElement $element, \DateTime $timestamp, array $reverted_elements = []): void |
81 | 81 | { |
82 | - if (! $element instanceof TimeStampableInterface) { |
|
82 | + if (!$element instanceof TimeStampableInterface) { |
|
83 | 83 | throw new \InvalidArgumentException('$element must have a Timestamp!'); |
84 | 84 | } |
85 | 85 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | foreach ($target_elements as $target_element) { |
154 | 154 | if (null !== $target_element && $element->getLastModified() >= $timestamp) { |
155 | 155 | //Remove the element from collection, if it did not existed at $timestamp |
156 | - if (! $this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) { |
|
156 | + if (!$this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) { |
|
157 | 157 | if ($target_elements instanceof Collection) { |
158 | 158 | $target_elements->removeElement($target_element); |
159 | 159 | } |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | public function applyEntry(AbstractDBElement $element, TimeTravelInterface $logEntry): void |
174 | 174 | { |
175 | 175 | //Skip if this does not provide any info... |
176 | - if (! $logEntry->hasOldDataInformations()) { |
|
176 | + if (!$logEntry->hasOldDataInformations()) { |
|
177 | 177 | return; |
178 | 178 | } |
179 | - if (! $element instanceof TimeStampableInterface) { |
|
179 | + if (!$element instanceof TimeStampableInterface) { |
|
180 | 180 | return; |
181 | 181 | } |
182 | 182 | $metadata = $this->em->getClassMetadata(get_class($element)); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $str .= '<error>'.$this->translator->trans($key).'</error>: '; |
92 | 92 | } |
93 | 93 | $str .= $value; |
94 | - if (! empty($str)) { |
|
94 | + if (!empty($str)) { |
|
95 | 95 | $tmp[] = $str; |
96 | 96 | } |
97 | 97 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $str .= '<b>'.$this->translator->trans($key).'</b>: '; |
117 | 117 | } |
118 | 118 | $str .= $value; |
119 | - if (! empty($str)) { |
|
119 | + if (!empty($str)) { |
|
120 | 120 | $tmp[] = $str; |
121 | 121 | } |
122 | 122 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | '%s <i class="fas fa-long-arrow-alt-right"></i> %s (%s)', |
187 | 187 | $context->getOldInstock(), |
188 | 188 | $context->getNewInstock(), |
189 | - (! $context->isWithdrawal() ? '+' : '-').$context->getDifference(true) |
|
189 | + (!$context->isWithdrawal() ? '+' : '-').$context->getDifference(true) |
|
190 | 190 | ); |
191 | 191 | $array['log.instock_changed.comment'] = htmlspecialchars($context->getComment()); |
192 | 192 | } |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | 'attr' => [ |
95 | 95 | 'placeholder' => 'part.name.placeholder', |
96 | 96 | ], |
97 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
97 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
98 | 98 | ]) |
99 | 99 | |
100 | 100 | ->add('parent', StructuralEntityType::class, [ |
101 | 101 | 'class' => get_class($entity), |
102 | 102 | 'required' => false, |
103 | 103 | 'label' => 'parent.label', |
104 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
104 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
105 | 105 | ]) |
106 | 106 | |
107 | 107 | ->add('not_selectable', CheckboxType::class, [ |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'label_attr' => [ |
112 | 112 | 'class' => 'checkbox-custom', |
113 | 113 | ], |
114 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
114 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
115 | 115 | ]) |
116 | 116 | |
117 | 117 | ->add('comment', CKEditorType::class, [ |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | 'rows' => 4, |
123 | 123 | ], |
124 | 124 | 'help' => 'bbcode.hint', |
125 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
125 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
126 | 126 | ]); |
127 | 127 | |
128 | 128 | $this->additionalFormElements($builder, $options, $entity); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'allow_add' => true, |
134 | 134 | 'allow_delete' => true, |
135 | 135 | 'label' => false, |
136 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
136 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
137 | 137 | 'entry_options' => [ |
138 | 138 | 'data_class' => $options['attachment_class'], |
139 | 139 | ], |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
144 | 144 | 'required' => false, |
145 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
145 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
146 | 146 | 'label' => 'part.edit.master_attachment', |
147 | 147 | 'entity' => $entity, |
148 | 148 | ]); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'entry_type' => ParameterType::class, |
159 | 159 | 'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
160 | 160 | 'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
161 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
161 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
162 | 162 | 'label' => false, |
163 | 163 | 'by_reference' => false, |
164 | 164 | 'prototype_data' => new $options['parameter_class'](), |
@@ -173,11 +173,11 @@ discard block |
||
173 | 173 | 'attr' => [ |
174 | 174 | 'class' => $is_new ? 'btn-success' : '', |
175 | 175 | ], |
176 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
176 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
177 | 177 | ]) |
178 | 178 | ->add('reset', ResetType::class, [ |
179 | 179 | 'label' => 'entity.edit.reset', |
180 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
180 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
181 | 181 | ]); |
182 | 182 | } |
183 | 183 |