Skip to content

Commit

Permalink
Test php 8.3 (drop 8.0); set phpstan/psalm baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Mar 22, 2024
1 parent f82a59f commit 7f0a32c
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2', '8.3']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -20,8 +20,8 @@ jobs:
- name: Install dependencies
run: composer install --no-interaction --no-progress
- name: Run tests
run: php vendor/bin/phpunit --configuration Tests/phpunit.xml --fail-on-warning
run: composer run phpunit
- name: Run phpstan
run: php vendor/bin/phpstan
run: composer run phpstan
- name: Run psalm
run: php vendor/bin/psalm
run: composer run psalm
93 changes: 93 additions & 0 deletions Tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<file src="SourceQuery/BaseSocket.php">
<MissingConstructor>
<code><![CDATA[$Address]]></code>
<code><![CDATA[$Engine]]></code>
<code><![CDATA[$Port]]></code>
<code><![CDATA[$Timeout]]></code>
</MissingConstructor>
<PossiblyUnusedReturnValue>
<code><![CDATA[Buffer]]></code>
<code><![CDATA[bool]]></code>
</PossiblyUnusedReturnValue>
<UnusedVariable>
<code><![CDATA[$ReadMore]]></code>
</UnusedVariable>
</file>
<file src="SourceQuery/GoldSourceRcon.php">
<PossiblyNullArgument>
<code><![CDATA[$this->Socket->Socket]]></code>
</PossiblyNullArgument>
<PossiblyUnusedParam>
<code><![CDATA[$Header]]></code>
<code><![CDATA[$Length]]></code>
</PossiblyUnusedParam>
<PossiblyUnusedReturnValue>
<code><![CDATA[bool]]></code>
</PossiblyUnusedReturnValue>
<UnusedVariable>
<code><![CDATA[$ReadMore]]></code>
</UnusedVariable>
</file>
<file src="SourceQuery/Socket.php">
<InvalidPropertyAssignmentValue>
<code><![CDATA[$this->Socket]]></code>
</InvalidPropertyAssignmentValue>
<PossiblyNullArgument>
<code><![CDATA[$this->Socket]]></code>
<code><![CDATA[$this->Socket]]></code>
<code><![CDATA[$this->Socket]]></code>
</PossiblyNullArgument>
<PossiblyUnusedReturnValue>
<code><![CDATA[bool]]></code>
</PossiblyUnusedReturnValue>
</file>
<file src="SourceQuery/SourceQuery.php">
<PossiblyUnusedMethod>
<code><![CDATA[SetUseOldGetChallengeMethod]]></code>
</PossiblyUnusedMethod>
<PossiblyUnusedReturnValue>
<code><![CDATA[string]]></code>
</PossiblyUnusedReturnValue>
<UnusedVariable>
<code><![CDATA[$SteamID]]></code>
</UnusedVariable>
</file>
<file src="SourceQuery/SourceRcon.php">
<InvalidPropertyAssignmentValue>
<code><![CDATA[$this->RconSocket]]></code>
</InvalidPropertyAssignmentValue>
<PossiblyNullArgument>
<code><![CDATA[$this->RconSocket]]></code>
<code><![CDATA[$this->RconSocket]]></code>
<code><![CDATA[$this->RconSocket]]></code>
<code><![CDATA[$this->RconSocket]]></code>
</PossiblyNullArgument>
<PossiblyUnusedReturnValue>
<code><![CDATA[bool]]></code>
</PossiblyUnusedReturnValue>
</file>
<file src="Tests/Tests.php">
<MixedPropertyTypeCoercion>
<code><![CDATA[new \SplQueue()]]></code>
</MixedPropertyTypeCoercion>
<PossiblyUnusedParam>
<code><![CDATA[$Length]]></code>
</PossiblyUnusedParam>
<PossiblyUnusedReturnValue>
<code><![CDATA[bool]]></code>
</PossiblyUnusedReturnValue>
<PropertyNotSetInConstructor>
<code><![CDATA[$Socket]]></code>
<code><![CDATA[$SourceQuery]]></code>
<code><![CDATA[TestableSocket]]></code>
<code><![CDATA[TestableSocket]]></code>
<code><![CDATA[TestableSocket]]></code>
<code><![CDATA[TestableSocket]]></code>
</PropertyNotSetInConstructor>
<UnusedClass>
<code><![CDATA[Tests]]></code>
</UnusedClass>
</file>
</files>
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
"ark",
"gmod"
],
"scripts":
{
"test":
[
"@phpunit",
"@phpstan",
"@psalm"
],
"phpunit": "phpunit --configuration Tests/phpunit.xml --fail-on-warning",
"phpstan": "phpstan",
"psalm": "psalm"
},
"require":
{
"php": ">=8.0"
"php": ">=8.1"
},
"require-dev":
{
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ parameters:
- .
excludePaths:
- vendor
ignoreErrors:
-
message: "#^Comparison operation \"\\>\" between int\\<1, max\\> and 0 is always true\\.$#"
count: 1
path: SourceQuery/SourceQuery.php
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="true"
errorBaseline="Tests/psalm-baseline.xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down

0 comments on commit 7f0a32c

Please sign in to comment.