From 188b1857f11fefb43b196ae010812ae2ec0abd5b Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Tue, 19 Sep 2023 11:34:15 +0700 Subject: [PATCH] run cs-fix after rules shorthand operator --- system/BaseModel.php | 6 +++--- system/CLI/CLI.php | 4 ++-- system/Format/JSONFormatter.php | 2 +- system/Images/Handlers/GDHandler.php | 4 ++-- system/Images/Handlers/ImageMagickHandler.php | 4 ++-- system/Throttle/Throttler.php | 2 +- tests/_support/View/Cells/MultiplierCell.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/system/BaseModel.php b/system/BaseModel.php index 43dcf1c5abe4..0cf63ac9f3ec 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -1439,8 +1439,8 @@ public function setValidationRule(string $field, $fieldRules) if (is_string($rules)) { [$rules, $customErrors] = $this->validation->loadRuleGroup($rules); - $this->validationRules = $rules; - $this->validationMessages = $this->validationMessages + $customErrors; + $this->validationRules = $rules; + $this->validationMessages += $customErrors; } $this->validationRules[$field] = $fieldRules; @@ -1510,7 +1510,7 @@ public function getValidationRules(array $options = []): array if (is_string($rules)) { [$rules, $customErrors] = $this->validation->loadRuleGroup($rules); - $this->validationMessages = $this->validationMessages + $customErrors; + $this->validationMessages += $customErrors; } if (isset($options['except'])) { diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php index 7e0376e6b6f1..29f424d1ec53 100644 --- a/system/CLI/CLI.php +++ b/system/CLI/CLI.php @@ -851,7 +851,7 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft = $max = self::getWidth(); } - $max = $max - $padLeft; + $max -= $padLeft; $lines = wordwrap($string, $max, PHP_EOL); @@ -1079,7 +1079,7 @@ public static function table(array $tbody, array $thead = []) $diff = $maxColsLengths[$column] - static::strlen($col); if ($diff) { - $tableRows[$row][$column] = $tableRows[$row][$column] . str_repeat(' ', $diff); + $tableRows[$row][$column] .= str_repeat(' ', $diff); } $column++; diff --git a/system/Format/JSONFormatter.php b/system/Format/JSONFormatter.php index 146fd5330aa6..3e708e9fa6b7 100644 --- a/system/Format/JSONFormatter.php +++ b/system/Format/JSONFormatter.php @@ -33,7 +33,7 @@ public function format($data) $config = new Format(); $options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES; - $options = $options | JSON_PARTIAL_OUTPUT_ON_ERROR; + $options |= JSON_PARTIAL_OUTPUT_ON_ERROR; $options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT; diff --git a/system/Images/Handlers/GDHandler.php b/system/Images/Handlers/GDHandler.php index 99403a164137..15bb97b6b839 100644 --- a/system/Images/Handlers/GDHandler.php +++ b/system/Images/Handlers/GDHandler.php @@ -381,11 +381,11 @@ protected function _text(string $text, array $options = []) // offset flips itself automatically if ($options['vAlign'] === 'bottom') { - $options['vOffset'] = $options['vOffset'] * -1; + $options['vOffset'] *= -1; } if ($options['hAlign'] === 'right') { - $options['hOffset'] = $options['hOffset'] * -1; + $options['hOffset'] *= -1; } // Set font width and height diff --git a/system/Images/Handlers/ImageMagickHandler.php b/system/Images/Handlers/ImageMagickHandler.php index 3d7eea0504e6..857a273d5372 100644 --- a/system/Images/Handlers/ImageMagickHandler.php +++ b/system/Images/Handlers/ImageMagickHandler.php @@ -340,11 +340,11 @@ protected function _text(string $text, array $options = []) // invert the offset. Note: The horizontal // offset flips itself automatically if ($options['vAlign'] === 'bottom') { - $options['vOffset'] = $options['vOffset'] * -1; + $options['vOffset'] *= -1; } if ($options['hAlign'] === 'right') { - $options['hOffset'] = $options['hOffset'] * -1; + $options['hOffset'] *= -1; } // Font diff --git a/system/Throttle/Throttler.php b/system/Throttle/Throttler.php index dc0844fa4cb8..0a10c02335f2 100644 --- a/system/Throttle/Throttler.php +++ b/system/Throttle/Throttler.php @@ -127,7 +127,7 @@ public function check(string $key, int $capacity, int $seconds, int $cost = 1): // If $tokens >= 1, then we are safe to perform the action, but // we need to decrement the number of available tokens. if ($tokens >= 1) { - $tokens = $tokens - $cost; + $tokens -= $cost; $this->cache->save($tokenName, $tokens, $seconds); $this->cache->save($tokenName . 'Time', $this->time(), $seconds); diff --git a/tests/_support/View/Cells/MultiplierCell.php b/tests/_support/View/Cells/MultiplierCell.php index 59bf7d3d96c5..81f6b4908e7a 100644 --- a/tests/_support/View/Cells/MultiplierCell.php +++ b/tests/_support/View/Cells/MultiplierCell.php @@ -20,6 +20,6 @@ class MultiplierCell extends Cell public function mount(): void { - $this->value = $this->value * $this->multiplier; + $this->value *= $this->multiplier; } }