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)121.7k↓40.1%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 today

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

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

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

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k455.6M9.6k](/packages/symfony-dependency-injection)[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)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.3k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31182.0M2.4k](/packages/illuminate-container)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[symfony/type-info

Extracts PHP types information.

20069.8M270](/packages/symfony-type-info)

PHPackages © 2026

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