@@ -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; |
@@ -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 | } |