Skip to content

Commit 4f3f514

Browse files
committed
fix phpstan
1 parent 581e561 commit 4f3f514

File tree

3 files changed

+46
-9
lines changed

3 files changed

+46
-9
lines changed

phpstan-baseline.neon

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Parameter \#1 \$array of function usort contains unresolvable type\.$#'
5+
identifier: argument.unresolvableType
6+
count: 1
7+
path: src/Commands/Lister.php
8+
9+
-
10+
message: '#^Parameter \#2 \$callback of function usort contains unresolvable type\.$#'
11+
identifier: argument.unresolvableType
12+
count: 1
13+
path: src/Commands/Lister.php
14+
15+
-
16+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''CodeIgniter\\\\I18n\\\\Time'' and CodeIgniter\\I18n\\Time will always evaluate to true\.$#'
17+
identifier: method.alreadyNarrowedType
18+
count: 1
19+
path: tests/unit/CronExpressionTest.php
20+
21+
-
22+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Closure'' and Closure\(\)\: ''Hello'' will always evaluate to true\.$#'
23+
identifier: method.alreadyNarrowedType
24+
count: 1
25+
path: tests/unit/SchedulerTest.php
26+
27+
-
28+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''CodeIgniter\\\\Tasks\\\\Task'' and CodeIgniter\\Tasks\\Task will always evaluate to true\.$#'
29+
identifier: method.alreadyNarrowedType
30+
count: 3
31+
path: tests/unit/SchedulerTest.php
32+
33+
-
34+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''Hello'' and ''Hello'' will always evaluate to true\.$#'
35+
identifier: method.alreadyNarrowedType
36+
count: 1
37+
path: tests/unit/SchedulerTest.php

phpstan.neon.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
includes:
2+
- phpstan-baseline.neon
13
parameters:
24
tmpDir: build/phpstan
35
level: 5
@@ -7,8 +9,6 @@ parameters:
79
bootstrapFiles:
810
- vendor/codeigniter4/framework/system/Test/bootstrap.php
911
excludePaths:
10-
- src/Config/Routes.php
11-
- src/Views/*
1212
universalObjectCratesClasses:
1313
- CodeIgniter\Entity
1414
- CodeIgniter\Entity\Entity

src/RunResolver.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ protected function convertDOWToNumbers(string $origValue): string
207207
}
208208

209209
$days = [
210-
'sun' => 0,
211-
'mon' => 1,
212-
'tue' => 2,
213-
'wed' => 3,
214-
'thu' => 4,
215-
'fri' => 5,
216-
'sat' => 6,
210+
'sun' => '0',
211+
'mon' => '1',
212+
'tue' => '2',
213+
'wed' => '3',
214+
'thu' => '4',
215+
'fri' => '5',
216+
'sat' => '6',
217217
];
218218

219219
return str_replace(array_keys($days), array_values($days), $origValue);

0 commit comments

Comments
 (0)