Skip to content

Commit 7f0a32c

Browse files
committed
Test php 8.3 (drop 8.0); set phpstan/psalm baselines
1 parent f82a59f commit 7f0a32c

File tree

5 files changed

+116
-5
lines changed

5 files changed

+116
-5
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
php: ['8.0', '8.1', '8.2']
13+
php: ['8.1', '8.2', '8.3']
1414
steps:
1515
- name: Setup PHP
1616
uses: shivammathur/setup-php@v2
@@ -20,8 +20,8 @@ jobs:
2020
- name: Install dependencies
2121
run: composer install --no-interaction --no-progress
2222
- name: Run tests
23-
run: php vendor/bin/phpunit --configuration Tests/phpunit.xml --fail-on-warning
23+
run: composer run phpunit
2424
- name: Run phpstan
25-
run: php vendor/bin/phpstan
25+
run: composer run phpstan
2626
- name: Run psalm
27-
run: php vendor/bin/psalm
27+
run: composer run psalm

Tests/psalm-baseline.xml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
3+
<file src="SourceQuery/BaseSocket.php">
4+
<MissingConstructor>
5+
<code><![CDATA[$Address]]></code>
6+
<code><![CDATA[$Engine]]></code>
7+
<code><![CDATA[$Port]]></code>
8+
<code><![CDATA[$Timeout]]></code>
9+
</MissingConstructor>
10+
<PossiblyUnusedReturnValue>
11+
<code><![CDATA[Buffer]]></code>
12+
<code><![CDATA[bool]]></code>
13+
</PossiblyUnusedReturnValue>
14+
<UnusedVariable>
15+
<code><![CDATA[$ReadMore]]></code>
16+
</UnusedVariable>
17+
</file>
18+
<file src="SourceQuery/GoldSourceRcon.php">
19+
<PossiblyNullArgument>
20+
<code><![CDATA[$this->Socket->Socket]]></code>
21+
</PossiblyNullArgument>
22+
<PossiblyUnusedParam>
23+
<code><![CDATA[$Header]]></code>
24+
<code><![CDATA[$Length]]></code>
25+
</PossiblyUnusedParam>
26+
<PossiblyUnusedReturnValue>
27+
<code><![CDATA[bool]]></code>
28+
</PossiblyUnusedReturnValue>
29+
<UnusedVariable>
30+
<code><![CDATA[$ReadMore]]></code>
31+
</UnusedVariable>
32+
</file>
33+
<file src="SourceQuery/Socket.php">
34+
<InvalidPropertyAssignmentValue>
35+
<code><![CDATA[$this->Socket]]></code>
36+
</InvalidPropertyAssignmentValue>
37+
<PossiblyNullArgument>
38+
<code><![CDATA[$this->Socket]]></code>
39+
<code><![CDATA[$this->Socket]]></code>
40+
<code><![CDATA[$this->Socket]]></code>
41+
</PossiblyNullArgument>
42+
<PossiblyUnusedReturnValue>
43+
<code><![CDATA[bool]]></code>
44+
</PossiblyUnusedReturnValue>
45+
</file>
46+
<file src="SourceQuery/SourceQuery.php">
47+
<PossiblyUnusedMethod>
48+
<code><![CDATA[SetUseOldGetChallengeMethod]]></code>
49+
</PossiblyUnusedMethod>
50+
<PossiblyUnusedReturnValue>
51+
<code><![CDATA[string]]></code>
52+
</PossiblyUnusedReturnValue>
53+
<UnusedVariable>
54+
<code><![CDATA[$SteamID]]></code>
55+
</UnusedVariable>
56+
</file>
57+
<file src="SourceQuery/SourceRcon.php">
58+
<InvalidPropertyAssignmentValue>
59+
<code><![CDATA[$this->RconSocket]]></code>
60+
</InvalidPropertyAssignmentValue>
61+
<PossiblyNullArgument>
62+
<code><![CDATA[$this->RconSocket]]></code>
63+
<code><![CDATA[$this->RconSocket]]></code>
64+
<code><![CDATA[$this->RconSocket]]></code>
65+
<code><![CDATA[$this->RconSocket]]></code>
66+
</PossiblyNullArgument>
67+
<PossiblyUnusedReturnValue>
68+
<code><![CDATA[bool]]></code>
69+
</PossiblyUnusedReturnValue>
70+
</file>
71+
<file src="Tests/Tests.php">
72+
<MixedPropertyTypeCoercion>
73+
<code><![CDATA[new \SplQueue()]]></code>
74+
</MixedPropertyTypeCoercion>
75+
<PossiblyUnusedParam>
76+
<code><![CDATA[$Length]]></code>
77+
</PossiblyUnusedParam>
78+
<PossiblyUnusedReturnValue>
79+
<code><![CDATA[bool]]></code>
80+
</PossiblyUnusedReturnValue>
81+
<PropertyNotSetInConstructor>
82+
<code><![CDATA[$Socket]]></code>
83+
<code><![CDATA[$SourceQuery]]></code>
84+
<code><![CDATA[TestableSocket]]></code>
85+
<code><![CDATA[TestableSocket]]></code>
86+
<code><![CDATA[TestableSocket]]></code>
87+
<code><![CDATA[TestableSocket]]></code>
88+
</PropertyNotSetInConstructor>
89+
<UnusedClass>
90+
<code><![CDATA[Tests]]></code>
91+
</UnusedClass>
92+
</file>
93+
</files>

composer.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@
1616
"ark",
1717
"gmod"
1818
],
19+
"scripts":
20+
{
21+
"test":
22+
[
23+
"@phpunit",
24+
"@phpstan",
25+
"@psalm"
26+
],
27+
"phpunit": "phpunit --configuration Tests/phpunit.xml --fail-on-warning",
28+
"phpstan": "phpstan",
29+
"psalm": "psalm"
30+
},
1931
"require":
2032
{
21-
"php": ">=8.0"
33+
"php": ">=8.1"
2234
},
2335
"require-dev":
2436
{

phpstan.neon

+5
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ parameters:
66
- .
77
excludePaths:
88
- vendor
9+
ignoreErrors:
10+
-
11+
message: "#^Comparison operation \"\\>\" between int\\<1, max\\> and 0 is always true\\.$#"
12+
count: 1
13+
path: SourceQuery/SourceQuery.php

psalm.xml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
resolveFromConfigFile="true"
55
findUnusedBaselineEntry="true"
66
findUnusedCode="true"
7+
errorBaseline="Tests/psalm-baseline.xml"
78
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
89
xmlns="https://getpsalm.org/schema/config"
910
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

0 commit comments

Comments
 (0)