PHPackages                             forrest79/phpgsql-phpstan - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. forrest79/phpgsql-phpstan

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

forrest79/phpgsql-phpstan
=========================

PhPgSql class reflection extension and settings for PHPStan.

v2.0.1(10mo ago)24.6k1BSD-3-ClausePHPPHP ^8.3CI passing

Since Feb 15Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/forrest79/phpgsql-phpstan)[ Packagist](https://packagist.org/packages/forrest79/phpgsql-phpstan)[ RSS](/packages/forrest79-phpgsql-phpstan/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (6)Versions (18)Used By (1)

PhPgSql class reflection extension for PHPStan
==============================================

[](#phpgsql-class-reflection-extension-for-phpstan)

[![Latest Stable Version](https://camo.githubusercontent.com/6d5d21f8a5ec77a060ad49b9e4f3de6bfa90ef9d840ba29d8948acf0ed738b3f/68747470733a2f2f706f7365722e707567782e6f72672f666f727265737437392f7068706773716c2d7068707374616e2f76)](//packagist.org/packages/forrest79/phpgsql-phpstan)[![Monthly Downloads](https://camo.githubusercontent.com/a040862f995800688aeeb506f4a1782b6eabe676a4e242b4e14bcf1fa221e413/68747470733a2f2f706f7365722e707567782e6f72672f666f727265737437392f7068706773716c2d7068707374616e2f642f6d6f6e74686c79)](//packagist.org/packages/forrest79/phpgsql-phpstan)[![License](https://camo.githubusercontent.com/24e6f041360cf55cf1abbb9b25ccedcab1125a80a30acdf38312a35f6e52b3e3/68747470733a2f2f706f7365722e707567782e6f72672f666f727265737437392f7068706773716c2d7068707374616e2f6c6963656e7365)](//packagist.org/packages/forrest79/phpgsql-phpstan)[![Build](https://github.com/forrest79/phpgsql-phpstan/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/forrest79/phpgsql-phpstan/actions/workflows/build.yml)

- [PhPgSql](https://github.com/forrest79/phpgsql)
- [PHPStan](https://github.com/phpstan/phpstan)

Introduction
------------

[](#introduction)

This extension defines dynamic methods and other PHPStan setting for `Forrest79\PhPgSql`.

Installation
------------

[](#installation)

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev forrest79/phpgsql-phpstan

```

Using
-----

[](#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
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance65

Regular maintenance activity

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~128 days

Recently: every ~186 days

Total

17

Last Release

319d ago

Major Versions

v0.4 → v1.0.02021-07-23

v1.9.0 → v2.0.02025-10-01

PHP version history (5 changes)v0.1PHP &gt;=7.1

v0.4PHP ^7.1 | ^8.0

v1.2.0PHP ^7.2 | ^8.0

v1.7.0PHP ^8.0

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/d979cd353c6593b44b50f90ff5a5eb4be224f501a70f7cce89d0735867e488e5?d=identicon)[forrest79](/maintainers/forrest79)

---

Top Contributors

[![forrest79](https://avatars.githubusercontent.com/u/160766?v=4)](https://github.com/forrest79 "forrest79 (57 commits)")

---

Tags

PHPStanphpgsql

### Embed Badge

![Health badge](/badges/forrest79-phpgsql-phpstan/health.svg)

```
[![Health](https://phpackages.com/badges/forrest79-phpgsql-phpstan/health.svg)](https://phpackages.com/packages/forrest79-phpgsql-phpstan)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k60.6M10.5k](/packages/larastan-larastan)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

5014.2M111](/packages/shipmonk-dead-code-detector)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67475.0M1.6k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[staabm/phpstan-dba

2962.6M2](/packages/staabm-phpstan-dba)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2023.2M367](/packages/drupal-core-dev)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
