Skip to content

Commit 11c0d93

Browse files
authored
Merge branch 'develop' into fix-debug-toolbar-logs
2 parents bf80e0f + a022c90 commit 11c0d93

24 files changed

+73
-87
lines changed

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/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/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/system/Commands/BaseCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public function testMagicIssetTrue(): void
3636
{
3737
$command = new AppInfo($this->logger, service('commands'));
3838

39-
$this->assertTrue(isset($command->group));
39+
$this->assertSame($command->group !== null, isset($command->group)); // @phpstan-ignore isset.property
4040
}
4141

4242
public function testMagicIssetFalse(): void
4343
{
4444
$command = new AppInfo($this->logger, service('commands'));
4545

46-
$this->assertFalse(isset($command->foobar));
46+
$this->assertFalse(isset($command->foobar)); // @phpstan-ignore property.notFound
4747
}
4848

4949
public function testMagicGet(): void
@@ -57,6 +57,6 @@ public function testMagicGetMissing(): void
5757
{
5858
$command = new AppInfo($this->logger, service('commands'));
5959

60-
$this->assertNull($command->foobar);
60+
$this->assertNull($command->foobar); // @phpstan-ignore property.notFound
6161
}
6262
}

tests/system/Database/BaseConnectionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ public function testMagicIssetTrue(): void
169169
{
170170
$db = new MockConnection($this->options);
171171

172-
$this->assertTrue(isset($db->charset));
172+
$this->assertSame($db->charset !== null, isset($db->charset)); // @phpstan-ignore isset.property
173173
}
174174

175175
public function testMagicIssetFalse(): void
176176
{
177177
$db = new MockConnection($this->options);
178178

179-
$this->assertFalse(isset($db->foobar));
179+
$this->assertFalse(isset($db->foobar)); // @phpstan-ignore property.notFound
180180
}
181181

182182
public function testMagicGet(): void
@@ -190,7 +190,7 @@ public function testMagicGetMissing(): void
190190
{
191191
$db = new MockConnection($this->options);
192192

193-
$this->assertNull($db->foobar);
193+
$this->assertNull($db->foobar); // @phpstan-ignore property.notFound
194194
}
195195

196196
/**

tests/system/I18n/TimeDifferenceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function testGetterUTC(): void
245245
$this->assertSame(8, $diff->getDays());
246246
$this->assertSame(8, $diff->days);
247247
$this->assertSame(-8, (int) round($diff->getDays(true)));
248-
$this->assertNull($diff->nonsense);
248+
$this->assertNull($diff->nonsense); // @phpstan-ignore property.notFound
249249
}
250250

251251
public function testGetterDST(): void
@@ -259,23 +259,23 @@ public function testGetterDST(): void
259259

260260
// The raw value does not take Daylight Saving Time into account.
261261
$this->assertSame(-8, (int) round($diff->getDays(true)));
262-
$this->assertNull($diff->nonsense);
262+
$this->assertNull($diff->nonsense); // @phpstan-ignore property.notFound
263263
}
264264

265265
public function testMagicIssetTrue(): void
266266
{
267267
$current = Time::parse('March 10, 2017', 'America/Chicago');
268268
$diff = $current->difference('March 18, 2017', 'America/Chicago');
269269

270-
$this->assertTrue(isset($diff->days));
271-
$this->assertFalse(isset($diff->nonsense));
270+
$this->assertTrue(isset($diff->days)); // @phpstan-ignore isset.property
271+
$this->assertFalse(isset($diff->nonsense)); // @phpstan-ignore property.notFound
272272
}
273273

274274
public function testMagicIssetFalse(): void
275275
{
276276
$current = Time::parse('March 10, 2017', 'America/Chicago');
277277
$diff = $current->difference('March 18, 2017', 'America/Chicago');
278278

279-
$this->assertFalse(isset($diff->nonsense));
279+
$this->assertFalse(isset($diff->nonsense)); // @phpstan-ignore property.notFound
280280
}
281281
}

tests/system/Validation/CreditCardRulesTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
final class CreditCardRulesTest extends StrictCreditCardRulesTest
2525
{
2626
protected Validation $validation;
27+
28+
/**
29+
* @var array<string, array<int|string, array<string, string>|string>>
30+
*/
2731
protected array $config = [
2832
'ruleSets' => [
2933
Rules::class,

0 commit comments

Comments
 (0)