Skip to content

Commit a05cae4

Browse files
authored
Merge pull request #7953 from ddevsr/run-cs-short-operator
style: run `cs-fix` after rules shorthand operator
2 parents f0af89d + 188b185 commit a05cae4

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

system/BaseModel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ public function setValidationRule(string $field, $fieldRules)
14391439
if (is_string($rules)) {
14401440
[$rules, $customErrors] = $this->validation->loadRuleGroup($rules);
14411441

1442-
$this->validationRules = $rules;
1443-
$this->validationMessages = $this->validationMessages + $customErrors;
1442+
$this->validationRules = $rules;
1443+
$this->validationMessages += $customErrors;
14441444
}
14451445

14461446
$this->validationRules[$field] = $fieldRules;
@@ -1510,7 +1510,7 @@ public function getValidationRules(array $options = []): array
15101510
if (is_string($rules)) {
15111511
[$rules, $customErrors] = $this->validation->loadRuleGroup($rules);
15121512

1513-
$this->validationMessages = $this->validationMessages + $customErrors;
1513+
$this->validationMessages += $customErrors;
15141514
}
15151515

15161516
if (isset($options['except'])) {

system/CLI/CLI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft =
851851
$max = self::getWidth();
852852
}
853853

854-
$max = $max - $padLeft;
854+
$max -= $padLeft;
855855

856856
$lines = wordwrap($string, $max, PHP_EOL);
857857

@@ -1079,7 +1079,7 @@ public static function table(array $tbody, array $thead = [])
10791079
$diff = $maxColsLengths[$column] - static::strlen($col);
10801080

10811081
if ($diff) {
1082-
$tableRows[$row][$column] = $tableRows[$row][$column] . str_repeat(' ', $diff);
1082+
$tableRows[$row][$column] .= str_repeat(' ', $diff);
10831083
}
10841084

10851085
$column++;

system/Format/JSONFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function format($data)
3333
$config = new Format();
3434

3535
$options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
36-
$options = $options | JSON_PARTIAL_OUTPUT_ON_ERROR;
36+
$options |= JSON_PARTIAL_OUTPUT_ON_ERROR;
3737

3838
$options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT;
3939

system/Images/Handlers/GDHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@ protected function _text(string $text, array $options = [])
381381
// offset flips itself automatically
382382

383383
if ($options['vAlign'] === 'bottom') {
384-
$options['vOffset'] = $options['vOffset'] * -1;
384+
$options['vOffset'] *= -1;
385385
}
386386

387387
if ($options['hAlign'] === 'right') {
388-
$options['hOffset'] = $options['hOffset'] * -1;
388+
$options['hOffset'] *= -1;
389389
}
390390

391391
// Set font width and height

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ protected function _text(string $text, array $options = [])
340340
// invert the offset. Note: The horizontal
341341
// offset flips itself automatically
342342
if ($options['vAlign'] === 'bottom') {
343-
$options['vOffset'] = $options['vOffset'] * -1;
343+
$options['vOffset'] *= -1;
344344
}
345345

346346
if ($options['hAlign'] === 'right') {
347-
$options['hOffset'] = $options['hOffset'] * -1;
347+
$options['hOffset'] *= -1;
348348
}
349349

350350
// Font

system/Throttle/Throttler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function check(string $key, int $capacity, int $seconds, int $cost = 1):
127127
// If $tokens >= 1, then we are safe to perform the action, but
128128
// we need to decrement the number of available tokens.
129129
if ($tokens >= 1) {
130-
$tokens = $tokens - $cost;
130+
$tokens -= $cost;
131131
$this->cache->save($tokenName, $tokens, $seconds);
132132
$this->cache->save($tokenName . 'Time', $this->time(), $seconds);
133133

tests/_support/View/Cells/MultiplierCell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ class MultiplierCell extends Cell
2020

2121
public function mount(): void
2222
{
23-
$this->value = $this->value * $this->multiplier;
23+
$this->value *= $this->multiplier;
2424
}
2525
}

0 commit comments

Comments
 (0)