Skip to content

Commit 813ea2e

Browse files
committed
Updated PHPStan
1 parent 9686cda commit 813ea2e

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

src/Type/PHPUnit/MockBuilderType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Type\PHPUnit;
44

55
use PHPStan\Type\TypeWithClassName;
6+
use PHPStan\Type\VerbosityLevel;
67

78
class MockBuilderType extends \PHPStan\Type\ObjectType
89
{
@@ -24,9 +25,9 @@ public function getMockedClass(): string
2425
return $this->mockedClass;
2526
}
2627

27-
public function describe(): string
28+
public function describe(VerbosityLevel $level): string
2829
{
29-
return sprintf('%s<%s>', parent::describe(), $this->mockedClass);
30+
return sprintf('%s<%s>', parent::describe($level), $this->mockedClass);
3031
}
3132

3233
}

tests/Rules/PHPUnit/AssertSameMethodDifferentTypesRuleTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,55 @@ public function testRule(): void
2828
{
2929
$this->analyse([__DIR__ . '/data/assert-same.php'], [
3030
[
31-
'Call to method PHPUnit\Framework\Assert::assertSame() with string and int(1) will always evaluate to false.',
31+
'Call to method PHPUnit\Framework\Assert::assertSame() with \'1\' and 1 will always evaluate to false.',
3232
10,
3333
],
3434
[
35-
'Call to method PHPUnit\Framework\Assert::assertSame() with string and stdClass will always evaluate to false.',
35+
'Call to method PHPUnit\Framework\Assert::assertSame() with \'1\' and stdClass will always evaluate to false.',
3636
11,
3737
],
3838
[
39-
'Call to method PHPUnit\Framework\Assert::assertSame() with int(1) and string will always evaluate to false.',
39+
'Call to method PHPUnit\Framework\Assert::assertSame() with 1 and string will always evaluate to false.',
4040
12,
4141
],
4242
[
43-
'Call to method PHPUnit\Framework\Assert::assertSame() with string and int will always evaluate to false.',
43+
'Call to method PHPUnit\Framework\Assert::assertSame() with \'1\' and int will always evaluate to false.',
4444
13,
4545
],
4646
[
47-
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0)|int(1), string> and array<int(0)|int(1), int(1)|int(2)> will always evaluate to false.',
47+
'Call to method PHPUnit\Framework\Assert::assertSame() with array(\'a\', \'b\') and array(1, 2) will always evaluate to false.',
4848
14,
4949
],
5050
[
5151
'Call to method PHPUnit\Framework\Assert::assertSame() with array<string> and array<int> will always evaluate to false.',
5252
39,
5353
],
5454
[
55-
'Call to method PHPUnit\Framework\Assert::assertSame() with int(1) and int(1) will always evaluate to true.',
55+
'Call to method PHPUnit\Framework\Assert::assertSame() with 1 and 1 will always evaluate to true.',
5656
44,
5757
],
5858
[
59-
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0), string> and array<int(0)|int(1), string> will always evaluate to false.',
59+
'Call to method PHPUnit\Framework\Assert::assertSame() with array(\'a\') and array(\'a\', \'b\') will always evaluate to false.',
6060
45,
6161
],
6262
[
63-
'Call to method PHPUnit\Framework\Assert::assertSame() with string and string will always evaluate to true.',
63+
'Call to method PHPUnit\Framework\Assert::assertSame() with \'1\' and \'1\' will always evaluate to true.',
6464
46,
6565
],
6666
[
67-
'Call to method PHPUnit\Framework\Assert::assertSame() with string and string will always evaluate to false.',
67+
'Call to method PHPUnit\Framework\Assert::assertSame() with \'1\' and \'2\' will always evaluate to false.',
6868
47,
6969
],
7070
[
7171
'Call to method PHPUnit\Framework\Assert::assertSame() with stdClass and stdClass will always evaluate to true.',
7272
48,
7373
],
7474
[
75-
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0), string> and array<int(0)|int(1), int(1)|string> will always evaluate to false.',
75+
'Call to method PHPUnit\Framework\Assert::assertSame() with array(\'a\') and array(\'a\', 1) will always evaluate to false.',
7676
51,
7777
],
7878
[
79-
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0)|int(1)|int(2), float(3.000000)|int(2)|string> and array<int(0)|int(1), int(1)|string> will always evaluate to false.',
79+
'Call to method PHPUnit\Framework\Assert::assertSame() with array(\'a\', 2, 3.0) and array(\'a\', 1) will always evaluate to false.',
8080
52,
8181
],
8282
]);

tests/Rules/PHPUnit/AssertSameStaticMethodDifferentTypesRuleTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ public function testRule(): void
2828
{
2929
$this->analyse([__DIR__ . '/data/assert-same.php'], [
3030
[
31-
'Call to static method PHPUnit\Framework\Assert::assertSame() with string and int(2) will always evaluate to false.',
31+
'Call to static method PHPUnit\Framework\Assert::assertSame() with \'1\' and 2 will always evaluate to false.',
3232
16,
3333
],
3434
[
35-
'Call to static method PHPUnit\Framework\Assert::assertSame() with string and int(2) will always evaluate to false.',
35+
'Call to static method PHPUnit\Framework\Assert::assertSame() with \'1\' and 2 will always evaluate to false.',
3636
17,
3737
],
3838
[
39-
'Call to static method PHPUnit\Framework\Assert::assertSame() with string and int(2) will always evaluate to false.',
39+
'Call to static method PHPUnit\Framework\Assert::assertSame() with \'1\' and 2 will always evaluate to false.',
4040
18,
4141
],
4242
[
43-
'Call to static method PHPUnit\Framework\Assert::assertSame() with int(1) and int(2) will always evaluate to false.',
43+
'Call to static method PHPUnit\Framework\Assert::assertSame() with 1 and 2 will always evaluate to false.',
4444
53,
4545
],
4646
[
47-
'Call to static method PHPUnit\Framework\Assert::assertSame() with int(1) and int(2) will always evaluate to false.',
47+
'Call to static method PHPUnit\Framework\Assert::assertSame() with 1 and 2 will always evaluate to false.',
4848
54,
4949
],
5050
[
51-
'Call to static method PHPUnit\Framework\Assert::assertSame() with int(1) and int(2) will always evaluate to false.',
51+
'Call to static method PHPUnit\Framework\Assert::assertSame() with 1 and 2 will always evaluate to false.',
5252
55,
5353
],
5454
]);

0 commit comments

Comments
 (0)