PHPackages                             phunkie/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. phunkie/phpstan

ActivePhpstan-extension

phunkie/phpstan
===============

PHPStan extensions for Phunkie functional programming library

1.0.0(5mo ago)02284MITPHPPHP ^8.2 || ^8.3 || ^8.4

Since Dec 8Pushed 5mo agoCompare

[ Source](https://github.com/phunkie/phpstan)[ Packagist](https://packagist.org/packages/phunkie/phpstan)[ RSS](/packages/phunkie-phpstan/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (4)

Phunkie PHPStan Extension
=========================

[](#phunkie-phpstan-extension)

PHPStan extensions for the [Phunkie](https://github.com/phunkie/phunkie) functional programming library.

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

[](#installation)

```
composer require --dev phunkie/phpstan
```

The extension is automatically registered via PHPStan's extension mechanism.

What it provides
----------------

[](#what-it-provides)

### Generic Type Transformation

[](#generic-type-transformation)

Phunkie uses container types (IO, Option, Validation, etc.) that transform their type parameters through method calls. PHPStan often loses this type information when closures are involved.

This extension provides a **single configurable resolver** that handles common patterns:

PatternDescriptionExample`wrap``F` → `F``IO::attempt()` → `IO``map``F.f(A→B)` → `F``IO::map(fn)` → `IO``pair``F.f(A→B)` → `F``IO::zipWith(fn)` → `IO``preserve``F.method()` → `F`Methods that don't change type### Configuration

[](#configuration)

The extension is configured in `extension.neon`:

```
services:
    -
        class: Phunkie\PHPStan\GenericMethodReturnTypeExtension
        arguments:
            targetClass: Phunkie\Effect\IO\IO
            methods:
                -
                    method: attempt
                    pattern: wrap
                    wrapper: Phunkie\Validation\Validation
                    fixedTypes: [Throwable]
                -
                    method: map
                    pattern: map
        tags:
            - phpstan.broker.dynamicMethodReturnTypeExtension
```

### Covariant Type Support

[](#covariant-type-support)

The Phunkie core library includes `@template-covariant` annotations so that:

- `Success` is a `Validation` (compatible with any `Validation`)
- `Failure` is a `Validation` (compatible with any `Validation`)

Requirements
------------

[](#requirements)

- PHP 8.2+
- PHPStan 2.0+
- Phunkie 1.0+

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance71

Regular maintenance activity

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

161d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/70713?v=4)[md](/maintainers/md)[@md](https://github.com/md)

---

Top Contributors

[![MarcelloDuarte](https://avatars.githubusercontent.com/u/144535?v=4)](https://github.com/MarcelloDuarte "MarcelloDuarte (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

78768.9M1.5k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

66766.6M1.1k](/packages/phpstan-phpstan-doctrine)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33320.0M375](/packages/spaze-phpstan-disallowed-calls)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)

PHPackages © 2026

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