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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phunkie/phpstan

ActivePhpstan-extension[Utility &amp; Helpers](/categories/utility)

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

PHPStan extensions for Phunkie functional programming library

1.0.0(6mo ago)02484MITPHPPHP ^8.2 || ^8.3 || ^8.4

Since Dec 8Pushed 6mo agoCompare

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

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 83% of packages

Maintenance66

Regular maintenance activity

Popularity13

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

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

[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87718.9k56](/packages/ticketswap-phpstan-error-formatter)[slam/phpstan-extensions

Slam extension of phpstan

712.6M81](/packages/slam-phpstan-extensions)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

40252.8k34](/packages/ec-europa-toolkit)

PHPackages © 2026

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