PHPackages                             fcpl/phpstan-container-extension - 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. fcpl/phpstan-container-extension

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

fcpl/phpstan-container-extension
================================

PHPStan extension to resolve return type for PSR-11 container (Psr\\Container\\ContainerInterface) and Pimple Container (ArrayAccess)

v1.0.0(3y ago)120.9k↓29.2%MITPHPPHP ^7.3 || ^8.0 || ^8.1

Since Aug 31Pushed 3y agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

A PHPStan extension for PSR-11 ContainerInterface and ArrayAccess. Ex: Pimple\\Container
========================================================================================

[](#a-phpstan-extension-for-psr-11-containerinterface-and-arrayaccess-ex-pimplecontainer)

This is an extension for PHPStan extension to resolve return type for PSR-11 container (Psr\\Container\\ContainerInterface) and Pimple Container (ArrayAccess)

This pacckage based on [phil-nelson/phpstan-container-extension](https://github.com/phil-nelson/phpstan-container-extension)

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

[](#installation)

Install with:

```
composer require --dev fcpl/phpstan-container-extension

```

Add the `extension.neon` file to your PHPStan config:

```
includes:
  - vendor/fcpl/phpstan-container-extension/extension.neon

```

Or use [phpstan/extension-installer](https://github.com/phpstan/extension-installer)

Sample
------

[](#sample)

```
use Monolog\Handler\HandlerInterface;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Pimple\Container;
use Pimple\Psr11\ServiceLocator;
use Psr\Log\LoggerInterface;
...
    $container = new Container();
    $container->offsetSet(HandlerInterface::class, new StreamHandler($this->getLogFile()));
    $container->offsetSet(
        LoggerInterface::class,
        function (Container $container): Logger {
            /** @var HandlerInterface $streamHandler */
            $streamHandler = $container->offsetGet(HandlerInterface::class);
            return new Logger(self::class, [$streamHandler]);
        }
    );
    return new ServiceLocator($container, [LoggerInterface::class, ConverterFileInterface::class]);
...
```

License
-------

[](#license)

All contents of this package are licensed under the [MIT license](https://github.com/webmozarts/assert/blob/master/LICENSE).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

1356d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30fcf2e5428f993f5ac2710107aa52abd8c85042e6ba9ccf6a78007b07736780?d=identicon)[fperrony](/maintainers/fperrony)

---

Top Contributors

[![phil-nelson](https://avatars.githubusercontent.com/u/8910254?v=4)](https://github.com/phil-nelson "phil-nelson (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fcpl-phpstan-container-extension/health.svg)

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

###  Alternatives

[illuminate/container

The Illuminate Container package.

31178.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/object-mapper

Provides a way to map an object to another object

34885.7k18](/packages/symfony-object-mapper)

PHPackages © 2026

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