Skip to content

Commit 70c99eb

Browse files
chore(deps-dev): update rector/rector requirement from 2.6.3 to 2.6.4 in the composer-dependencies group (#10513)
* chore(deps-dev): update rector/rector requirement Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. Updates `rector/rector` to 2.6.4 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.6.3...2.6.4) --- updated-dependencies: - dependency-name: rector/rector dependency-version: 2.6.4 dependency-type: direct:development dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * chore: apply IfToNullCoalescingAssignRector rule * fix: phpstan --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: michalsn <michal@sniatala.pl>
1 parent 9b71bf7 commit 70c99eb

41 files changed

Lines changed: 102 additions & 228 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"phpunit/phpcov": "^9.0.2 || ^10.0",
3030
"phpunit/phpunit": "^10.5.16 || ^11.2",
3131
"predis/predis": "^3.0",
32-
"rector/rector": "2.6.3",
32+
"rector/rector": "2.6.4",
3333
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3434
},
3535
"replace": {

system/BaseModel.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,9 +1648,7 @@ public function getValidationRules(array $options = []): array
16481648

16491649
protected function ensureValidation(): void
16501650
{
1651-
if ($this->validation === null) {
1652-
$this->validation = service('validation', null, false);
1653-
}
1651+
$this->validation ??= service('validation', null, false);
16541652
}
16551653

16561654
/**

system/CLI/SignalTrait.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ protected function isPcntlAvailable(): bool
8181
*/
8282
protected function isPosixAvailable(): bool
8383
{
84-
if (self::$isPosixAvailable === null) {
85-
self::$isPosixAvailable = is_windows() ? false : extension_loaded('posix');
86-
}
84+
self::$isPosixAvailable ??= is_windows() ? false : extension_loaded('posix');
8785

8886
return self::$isPosixAvailable;
8987
}

system/CodeIgniter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,7 @@ protected function bootstrapEnvironment()
624624
*/
625625
protected function startBenchmark()
626626
{
627-
if ($this->startTime === null) {
628-
$this->startTime = microtime(true);
629-
}
627+
$this->startTime ??= microtime(true);
630628

631629
$this->benchmark = Services::timer();
632630
$this->benchmark->start('total_execution', $this->startTime);

system/Commands/ListCommands.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ protected function listFull(array $commands)
101101
$groups = [];
102102

103103
foreach ($commands as $title => $command) {
104-
if (! isset($groups[$command['group']])) {
105-
$groups[$command['group']] = [];
106-
}
104+
$groups[$command['group']] ??= [];
107105

108106
$groups[$command['group']][$title] = $command;
109107
}

system/Common.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,7 @@ function esc($data, string $context = 'html', ?string $encoding = null)
490490
static $escapers = [];
491491
$cacheKey = strtolower($encoding ?? 'utf-8');
492492

493-
if (! isset($escapers[$cacheKey])) {
494-
$escapers[$cacheKey] = new Escaper($encoding);
495-
}
493+
$escapers[$cacheKey] ??= new Escaper($encoding);
496494

497495
$data = $escapers[$cacheKey]->{$method}($data);
498496
}
@@ -588,9 +586,7 @@ function function_usable(string $functionName): bool
588586
static $_suhosin_func_blacklist;
589587

590588
if (function_exists($functionName)) {
591-
if (! isset($_suhosin_func_blacklist)) {
592-
$_suhosin_func_blacklist = extension_loaded('suhosin') ? explode(',', trim(ini_get('suhosin.executor.func.blacklist'))) : [];
593-
}
589+
$_suhosin_func_blacklist ??= extension_loaded('suhosin') ? explode(',', trim(ini_get('suhosin.executor.func.blacklist'))) : [];
594590

595591
return ! in_array($functionName, $_suhosin_func_blacklist, true);
596592
}

system/Config/BaseService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ protected static function getSharedInstance(string $key, ...$params)
276276
public static function autoloader(bool $getShared = true)
277277
{
278278
if ($getShared) {
279-
if (! isset(static::$instances['autoloader'])) {
280-
static::$instances['autoloader'] = new Autoloader();
281-
}
279+
static::$instances['autoloader'] ??= new Autoloader();
282280

283281
return static::$instances['autoloader'];
284282
}

system/Database/BaseBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,9 +1488,7 @@ public function orderBy(string $orderBy, string $direction = '', ?bool $escape =
14881488
$direction = in_array($direction, ['ASC', 'DESC'], true) ? ' ' . $direction : '';
14891489
}
14901490

1491-
if ($escape === null) {
1492-
$escape = $this->db->protectIdentifiers;
1493-
}
1491+
$escape ??= $this->db->protectIdentifiers;
14941492

14951493
if ($escape === false) {
14961494
$qbOrderBy[] = [

system/Database/BaseConnection.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,7 @@ private function getBuiltinPropertyTypesMap(array $properties): array
467467
$className = static::class;
468468
$requested = array_fill_keys($properties, true);
469469

470-
if (! isset(self::$propertyBuiltinTypesCache[$className])) {
471-
self::$propertyBuiltinTypesCache[$className] = [];
472-
}
470+
self::$propertyBuiltinTypesCache[$className] ??= [];
473471

474472
// Fill only the properties requested by this call that are not cached yet.
475473
$missing = array_diff_key($requested, self::$propertyBuiltinTypesCache[$className]);
@@ -1867,10 +1865,7 @@ protected function foreignKeyDataToObjects(array $data)
18671865
foreach ($data as $row) {
18681866
$name = $row['constraint_name'];
18691867

1870-
// for sqlite generate name
1871-
if ($name === null) {
1872-
$name = $row['table_name'] . '_' . implode('_', $row['column_name']) . '_foreign';
1873-
}
1868+
$name ??= $row['table_name'] . '_' . implode('_', $row['column_name']) . '_foreign';
18741869

18751870
$obj = new stdClass();
18761871
$obj->constraint_name = $name;

system/Database/BaseUtils.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ public function getCSVFromResult(ResultInterface $query, string $delim = ',', st
233233
public function getXMLFromResult(ResultInterface $query, array $params = []): string
234234
{
235235
foreach (['root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t"] as $key => $val) {
236-
if (! isset($params[$key])) {
237-
$params[$key] = $val;
238-
}
236+
$params[$key] ??= $val;
239237
}
240238

241239
$root = $params['root'];

0 commit comments

Comments
 (0)