From a8e35d24759383ad565e9e04d08297b44281f841 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Sun, 4 Feb 2024 13:50:32 +0100 Subject: [PATCH] chore: remove psalm --- .gitattributes | 1 - .github/workflows/infection.yml | 2 +- .github/workflows/static-analysis.yml | 31 --------------------------- .gitignore | 1 - README.md | 1 - composer.json | 5 +---- psalm-baseline.xml | 14 ------------ psalm.xml.dist | 24 --------------------- src/Output/Basic.php | 2 +- src/Output/Json.php | 12 +++++++---- src/Output/JsonCompact.php | 3 +-- src/Output/JsonEachRow.php | 7 ++---- src/Output/Null_.php | 2 +- 13 files changed, 15 insertions(+), 90 deletions(-) delete mode 100644 psalm-baseline.xml delete mode 100644 psalm.xml.dist diff --git a/.gitattributes b/.gitattributes index fd1e009..09331a2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,5 +7,4 @@ /phpcs.xml.dist export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore -/psalm.xml.dist export-ignore /tests export-ignore diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml index 04a1555..95250e7 100644 --- a/.github/workflows/infection.yml +++ b/.github/workflows/infection.yml @@ -33,6 +33,6 @@ jobs: - name: Run Infection run: | export $ENV - vendor/bin/roave-infection-static-analysis-plugin --threads=$(nproc) + vendor/bin/infection --threads=$(nproc) env: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 349da40..32e0d31 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -33,34 +33,3 @@ jobs: - name: "Run a static analysis with phpstan/phpstan" run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" - - static-analysis-psalm: - name: "Static Analysis with Psalm" - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "8.2" - - steps: - - name: "Checkout code" - uses: actions/checkout@v4 - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: "cs2pr" - - - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v2" - - - name: "Run a static analysis with vimeo/psalm" - run: "vendor/bin/psalm --output-format=github --shepherd --taint-analysis --report=results.sarif" - - - name: "Upload Security Analysis results to GitHub" - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif diff --git a/.gitignore b/.gitignore index 6e2ecd0..63a0415 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,4 @@ /phpcs.xml /phpunit.xml /phpstan.neon -/psalm.xml.dist /vendor/ diff --git a/README.md b/README.md index 2c88a55..6fc1e39 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Build Status](https://github.com/simPod/PhpClickHouseClient/workflows/CI/badge.svg?branch=master)](https://github.com/simPod/PhpClickHouseClient/actions) [![Code Coverage][Coverage image]][CodeCov Master] [![Downloads](https://poser.pugx.org/simpod/clickhouse-client/d/total.svg)](https://packagist.org/packages/simpod/clickhouse-client) -[![Type Coverage](https://shepherd.dev/github/simPod/PhpClickHouseClient/coverage.svg)](https://shepherd.dev/github/simPod/PhpClickHouseClient) [![Infection MSI](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FsimPod%2FPhpClickHouseClient%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/simPod/PhpClickHouseClient/master) ## Motivation diff --git a/composer.json b/composer.json index e0110d2..f283dd2 100644 --- a/composer.json +++ b/composer.json @@ -46,10 +46,7 @@ "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", "phpunit/phpunit": "^10.1", - "psalm/plugin-phpunit": "0.18.4", - "roave/infection-static-analysis-plugin": "^1.6", - "symfony/http-client": "^7.0", - "vimeo/psalm": "^5.0.0" + "symfony/http-client": "^7.0" }, "autoload": { "psr-4": { diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index 28fbac5..0000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - $query - - - string - - - $query - - - diff --git a/psalm.xml.dist b/psalm.xml.dist deleted file mode 100644 index 2435afb..0000000 --- a/psalm.xml.dist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - diff --git a/src/Output/Basic.php b/src/Output/Basic.php index 3e054af..f2a608a 100644 --- a/src/Output/Basic.php +++ b/src/Output/Basic.php @@ -5,7 +5,7 @@ namespace SimPod\ClickHouseClient\Output; /** - * @psalm-immutable + * @phpstan-immutable * @template T * @implements Output */ diff --git a/src/Output/Json.php b/src/Output/Json.php index 0bb80fa..6ae8e89 100644 --- a/src/Output/Json.php +++ b/src/Output/Json.php @@ -11,7 +11,7 @@ use const JSON_THROW_ON_ERROR; /** - * @psalm-immutable + * @phpstan-immutable * @template T * @implements Output */ @@ -33,10 +33,14 @@ final class Json implements Output /** @throws JsonException */ public function __construct(string $contentsJson) { - // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong /** - * @var array{data: list, meta: array, rows: int, rows_before_limit_at_least?: int, statistics: array{elapsed: float, rows_read: int, bytes_read: int}} $contents - * @psalm-suppress ImpureFunctionCall + * @var array{ + * data: list, + * meta: array, + * rows: int, + * rows_before_limit_at_least?: int, + * statistics: array{elapsed: float, rows_read: int, bytes_read: int} + * } $contents */ $contents = json_decode($contentsJson, true, flags: JSON_THROW_ON_ERROR); $this->data = $contents['data']; diff --git a/src/Output/JsonCompact.php b/src/Output/JsonCompact.php index c4d6df2..959b83e 100644 --- a/src/Output/JsonCompact.php +++ b/src/Output/JsonCompact.php @@ -11,7 +11,7 @@ use const JSON_THROW_ON_ERROR; /** - * @psalm-immutable + * @phpstan-immutable * @template T * @implements Output */ @@ -41,7 +41,6 @@ public function __construct(string $contentsJson) * rows_before_limit_at_least?: int, * statistics: array{elapsed: float, rows_read: int, bytes_read: int} * } $contents - * @psalm-suppress ImpureFunctionCall */ $contents = json_decode($contentsJson, true, flags: JSON_THROW_ON_ERROR); $this->data = $contents['data']; diff --git a/src/Output/JsonEachRow.php b/src/Output/JsonEachRow.php index c24e8c4..a54d146 100644 --- a/src/Output/JsonEachRow.php +++ b/src/Output/JsonEachRow.php @@ -13,7 +13,7 @@ use const JSON_THROW_ON_ERROR; /** - * @psalm-immutable + * @phpstan-immutable * @template T * @implements Output */ @@ -25,10 +25,7 @@ final class JsonEachRow implements Output /** @throws JsonException */ public function __construct(string $contentsJson) { - /** - * @var list $contents - * @psalm-suppress ImpureFunctionCall - */ + /** @var list $contents */ $contents = json_decode( sprintf('[%s]', str_replace("}\n{", '},{', $contentsJson)), true, diff --git a/src/Output/Null_.php b/src/Output/Null_.php index 99f311a..ae4f8b1 100644 --- a/src/Output/Null_.php +++ b/src/Output/Null_.php @@ -7,7 +7,7 @@ // phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps /** - * @psalm-immutable + * @phpstan-immutable * @template T * @implements Output */