diff --git a/.gitattributes b/.gitattributes index 0548dcc7d..487b6436d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,6 +16,4 @@ phpbench.json export-ignore phpstan.neon.dist export-ignore phpstan-baseline.neon export-ignore phpunit.xml.dist export-ignore -psalm.xml.dist export-ignore -psalm-baseline.xml export-ignore renovate.json export-ignore diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 516313797..76addd05d 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -34,29 +34,3 @@ jobs: - name: Run a static analysis with phpstan/phpstan run: vendor/bin/phpstan --error-format=checkstyle | cs2pr - - static-analysis-psalm: - name: Static Analysis with Psalm - runs-on: ubuntu-20.04 - - strategy: - matrix: - php-version: - - 8.1 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - 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 diff --git a/.gitignore b/.gitignore index 2fd04c601..c40e29c47 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ composer.lock composer.phar phpstan.neon -psalm.xml vendor .idea diff --git a/README.md b/README.md index f0f33155e..2a8485121 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![CI](https://github.com/webonyx/graphql-php/workflows/CI/badge.svg)](https://github.com/webonyx/graphql-php/actions?query=workflow:CI+branch:master) [![Coverage Status](https://codecov.io/gh/webonyx/graphql-php/branch/master/graph/badge.svg)](https://codecov.io/gh/webonyx/graphql-php/branch/master) [![Latest Stable Version](https://poser.pugx.org/webonyx/graphql-php/version)](https://packagist.org/packages/webonyx/graphql-php) -[![Shepherd Type](https://shepherd.dev/github/webonyx/graphql-php/coverage.svg)](ttps://shepherd.dev/github/webonyx/graphql-php) This is a PHP implementation of the GraphQL [specification](https://github.com/graphql/graphql-spec) based on the [reference implementation in JavaScript](https://github.com/graphql/graphql-js). diff --git a/composer.json b/composer.json index 05090ccc4..5d4e0748c 100644 --- a/composer.json +++ b/composer.json @@ -25,13 +25,11 @@ "phpstan/phpstan-phpunit": "1.2.2", "phpstan/phpstan-strict-rules": "1.4.4", "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.17", "psr/http-message": "^1", "react/promise": "^2", "symfony/polyfill-php81": "^1.23", "symfony/var-exporter": "^5 || ^6", - "thecodingmachine/safe": "^1.3", - "vimeo/psalm": "^4.19" + "thecodingmachine/safe": "^1.3" }, "suggest": { "psr/http-message": "To use standard GraphQL server", @@ -59,12 +57,11 @@ "sort-packages": true }, "scripts": { - "baseline": "phpstan --generate-baseline && psalm --set-baseline", "bench": "phpbench run", "check": "composer fix && composer stan && composer test", "docs": "php generate-class-reference.php", "fix": "php-cs-fixer fix", - "stan": "phpstan && psalm", + "stan": "phpstan", "test": "phpunit" } } diff --git a/docs/class-reference.md b/docs/class-reference.md index 6f1b9c6e5..8e9232b55 100644 --- a/docs/class-reference.md +++ b/docs/class-reference.md @@ -1264,17 +1264,8 @@ const CLASS_MAP = [ Implements the "Evaluating requests" section of the GraphQL specification. @phpstan-type FieldResolver callable(mixed, array, mixed, ResolveInfo): mixed - -@see https://github.com/vimeo/psalm/issues/6928 - -@psalm-type FieldResolver callable(mixed, array, mixed, ResolveInfo): mixed - @phpstan-type ImplementationFactory callable(PromiseAdapter, Schema, DocumentNode, mixed, mixed, array, ?string, callable): ExecutorImplementation -@see https://github.com/vimeo/psalm/issues/6928, https://github.com/vimeo/psalm/issues/7527 - -@psalm-type ImplementationFactory callable(PromiseAdapter, Schema, DocumentNode, mixed, mixed, array, ?string, callable): ExecutorImplementation - ### GraphQL\Executor\Executor Methods ```php @@ -1356,10 +1347,6 @@ extensions?: array @phpstan-type ErrorFormatter callable(Throwable): SerializableError @phpstan-type ErrorsHandler callable(array $errors, ErrorFormatter $formatter): SerializableErrors -@see https://github.com/vimeo/psalm/issues/6928 - -@psalm-type ErrorsHandler callable(Error[], ErrorFormatter): SerializableErrors - ### GraphQL\Executor\ExecutionResult Props ```php @@ -1676,10 +1663,6 @@ Also, it is possible to override warning handler (which is **trigger_error()** b @phpstan-type WarningHandler callable(string $errorMessage, int $warningId, ?int $messageLevel): void -@see https://github.com/vimeo/psalm/issues/7527 - -@psalm-type WarningHandler callable(string, int, int|null): void - ### GraphQL\Error\Warning Constants ```php diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index ececdb61f..000000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - ParserOptions - - - ParserOptions from Parser - - - - - ParserOptions - ParserOptions - ParserOptions - ParserOptions - array{string, ParserOptions} - - - - - $path[count($path) - 1] - - - - - $this->config - ComplexityFn|null - FieldDefinitionConfig - FieldsConfig - array - - - - - FieldsConfig from FieldDefinition - - - - - UnnamedFieldDefinitionConfig from FieldDefinition - - - - - UnnamedFieldDefinitionConfig from FieldDefinition - - - - - UnnamedFieldDefinitionConfig from FieldDefinition - - - diff --git a/psalm.xml.dist b/psalm.xml.dist deleted file mode 100644 index 5c628e865..000000000 --- a/psalm.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/Error/Warning.php b/src/Error/Warning.php index 87681cbc9..14902fde8 100644 --- a/src/Error/Warning.php +++ b/src/Error/Warning.php @@ -11,10 +11,6 @@ * Also, it is possible to override warning handler (which is **trigger_error()** by default). * * @phpstan-type WarningHandler callable(string $errorMessage, int $warningId, ?int $messageLevel): void - * - * @see https://github.com/vimeo/psalm/issues/7527 - * - * @psalm-type WarningHandler callable(string, int, int|null): void */ final class Warning { diff --git a/src/Executor/ExecutionResult.php b/src/Executor/ExecutionResult.php index 7c26ea531..387a686d0 100644 --- a/src/Executor/ExecutionResult.php +++ b/src/Executor/ExecutionResult.php @@ -34,10 +34,6 @@ * } * @phpstan-type ErrorFormatter callable(Throwable): SerializableError * @phpstan-type ErrorsHandler callable(array $errors, ErrorFormatter $formatter): SerializableErrors - * - * @see https://github.com/vimeo/psalm/issues/6928 - * - * @psalm-type ErrorsHandler callable(Error[], ErrorFormatter): SerializableErrors */ class ExecutionResult implements \JsonSerializable { diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 664e9b05b..88c132d2a 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -14,16 +14,7 @@ * Implements the "Evaluating requests" section of the GraphQL specification. * * @phpstan-type FieldResolver callable(mixed, array, mixed, ResolveInfo): mixed - * - * @see https://github.com/vimeo/psalm/issues/6928 - * - * @psalm-type FieldResolver callable(mixed, array, mixed, ResolveInfo): mixed - * * @phpstan-type ImplementationFactory callable(PromiseAdapter, Schema, DocumentNode, mixed, mixed, array, ?string, callable): ExecutorImplementation - * - * @see https://github.com/vimeo/psalm/issues/6928, https://github.com/vimeo/psalm/issues/7527 - * - * @psalm-type ImplementationFactory callable(PromiseAdapter, Schema, DocumentNode, mixed, mixed, array, ?string, callable): ExecutorImplementation */ class Executor {