Skip to content

Repository files navigation

PhPgSql class reflection extension for PHPStan

Latest Stable VersionMonthly DownloadsLicenseBuild

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\RowXyzfluentQueryClass: MyOwn\PhPgSql\Fluent\QueryXyz

Or you can set just one extension:

  • for PhPgSql\Db\Result (for fetching the correct Row object from fetch methods):
services:
Forrest79PhPgSqlPHPStanReflectionDbResultDynamicMethodReturnTypeExtension:
arguments:
dbRowClass: MyOwn\PhPgSql\Db\RowXyz
  • for PhPgSql\Fluent\QueryExecute (for fetching the correct Row object from fetch methods):
services:
Forrest79PhPgSqlPHPStanReflectionFluentQueryExecuteDynamicMethodReturnTypeExtension:
arguments:
dbRowClass: MyOwn\PhPgSql\Db\RowXyz
  • for PhPgSql\Fluent\Condition (to return right Query in query() method):
services:
Forrest79PhPgSqlPHPStanReflectionFluentConditionDynamicMethodReturnTypeExtension:
arguments:
fluentQueryClass: MyOwn\PhPgSql\Fluent\QueryXyz

About

PhPgSql class reflection extension and settings for PHPStan.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages