diff --git a/composer.json b/composer.json index 08af7d632a0f..49e50bfc7413 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "phpunit/phpcov": "^8.2", "phpunit/phpunit": "^9.1", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "0.16.0", + "rector/rector": "0.17.0", "vimeo/psalm": "^5.0" }, "suggest": { diff --git a/rector.php b/rector.php index d79d47cb3fee..6cb5a5c7e451 100644 --- a/rector.php +++ b/rector.php @@ -12,9 +12,7 @@ use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector; use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector; -use Rector\CodeQuality\Rector\For_\ForToForeachRector; use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector; -use Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector; use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector; use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector; use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector; @@ -125,7 +123,6 @@ $rectorConfig->rule(RemoveAlwaysElseRector::class); $rectorConfig->rule(PassStrictParameterToFunctionParameterRector::class); $rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class); - $rectorConfig->rule(ForToForeachRector::class); $rectorConfig->rule(ChangeNestedForeachIfsToEarlyContinueRector::class); $rectorConfig->rule(ChangeIfElseValueAssignToEarlyReturnRector::class); $rectorConfig->rule(SimplifyStrposLowerRector::class); @@ -140,7 +137,6 @@ $rectorConfig->rule(UnnecessaryTernaryExpressionRector::class); $rectorConfig->rule(RemoveErrorSuppressInTryCatchStmtsRector::class); $rectorConfig->rule(RemoveVarTagFromClassConstantRector::class); - $rectorConfig->rule(AddPregQuoteDelimiterRector::class); $rectorConfig->rule(SimplifyRegexPatternRector::class); $rectorConfig->rule(FuncGetArgsToVariadicParamRector::class); $rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class); diff --git a/system/Common.php b/system/Common.php index 2a98253cb6b4..8d366973f14d 100644 --- a/system/Common.php +++ b/system/Common.php @@ -744,11 +744,7 @@ function is_windows(?bool $mock = null): bool $mocked = $mock; } - if (isset($mocked)) { - return $mocked; - } - - return DIRECTORY_SEPARATOR === '\\'; + return $mocked ?? DIRECTORY_SEPARATOR === '\\'; } } diff --git a/system/Model.php b/system/Model.php index 2df1bb2f5132..80e4bb48a34c 100644 --- a/system/Model.php +++ b/system/Model.php @@ -800,11 +800,7 @@ public function __get(string $name) return parent::__get($name); } - if (isset($this->builder()->{$name})) { - return $this->builder()->{$name}; - } - - return null; + return $this->builder()->{$name} ?? null; } /** diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php index 54704a79e4c1..90b42aec7de8 100644 --- a/tests/system/Database/Live/ForgeTest.php +++ b/tests/system/Database/Live/ForgeTest.php @@ -1513,14 +1513,14 @@ public function testDropKey() public function testAddTextColumnWithConstraint() { // some DBMS do not allow a constraint for type TEXT - $result = $this->forge->addColumn('user', [ + $this->forge->addColumn('user', [ 'text_with_constraint' => ['type' => 'text', 'constraint' => 255, 'default' => ''], ]); $this->assertTrue($this->db->fieldExists('text_with_constraint', 'user')); // SQLSRV requires dropping default constraint before dropping column - $result = $this->forge->dropColumn('user', 'text_with_constraint'); + $this->forge->dropColumn('user', 'text_with_constraint'); $this->db->resetDataCache(); diff --git a/tests/system/HTTP/RedirectResponseTest.php b/tests/system/HTTP/RedirectResponseTest.php index 65fc0e62d03c..5f95b307d8cf 100644 --- a/tests/system/HTTP/RedirectResponseTest.php +++ b/tests/system/HTTP/RedirectResponseTest.php @@ -293,7 +293,7 @@ public function testWithHeadersWithEmptyHeaders() } $response = new RedirectResponse(new App()); - $response = $response->withHeaders(); + $response->withHeaders(); $this->assertEmpty($baseResponse->headers()); } diff --git a/tests/system/Language/LanguageTest.php b/tests/system/Language/LanguageTest.php index 4148a0f4a500..8006ad6cf133 100644 --- a/tests/system/Language/LanguageTest.php +++ b/tests/system/Language/LanguageTest.php @@ -179,7 +179,7 @@ public function testLanguageFileLoadingReturns() $this->assertNotContains('More', $this->lang->loaded()); $this->assertCount(3, $result); - $result = $this->lang->loadem('More', 'en'); + $this->lang->loadem('More', 'en'); $this->assertContains('More', $this->lang->loaded()); $this->assertCount(1, $this->lang->loaded()); }