@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $this->addFlash('info', 'part.edited_flash'); |
181 | 181 | //Reload form, so the SIUnitType entries use the new part unit |
182 | 182 | $form = $this->createForm(PartBaseType::class, $part); |
183 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
183 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
184 | 184 | $this->addFlash('error', 'part.edited_flash.invalid'); |
185 | 185 | } |
186 | 186 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @return Response |
226 | 226 | */ |
227 | 227 | public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator, |
228 | - AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null): Response |
|
228 | + AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null) : Response |
|
229 | 229 | { |
230 | 230 | if (null === $part) { |
231 | 231 | $new_part = new Part(); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
276 | 276 | } |
277 | 277 | |
278 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
278 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
279 | 279 | $this->addFlash('error', 'part.created_flash.invalid'); |
280 | 280 | } |
281 | 281 |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $form->handleRequest($request); |
162 | 162 | if ($form->isSubmitted() && $form->isValid()) { |
163 | 163 | //Check if we editing a user and if we need to change the password of it |
164 | - if ($entity instanceof User && ! empty($form['new_password']->getData())) { |
|
164 | + if ($entity instanceof User && !empty($form['new_password']->getData())) { |
|
165 | 165 | $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData()); |
166 | 166 | $entity->setPassword($password); |
167 | 167 | //By default the user must change the password afterwards |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | 'attachment_class' => $this->attachment_class, |
200 | 200 | 'parameter_class' => $this->parameter_class |
201 | 201 | ]); |
202 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
202 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
203 | 203 | $this->addFlash('error', 'entity.edit_flash.invalid'); |
204 | 204 | } |
205 | 205 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $form->handleRequest($request); |
230 | 230 | |
231 | 231 | if ($form->isSubmitted() && $form->isValid()) { |
232 | - if ($new_entity instanceof User && ! empty($form['new_password']->getData())) { |
|
232 | + if ($new_entity instanceof User && !empty($form['new_password']->getData())) { |
|
233 | 233 | $password = $this->passwordEncoder->encodePassword($new_entity, $form['new_password']->getData()); |
234 | 234 | $new_entity->setPassword($password); |
235 | 235 | //By default the user must change the password afterwards |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); |
265 | 265 | } |
266 | 266 | |
267 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
267 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
268 | 268 | $this->addFlash('error', 'entity.created_flash.invalid'); |
269 | 269 | } |
270 | 270 |
@@ -146,7 +146,7 @@ |
||
146 | 146 | $this->dbRepository->changeID($element, $logEntry->getTargetID()); |
147 | 147 | } |
148 | 148 | |
149 | - if (! $element instanceof AbstractDBElement) { |
|
149 | + if (!$element instanceof AbstractDBElement) { |
|
150 | 150 | $this->addFlash('error', 'log.undo.target_not_found'); |
151 | 151 | |
152 | 152 | return; |
@@ -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; |