forrest79 / phpgsql-phpstan
PhPgSql class reflection extension and settings for PHPStan.
Installs: 4 002
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:phpstan-extension
pkg:composer/forrest79/phpgsql-phpstan
Requires
- php: ^8.3
- phpstan/phpstan: ^2.0
Requires (Dev)
- forrest79/phpcs: ^2.3
- forrest79/phpcs-ignores: ^0.6
- forrest79/phpgsql: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- shipmonk/phpstan-rules: ^4.2
README
Introduction
This extension defines dynamic methods and other PHPStan setting for Forrest79\PhPgSql
.
Installation
To use this extension, require it in Composer:
composer require --dev forrest79/phpgsql-phpstan
Using
Include extension.neon
in your project's PHPStan config:
includes: - vendor/forrest79/phpgsql-phpstan/extension.neon
If you're using your own Forrest79\PhPgSql\Db\Row
or Forrest79\PhPgSql\Fluen\Query
, you can set it likes this:
parameters: forrest79: phpgsql: dbRowClass: MyOwn\PhPgSql\Db\RowXyz fluentQueryClass: MyOwn\PhPgSql\Fluent\QueryXyz
Or you can set just one extension:
- for
PhPgSql\Db\Result
(for fetching the correctRow
object from fetch methods):
services: Forrest79PhPgSqlPHPStanReflectionDbResultDynamicMethodReturnTypeExtension: arguments: dbRowClass: MyOwn\PhPgSql\Db\RowXyz
- for
PhPgSql\Fluent\QueryExecute
(for fetching the correctRow
object from fetch methods):
services: Forrest79PhPgSqlPHPStanReflectionFluentQueryExecuteDynamicMethodReturnTypeExtension: arguments: dbRowClass: MyOwn\PhPgSql\Db\RowXyz
- for
PhPgSql\Fluent\Condition
(to return rightQuery
inquery()
method):
services: Forrest79PhPgSqlPHPStanReflectionFluentConditionDynamicMethodReturnTypeExtension: arguments: fluentQueryClass: MyOwn\PhPgSql\Fluent\QueryXyz