Skip to content

Commit d840ee2

Browse files
authored
Merge pull request #6338 from codeigniter4/dependabot/composer/rector/rector-0.13.10
chore(deps-dev): update rector/rector requirement from 0.13.9 to 0.13.10
2 parents 8b77bf2 + 3b39f26 commit d840ee2

File tree

8 files changed

+12
-31
lines changed

8 files changed

+12
-31
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpstan/phpstan": "^1.7.1",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",
27-
"rector/rector": "0.13.9"
27+
"rector/rector": "0.13.10"
2828
},
2929
"suggest": {
3030
"ext-fileinfo": "Improves mime type detection for files"

phpstan-baseline.neon.dist

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ parameters:
7070
count: 1
7171
path: system/Cache/Handlers/MemcachedHandler.php
7272

73-
-
74-
message: "#^Variable \\$config in empty\\(\\) always exists and is not falsy\\.$#"
75-
count: 1
76-
path: system/Cache/Handlers/MemcachedHandler.php
77-
7873
-
7974
message: "#^Variable \\$data might not be defined\\.$#"
8075
count: 1
@@ -90,11 +85,6 @@ parameters:
9085
count: 1
9186
path: system/Cache/Handlers/RedisHandler.php
9287

93-
-
94-
message: "#^Variable \\$config in empty\\(\\) always exists and is not falsy\\.$#"
95-
count: 1
96-
path: system/Cache/Handlers/RedisHandler.php
97-
9888
-
9989
message: "#^Call to an undefined method CodeIgniter\\\\HTTP\\\\Request\\:\\:getPost\\(\\)\\.$#"
10090
count: 1

rector.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
3333
use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector;
3434
use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector;
35-
use Rector\DeadCode\Rector\Plus\RemoveDeadZeroAndOneOperationRector;
3635
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
3736
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
3837
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
@@ -132,11 +131,11 @@
132131
__DIR__ . '/tests/system/Email/EmailTest.php',
133132
],
134133

135-
// buggy on read based on @var on property
136-
RemoveAlwaysTrueIfConditionRector::class,
137-
138-
// buggy on string * int
139-
RemoveDeadZeroAndOneOperationRector::class,
134+
// buggy on read based on @var on property on Trait
135+
RemoveAlwaysTrueIfConditionRector::class => [
136+
'**Trait.php',
137+
__DIR__ . '/system/Test/ControllerTester.php',
138+
],
140139
]);
141140

142141
// auto import fully qualified class names

system/Autoloader/Autoloader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ public function register()
141141

142142
// Load our non-class files
143143
foreach ($this->files as $file) {
144-
if (is_string($file)) {
145-
$this->includeFile($file);
146-
}
144+
$this->includeFile($file);
147145
}
148146
}
149147

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ public function __construct(Cache $config)
4545
{
4646
$this->prefix = $config->prefix;
4747

48-
if (! empty($config)) {
49-
$this->config = array_merge($this->config, $config->memcached);
50-
}
48+
$this->config = array_merge($this->config, $config->memcached);
5149
}
5250

5351
/**

system/Cache/Handlers/RedisHandler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ public function __construct(Cache $config)
4545
{
4646
$this->prefix = $config->prefix;
4747

48-
if (! empty($config)) {
49-
$this->config = array_merge($this->config, $config->redis);
50-
}
48+
$this->config = array_merge($this->config, $config->redis);
5149
}
5250

5351
/**

system/Database/Forge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ public function modifyColumn(string $table, $field): bool
764764
return false;
765765
}
766766

767-
if ($sqls !== null) {
767+
if (is_array($sqls)) {
768768
foreach ($sqls as $sql) {
769769
if ($this->db->query($sql) === false) {
770770
return false;

system/Helpers/form_helper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s
6363
$form .= csrf_field($csrfId ?? null);
6464
}
6565

66-
if (is_array($hidden)) {
67-
foreach ($hidden as $name => $value) {
68-
$form .= form_hidden($name, $value);
69-
}
66+
foreach ($hidden as $name => $value) {
67+
$form .= form_hidden($name, $value);
7068
}
7169

7270
return $form;

0 commit comments

Comments
 (0)