Skip to content

Update rector/rector requirement from 0.11.48 to 0.11.49 #5018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"phpstan/phpstan": "^0.12.91",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1",
"rector/rector": "0.11.48",
"rector/rector": "0.11.49",
"symplify/package-builder": "^9.3"
},
"suggest": {
Expand Down
22 changes: 6 additions & 16 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
use Rector\DeadCode\Rector\Cast\RecastingRemovalRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\DeadCode\Rector\Expression\RemoveDeadStmtRector;
use Rector\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector;
use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector;
use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector;
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
Expand Down Expand Up @@ -78,9 +76,6 @@
// requires php 8
RemoveUnusedPromotedPropertyRector::class,

// currently buggy on call inside assign, wait for next release
RemoveParentCallWithoutParentRector::class,

// private method called via getPrivateMethodInvoker
RemoveUnusedPrivateMethodRector::class => [
__DIR__ . '/system/Entity/Entity.php',
Expand All @@ -92,21 +87,11 @@
__DIR__ . '/tests',
],

// currently buggy on class implements ArrayAccess, wait for next release
RemoveDeadStmtRector::class => [
__DIR__ . '/tests/system/Cookie/CookieTest.php',
],

// check on constant compare
UnwrapFutureCompatibleIfPhpVersionRector::class => [
__DIR__ . '/system/CodeIgniter.php',
],

// check context ResponseTrait
RemoveUselessReturnTagRector::class => [
__DIR__ . '/system/HTTP/MessageTrait.php',
],

// casted to Entity via EntityTest->getCastEntity()
RecastingRemovalRector::class => [
__DIR__ . '/tests/system/Entity/EntityTest.php',
Expand All @@ -116,6 +101,11 @@
UnderscoreToCamelCaseVariableNameRector::class => [
__DIR__ . '/system/Session/Handlers',
],

// check on $_SESSION
RemoveUnusedNonEmptyArrayBeforeForeachRector::class => [
__DIR__ . '/system/Debug/Toolbar.php',
],
]);

// auto import fully qualified class names
Expand Down
32 changes: 14 additions & 18 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,9 @@ function force_https(int $duration = 31536000, ?RequestInterface $request = null
$baseURL = config(App::class)->baseURL;

if (strpos($baseURL, 'https://') === 0) {
$baseURL = (string) substr($baseURL, strlen('https://'));
$baseURL = substr($baseURL, strlen('https://'));
} elseif (strpos($baseURL, 'http://') === 0) {
$baseURL = (string) substr($baseURL, strlen('http://'));
$baseURL = substr($baseURL, strlen('http://'));
}

$uri = URI::createURIString(
Expand Down Expand Up @@ -601,18 +601,16 @@ function helper($filenames)
else {
$paths = $loader->search('Helpers/' . $filename);

if (! empty($paths)) {
foreach ($paths as $path) {
if (strpos($path, APPPATH) === 0) {
// @codeCoverageIgnoreStart
$appHelper = $path;
// @codeCoverageIgnoreEnd
} elseif (strpos($path, SYSTEMPATH) === 0) {
$systemHelper = $path;
} else {
$localIncludes[] = $path;
$loaded[] = $filename;
}
foreach ($paths as $path) {
if (strpos($path, APPPATH) === 0) {
// @codeCoverageIgnoreStart
$appHelper = $path;
// @codeCoverageIgnoreEnd
} elseif (strpos($path, SYSTEMPATH) === 0) {
$systemHelper = $path;
} else {
$localIncludes[] = $path;
$loaded[] = $filename;
}
}

Expand All @@ -636,10 +634,8 @@ function helper($filenames)
}

// Now actually include all of the files
if (! empty($includes)) {
foreach ($includes as $path) {
include_once $path;
}
foreach ($includes as $path) {
include_once $path;
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions system/Test/DatabaseTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,10 @@ public static function resetMigrationSeedCount()
*/
protected function clearInsertCache()
{
if (! empty($this->insertCache)) {
foreach ($this->insertCache as $row) {
$this->db->table($row[0])
->where($row[1])
->delete();
}
foreach ($this->insertCache as $row) {
$this->db->table($row[0])
->where($row[1])
->delete();
}
}

Expand Down
6 changes: 2 additions & 4 deletions system/Test/FeatureTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,8 @@ protected function setupRequest(string $method, ?string $path = null): IncomingR
*/
protected function setupHeaders(IncomingRequest $request)
{
if (! empty($this->headers)) {
foreach ($this->headers as $name => $value) {
$request->setHeader($name, $value);
}
foreach ($this->headers as $name => $value) {
$request->setHeader($name, $value);
}

return $request;
Expand Down