vojtech-dobes / phpstan-php-graphql-server-nette-integration
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/vojtech-dobes/phpstan-php-graphql-server-nette-integration
Requires
- php: ~8.4
- vojtech-dobes/php-graphql-server-nette-integration: dev-master@dev
Requires (Dev)
- nette/bootstrap: ^3.2.5
- nette/di: ^3.2
- php-parallel-lint/php-parallel-lint: ^1.4.0
- phpstan/phpstan: ^2.1.12
- phpstan/phpstan-strict-rules: ^2.0.4
- phpunit/phpunit: ^12.1
- spaze/phpstan-disallowed-calls: ^4.5.0
- tracy/tracy: ^2.10.9
- vojtech-dobes/php-codestyle: ~0.2.0
- vojtech-dobes/php-grammar-processing: dev-master@dev
- vojtech-dobes/php-graphql-server: dev-master@dev
- vojtech-dobes/phpstan-php-graphql-server: dev-master@dev
This package is auto-updated.
Last update: 2025-10-09 08:34:12 UTC
README
This extension is recommended if you use PHPStan with vojtech-dobes/phpstan-php-graphql-server extension. It gives you prepared Adapter implementation for easy integration with your GraphQL service setup.
Installation
To install the latest version, run the following command:
composer require vojtech-dobes/phpstan-php-graphql-server-nette-integration
Setup
Using this extension you can tell PHPStan about your GraphQL service in two ways:
- either you can directly use services registered in your DI container
- or you can point the extension at NEON configuration file that holds all necessary information in static form
The latter way is less convenient but won't prevent you from using PHPStan if your DI container can't temporarily compile (which is likely to happen during active development).
Method 1: DI container
Update your phpstan.neon like this:
includes: - vendor/vojtech-dobes/phpstan-php-graphql-server-nette-integration/extension_di_container.neon graphqlDIContainer: dic: [Bootstrap, createContainerForPHPStan] extensionMap: %rootDir%/../../../src/schema.graphqls: graphql
Options:
-
dicExpects callback that will return instance of your
Nette\DI\Containerfrom which it can extract necessary GraphQL services. -
extensionMapExpects map of schema file paths to extension name you use for that particular schema in your configuration. For example if your application configuration looks like this:
extensions: my_graphql: Vojtechdobes\GraphQL\Integrations\Nette\Extension my_graphql: schemaPath: %rootDir%/src/my_schema.graphqls
Then your
phpstan.neonshould contain:graphqlDIContainer: extensionMap: %rootDir%/../../../src/my_schema.graphqls: my_graphql
Method 2: static configuration
WIP