Skip to content

Commit 69b2e2f

Browse files
committed
Fix issues detected by PHPStan
1 parent 682f65b commit 69b2e2f

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

phpstan-baseline.neon

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#"
4+
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
5+
identifier: method.unresolvableReturnType
56
count: 2
67
path: tests/Unit/BaselineBuilderTest.php
78

89
-
9-
message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#"
10+
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
11+
identifier: method.unresolvableReturnType
1012
count: 4
1113
path: tests/Unit/BaselineTransformer/AwareTransformerTest.php
1214

1315
-
14-
message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#"
16+
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
17+
identifier: method.unresolvableReturnType
1518
count: 2
1619
path: tests/Unit/ComparatorTest.php
1720

1821
-
19-
message: "#^Trying to mock an undefined method read\\(\\) on class \\.$#"
20-
count: 2
21-
path: tests/Unit/ComparatorTest.php
22-
23-
-
24-
message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#"
25-
count: 1
26-
path: tests/Unit/Model/ConsoleTableTest.php
27-
28-
-
29-
message: "#^Trying to mock an undefined method getValues\\(\\) on class \\.$#"
22+
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
23+
identifier: method.unresolvableReturnType
3024
count: 1
3125
path: tests/Unit/Model/ConsoleTableTest.php
3226

3327
-
34-
message: "#^Expression \"\\$coverage\\['any_key'\\]\" on a separate line does not do anything\\.$#"
28+
message: '#^Expression "\$coverage\[''any_key''\]" on a separate line does not do anything\.$#'
29+
identifier: expr.resultUnused
3530
count: 2
3631
path: tests/Unit/Model/CoverageTest.php
3732

3833
-
39-
message: "#^Return type of call to method PHPUnit\\\\Framework\\\\TestCase\\:\\:createMock\\(\\) contains unresolvable type\\.$#"
34+
message: '#^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$#'
35+
identifier: method.unresolvableReturnType
4036
count: 2
4137
path: tests/Unit/Reader/BaselineTransformingReaderTest.php
4238

4339
-
44-
message: "#^Call to an undefined static method PHPUnit\\\\Framework\\\\TestCase\\:\\:expectExceptionMessageMatches\\(\\)\\.$#"
40+
message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectExceptionMess…'' will always evaluate to true\.$#'
41+
identifier: function.alreadyNarrowedType
4542
count: 1
4643
path: tests/Unit/UnitTestCase.php
4744

4845
-
49-
message: "#^Call to an undefined static method PHPUnit\\\\Framework\\\\TestCase\\:\\:expectWarning\\(\\)\\.$#"
46+
message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectWarning'' will always evaluate to true\.$#'
47+
identifier: function.alreadyNarrowedType
5048
count: 1
5149
path: tests/Unit/UnitTestCase.php
5250

5351
-
54-
message: "#^Call to an undefined static method PHPUnit\\\\Framework\\\\TestCase\\:\\:expectWarningMessageMatches\\(\\)\\.$#"
52+
message: '#^Call to function method_exists\(\) with ''PHPUnit\\\\Framework\\\\TestCase'' and ''expectWarningMessag…'' will always evaluate to true\.$#'
53+
identifier: function.alreadyNarrowedType
5554
count: 1
5655
path: tests/Unit/UnitTestCase.php
5756

5857
-
59-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
58+
message: '#^Parameter \#1 \$json of function json_decode expects string, string\|false given\.$#'
59+
identifier: argument.type
6060
count: 1
6161
path: tests/Unit/Writer/BaselineWriterTest.php
6262

src/Model/Coverage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public function offsetGet($offset): float
5656
/**
5757
* @param string $offset
5858
* @param numeric $value
59+
*
60+
* @phpstan-param mixed $value
5961
*/
6062
public function offsetSet($offset, $value): void
6163
{

0 commit comments

Comments
 (0)