Skip to content

Commit 9f2785f

Browse files
committed
refactor: run rector
1 parent 5d99f3d commit 9f2785f

27 files changed

+33
-41
lines changed

system/CLI/Console.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function run()
3939
Services::routes()->loadRoutes();
4040

4141
$runner = Services::commands();
42-
$params = array_merge(CLI::getSegments(), CLI::getOptions());
42+
$params = [...CLI::getSegments(), ...CLI::getOptions()];
4343
$params = $this->parseParamsForHelpOption($params);
4444
$command = array_shift($params) ?? 'list';
4545

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(Cache $config)
5151
{
5252
$this->prefix = $config->prefix;
5353

54-
$this->config = array_merge($this->config, $config->memcached);
54+
$this->config = [...$this->config, ...$config->memcached];
5555
}
5656

5757
/**

system/Cache/Handlers/PredisHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(Cache $config)
5353
$this->prefix = $config->prefix;
5454

5555
if (isset($config->redis)) {
56-
$this->config = array_merge($this->config, $config->redis);
56+
$this->config = [...$this->config, ...$config->redis];
5757
}
5858
}
5959

system/Cache/Handlers/RedisHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(Cache $config)
5151
{
5252
$this->prefix = $config->prefix;
5353

54-
$this->config = array_merge($this->config, $config->redis);
54+
$this->config = [...$this->config, ...$config->redis];
5555
}
5656

5757
/**

system/Commands/Generators/CellGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function run(array $params)
7777
$this->component = 'Cell';
7878
$this->directory = 'Cells';
7979

80-
$params = array_merge($params, ['suffix' => null]);
80+
$params = [...$params, 'suffix' => null];
8181

8282
$this->templatePath = config(Generators::class)->views[$this->name]['class'];
8383
$this->template = 'cell.tpl.php';

system/Commands/Generators/ModelGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function prepare(string $class): string
123123
}
124124

125125
$return = '\\' . trim($return, '\\') . '::class';
126-
$this->call('make:entity', array_merge([$baseClass], $this->params));
126+
$this->call('make:entity', [$baseClass, ...$this->params]);
127127
} else {
128128
$return = "'{$return}'";
129129
}

system/Commands/Translation/LocalizationFinder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function process(string $currentDir, string $currentLocale): void
130130
$countNewKeys += ArrayHelper::recursiveCount($languageDiff);
131131

132132
if ($this->showNew) {
133-
$tableRows = array_merge($this->arrayToTableRows($langFileName, $languageDiff), $tableRows);
133+
$tableRows = [...$this->arrayToTableRows($langFileName, $languageDiff), ...$tableRows];
134134
} else {
135135
$newLanguageKeys = array_replace_recursive($foundLanguageKeys[$langFileName], $languageStoredKeys);
136136

@@ -303,7 +303,7 @@ private function arrayToTableRows(string $langFileName, array $array): array
303303

304304
foreach ($array as $value) {
305305
if (is_array($value)) {
306-
$rows = array_merge($rows, $this->arrayToTableRows($langFileName, $value));
306+
$rows = [...$rows, ...$this->arrayToTableRows($langFileName, $value)];
307307

308308
continue;
309309
}

system/Config/BaseConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ protected function registerProperties()
261261

262262
foreach ($properties as $property => $value) {
263263
if (isset($this->{$property}) && is_array($this->{$property}) && is_array($value)) {
264-
$this->{$property} = array_merge($this->{$property}, $value);
264+
$this->{$property} = [...$this->{$property}, ...$value];
265265
} else {
266266
$this->{$property} = $value;
267267
}

system/Config/BaseService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public static function __callStatic(string $name, array $arguments)
266266
public static function serviceExists(string $name): ?string
267267
{
268268
static::buildServicesCache();
269-
$services = array_merge(self::$serviceNames, [Services::class]);
269+
$services = [...self::$serviceNames, Services::class];
270270
$name = strtolower($name);
271271

272272
foreach ($services as $service) {

system/Database/Forge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ public function processIndexes(string $table): bool
10941094
$this->fields = $fields;
10951095

10961096
if ($this->foreignKeys !== []) {
1097-
$sqls = array_merge($sqls, $this->_processForeignKeys($table, true));
1097+
$sqls = [...$sqls, ...$this->_processForeignKeys($table, true)];
10981098
}
10991099

11001100
foreach ($sqls as $sql) {

0 commit comments

Comments
 (0)