From 7f0a32c0443da6713508540f5a7ad09cfb0827f0 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 22 Mar 2024 12:26:04 +0200 Subject: [PATCH] Test php 8.3 (drop 8.0); set phpstan/psalm baselines --- .github/workflows/ci.yml | 8 ++-- Tests/psalm-baseline.xml | 93 ++++++++++++++++++++++++++++++++++++++++ composer.json | 14 +++++- phpstan.neon | 5 +++ psalm.xml | 1 + 5 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 Tests/psalm-baseline.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 248eeee..1a9ea18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/Tests/psalm-baseline.xml b/Tests/psalm-baseline.xml new file mode 100644 index 0000000..7cb4480 --- /dev/null +++ b/Tests/psalm-baseline.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + Socket->Socket]]> + + + + + + + + + + + + + + + Socket]]> + + + Socket]]> + Socket]]> + Socket]]> + + + + + + + + + + + + + + + + + + + RconSocket]]> + + + RconSocket]]> + RconSocket]]> + RconSocket]]> + RconSocket]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/composer.json b/composer.json index c452e05..c05ff32 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/phpstan.neon b/phpstan.neon index 884af76..2791d29 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -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 diff --git a/psalm.xml b/psalm.xml index ade2383..058d23f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -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"