Skip to content

Commit 627df8c

Browse files
committed
Add phpstan-strict-rules
1 parent b838a16 commit 627df8c

File tree

4 files changed

+64
-9
lines changed

4 files changed

+64
-9
lines changed

Tests/Tests.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testGetInfo( string $RawInput, array $ExpectedOutput ) : void
153153

154154
$RealOutput = $this->SourceQuery->GetInfo();
155155

156-
$this->assertEquals( $ExpectedOutput, $RealOutput );
156+
self::assertEquals( $ExpectedOutput, $RealOutput );
157157
}
158158

159159
public static function InfoProvider() : array
@@ -243,10 +243,10 @@ public function testGetChallengeTwice( ) : void
243243
{
244244
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
245245
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x45\x01\x00ayy\x00lmao\x00" );
246-
$this->assertEquals( [ 'ayy' => 'lmao' ], $this->SourceQuery->GetRules() );
246+
self::assertEquals( [ 'ayy' => 'lmao' ], $this->SourceQuery->GetRules() );
247247

248248
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x45\x01\x00wow\x00much\x00" );
249-
$this->assertEquals( [ 'wow' => 'much' ], $this->SourceQuery->GetRules() );
249+
self::assertEquals( [ 'wow' => 'much' ], $this->SourceQuery->GetRules() );
250250
}
251251

252252
/**
@@ -264,7 +264,7 @@ public function testGetRules( array $RawInput, array $ExpectedOutput ) : void
264264

265265
$RealOutput = $this->SourceQuery->GetRules();
266266

267-
$this->assertEquals( $ExpectedOutput, $RealOutput );
267+
self::assertEquals( $ExpectedOutput, $RealOutput );
268268
}
269269

270270
public static function RulesProvider() : array
@@ -305,7 +305,7 @@ public function testGetPlayers( array $RawInput, array $ExpectedOutput ) : void
305305

306306
$RealOutput = $this->SourceQuery->GetPlayers();
307307

308-
$this->assertEquals( $ExpectedOutput, $RealOutput );
308+
self::assertEquals( $ExpectedOutput, $RealOutput );
309309
}
310310

311311
public static function PlayersProvider() : array
@@ -334,9 +334,9 @@ public static function PlayersProvider() : array
334334
public function testPing() : void
335335
{
336336
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x6A\x00");
337-
$this->assertTrue( $this->SourceQuery->Ping() );
337+
self::assertTrue( $this->SourceQuery->Ping() );
338338

339339
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\xEE");
340-
$this->assertFalse( $this->SourceQuery->Ping() );
340+
self::assertFalse( $this->SourceQuery->Ping() );
341341
}
342342
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"require-dev":
3434
{
3535
"phpunit/phpunit": "^10.3",
36-
"phpstan/phpstan": "^1.10"
36+
"phpstan/phpstan": "^1.10",
37+
"phpstan/phpstan-strict-rules": "^1.6"
3738
},
3839
"autoload":
3940
{

composer.lock

Lines changed: 50 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
includes:
2+
- vendor/phpstan/phpstan-strict-rules/rules.neon
13
parameters:
24
checkFunctionNameCase: true
35
level: 7
46
paths:
57
- .
68
excludePaths:
79
- vendor
10+
strictRules:
11+
booleansInConditions: false
12+
disallowedConstructs: false
813
ignoreErrors:
914
-
1015
identifier: missingType.iterableValue

0 commit comments

Comments
 (0)