Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/infection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
31 changes: 0 additions & 31 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
/phpcs.xml
/phpunit.xml
/phpstan.neon
/psalm.xml.dist
/vendor/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
14 changes: 0 additions & 14 deletions psalm-baseline.xml

This file was deleted.

24 changes: 0 additions & 24 deletions psalm.xml.dist

This file was deleted.

2 changes: 1 addition & 1 deletion src/Output/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace SimPod\ClickHouseClient\Output;

/**
* @psalm-immutable
* @phpstan-immutable
* @template T
* @implements Output<T>
*/
Expand Down
12 changes: 8 additions & 4 deletions src/Output/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use const JSON_THROW_ON_ERROR;

/**
* @psalm-immutable
* @phpstan-immutable
* @template T
* @implements Output<T>
*/
Expand All @@ -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<T>, meta: array<mixed>, 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<T>,
* meta: array<mixed>,
* 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'];
Expand Down
3 changes: 1 addition & 2 deletions src/Output/JsonCompact.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use const JSON_THROW_ON_ERROR;

/**
* @psalm-immutable
* @phpstan-immutable
* @template T
* @implements Output<T>
*/
Expand Down Expand Up @@ -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'];
Expand Down
7 changes: 2 additions & 5 deletions src/Output/JsonEachRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use const JSON_THROW_ON_ERROR;

/**
* @psalm-immutable
* @phpstan-immutable
* @template T
* @implements Output<T>
*/
Expand All @@ -25,10 +25,7 @@ final class JsonEachRow implements Output
/** @throws JsonException */
public function __construct(string $contentsJson)
{
/**
* @var list<T> $contents
* @psalm-suppress ImpureFunctionCall
*/
/** @var list<T> $contents */
$contents = json_decode(
sprintf('[%s]', str_replace("}\n{", '},{', $contentsJson)),
true,
Expand Down
2 changes: 1 addition & 1 deletion src/Output/Null_.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps

/**
* @psalm-immutable
* @phpstan-immutable
* @template T
* @implements Output<T>
*/
Expand Down