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

v2.0.1 2025-10-02 20:33 UTC

This package is auto-updated.

Last update: 2025-10-02 20:33:37 UTC


README

Latest Stable Version Monthly Downloads License Build

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 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