PHPackages                             sustainabil-it/phpstan-higher-order-collections - 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. sustainabil-it/phpstan-higher-order-collections

ActivePhpstan-extension

sustainabil-it/phpstan-higher-order-collections
===============================================

Higher Order Collection Support for PHPStan

387.5k—5%2[2 issues](https://github.com/Sustainabil-IT/phpstan-higher-order-collections/issues)PHP

Since Oct 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Sustainabil-IT/phpstan-higher-order-collections)[ Packagist](https://packagist.org/packages/sustainabil-it/phpstan-higher-order-collections)[ RSS](/packages/sustainabil-it-phpstan-higher-order-collections/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Higher Order Messaging support for Collections
==============================================

[](#higher-order-messaging-support-for-collections)

This plugin adds [PHPStan](https://phpstan.org/) support to [Higher Order Messaging](https://laravel.com/docs/8.x/collections#higher-order-messages) on the Collection concept popularized by [Laravel](https://laravel.com/docs/8.x/collections#introduction).

This extension provides following features:

- `Illuminate\Support\Collection` knows the type(s) of its contents using [PHPStan Generics](https://phpstan.org/blog/generics-in-php-using-phpdocs), which ensures that methods called on the Proxy objects are actually valid, and have their return types correctly inferred.

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

[](#installation)

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

```
composer require --dev sustainabil-it/phpstan-higher-order-collections

```

This plugin exposes a few configuration options if you happen to have special needs, like your own Collection implementation:

```
parameters:
    higherOrderCollection:
        - collectionClass: Illuminate\Support\Enumerable
        - proxyClass: Illuminate\Support\HigherOrderCollectionProxy
        - keyTemplate: TKey
        - typeTemplate: TValue
        - proxyTemplate: TReturn
        - proxyMethods:
            - map
            - filter

```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/sustainabil-it/phpstan-higher-order-collections/extension.neon

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/059621070fd69d01d134527c5d6c6dea7876703d7a0be0232988447ee21f4d5d?d=identicon)[nmokkenstorm](/maintainers/nmokkenstorm)

---

Top Contributors

[![nmokkenstorm](https://avatars.githubusercontent.com/u/33529698?v=4)](https://github.com/nmokkenstorm "nmokkenstorm (25 commits)")[![nusje2000](https://avatars.githubusercontent.com/u/17175959?v=4)](https://github.com/nusje2000 "nusje2000 (1 commits)")

### Embed Badge

![Health badge](/badges/sustainabil-it-phpstan-higher-order-collections/health.svg)

```
[![Health](https://phpackages.com/badges/sustainabil-it-phpstan-higher-order-collections/health.svg)](https://phpackages.com/packages/sustainabil-it-phpstan-higher-order-collections)
```

PHPackages © 2026

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