Skip to content

Commit 7cd64b5

Browse files
authored
Merge branch 'develop' into fix-9727
2 parents 685c3b4 + aac5afa commit 7cd64b5

33 files changed

+166
-103
lines changed

rector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
1616
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
1717
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
18-
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
1918
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
2019
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
2120
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
@@ -183,7 +182,6 @@
183182
InlineIfToExplicitIfRector::class,
184183
PreparedValueToEarlyReturnRector::class,
185184
UnusedForeachValueToArrayKeysRector::class,
186-
ChangeArrayPushToArrayAssignRector::class,
187185
RemoveErrorSuppressInTryCatchStmtsRector::class,
188186
FuncGetArgsToVariadicParamRector::class,
189187
MakeInheritedMethodVisibilitySameAsParentRector::class,
@@ -204,4 +202,4 @@
204202
// keep '\\' prefix string on string '\Foo\Bar'
205203
StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
206204
])
207-
->withCodeQualityLevel(34);
205+
->withCodeQualityLevel(40);

system/CLI/BaseCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function showHelp()
142142
{
143143
CLI::write(lang('CLI.helpUsage'), 'yellow');
144144

145-
if (isset($this->usage)) {
145+
if ($this->usage !== null) {
146146
$usage = $this->usage;
147147
} else {
148148
$usage = $this->name;
@@ -154,7 +154,7 @@ public function showHelp()
154154

155155
CLI::write($this->setPad($usage, 0, 0, 2));
156156

157-
if (isset($this->description)) {
157+
if ($this->description !== null) {
158158
CLI::newLine();
159159
CLI::write(lang('CLI.helpDescription'), 'yellow');
160160
CLI::write($this->setPad($this->description, 0, 0, 2));

system/CLI/Commands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function discoverCommands()
129129

130130
$class = new $className($this->logger, $this);
131131

132-
if (isset($class->group) && ! isset($this->commands[$class->name])) {
132+
if ($class->group !== null && ! isset($this->commands[$class->name])) {
133133
$this->commands[$class->name] = [
134134
'class' => $className,
135135
'file' => $file,

system/Database/MySQLi/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function connect(bool $persistent = false)
123123
$this->mysqli->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);
124124
}
125125

126-
if (isset($this->strictOn)) {
126+
if ($this->strictOn !== null) {
127127
if ($this->strictOn) {
128128
$this->mysqli->options(
129129
MYSQLI_INIT_COMMAND,

system/Database/SQLite3/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function connect(bool $persistent = false)
107107
$this->database = WRITEPATH . $this->database;
108108
}
109109

110-
$sqlite = (! isset($this->password) || $this->password !== '')
110+
$sqlite = ($this->password === null || $this->password === '')
111111
? new SQLite3($this->database)
112112
: new SQLite3($this->database, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $this->password);
113113

system/Debug/Toolbar/Collectors/Logs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Logs extends BaseCollector
4747
*
4848
* @var list<array{level: string, msg: string}>
4949
*/
50-
protected $data;
50+
protected $data = [];
5151

5252
/**
5353
* Returns the data of this collector to be formatted in the toolbar.
@@ -68,7 +68,7 @@ public function isEmpty(): bool
6868
{
6969
$this->collectLogs();
7070

71-
return $this->data !== [];
71+
return $this->data === [];
7272
}
7373

7474
/**

system/Test/FeatureTestTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ protected function populateGlobals(string $name, Request $request, ?array $param
404404
);
405405
}
406406

407-
$_SESSION = $this->session ?? [];
407+
$_SESSION = $this->session;
408408

409409
return $request;
410410
}

system/Test/Mock/MockCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function get(string $key)
6262
{
6363
$key = static::validateKey($key, $this->prefix);
6464

65-
return array_key_exists($key, $this->cache) ? $this->cache[$key] : null;
65+
return $this->cache[$key] ?? null;
6666
}
6767

6868
/**

system/Validation/FormatRules.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,13 @@ public function valid_base64($str = null): bool
284284
$str = (string) $str;
285285
}
286286

287-
return base64_encode(base64_decode($str, true)) === $str;
287+
$decoded = base64_decode($str, true);
288+
289+
if ($decoded === false) {
290+
return false;
291+
}
292+
293+
return base64_encode($decoded) === $str;
288294
}
289295

290296
/**

tests/_support/Entity/CustomUser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ private function __construct(
3838
) {
3939
}
4040

41+
/**
42+
* @param array<string, int|list<string>|string|Time|null> $data
43+
*/
4144
public static function reconstruct(array $data): static
4245
{
4346
return new self(

0 commit comments

Comments
 (0)