Skip to content

Commit 11f792e

Browse files
committed
docs: fix phpstan errors on TestLogger
1 parent 9200417 commit 11f792e

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3491,21 +3491,6 @@
34913491
'count' => 1,
34923492
'path' => __DIR__ . '/system/Test/PhpStreamWrapper.php',
34933493
];
3494-
$ignoreErrors[] = [
3495-
'message' => '#^Method CodeIgniter\\\\Test\\\\TestLogger\\:\\:cleanup\\(\\) has no return type specified\\.$#',
3496-
'count' => 1,
3497-
'path' => __DIR__ . '/system/Test/TestLogger.php',
3498-
];
3499-
$ignoreErrors[] = [
3500-
'message' => '#^Parameter \\#1 \\$level \\(string\\) of method CodeIgniter\\\\Test\\\\TestLogger\\:\\:log\\(\\) should be contravariant with parameter \\$level \\(mixed\\) of method Psr\\\\Log\\\\LoggerInterface\\:\\:log\\(\\)$#',
3501-
'count' => 1,
3502-
'path' => __DIR__ . '/system/Test/TestLogger.php',
3503-
];
3504-
$ignoreErrors[] = [
3505-
'message' => '#^Property CodeIgniter\\\\Test\\\\TestLogger\\:\\:\\$op_logs has no type specified\\.$#',
3506-
'count' => 1,
3507-
'path' => __DIR__ . '/system/Test/TestLogger.php',
3508-
];
35093494
$ignoreErrors[] = [
35103495
'message' => '#^Method CodeIgniter\\\\Test\\\\TestResponse\\:\\:__call\\(\\) should return mixed but return statement is missing\\.$#',
35113496
'count' => 1,

system/Test/TestLogger.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
*/
1919
class TestLogger extends Logger
2020
{
21+
/**
22+
* @var list<array{level: mixed, message: string, file: string|null}>
23+
*/
2124
protected static $op_logs = [];
2225

2326
/**
2427
* The log method is overridden so that we can store log history during
2528
* the tests to allow us to check ->assertLogged() methods.
2629
*
27-
* @param string $level
30+
* @param mixed $level
2831
* @param string $message
2932
*/
3033
public function log($level, $message, array $context = []): bool
@@ -92,6 +95,8 @@ public static function didLog(string $level, $message, bool $useExactComparison
9295
*
9396
* @param string $file
9497
*
98+
* @return string
99+
*
95100
* @deprecated No longer needed as underlying protected method is also deprecated.
96101
*/
97102
public function cleanup($file)

0 commit comments

Comments
 (0)