PHPackages                             samburns/pimple3-containerinterop - 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. samburns/pimple3-containerinterop

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

samburns/pimple3-containerinterop
=================================

1.3.0(9y ago)47.0k2[1 issues](https://github.com/Sam-Burns/pimple3-containerinterop/issues)[1 PRs](https://github.com/Sam-Burns/pimple3-containerinterop/pulls)MITPHPPHP &gt;=5.5.0

Since Nov 30Pushed 8y ago2 watchersCompare

[ Source](https://github.com/Sam-Burns/pimple3-containerinterop)[ Packagist](https://packagist.org/packages/samburns/pimple3-containerinterop)[ RSS](/packages/samburns-pimple3-containerinterop/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/4f73ec28f15c17e433bd9300b7d52e9a12ca48a790a9fdaabb6d7be478c7f0cf/68747470733a2f2f7472617669732d63692e6f72672f53616d2d4275726e732f70696d706c65332d636f6e7461696e6572696e7465726f702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Sam-Burns/pimple3-containerinterop)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c13caaf461cbde263697db540fecd2147db1da26c311de38fc7b78f9b65527ff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f53616d2d4275726e732f70696d706c65332d636f6e7461696e6572696e7465726f702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Sam-Burns/pimple3-containerinterop/?branch=master)

Pimple3-ContainerInterop
========================

[](#pimple3-containerinterop)

Introduction
------------

[](#introduction)

[Pimple 3](https://github.com/silexphp/Pimple) is a fast, lightweight, popular Dependency Injection container for PHP. [ContainerInterop](https://github.com/container-interop/container-interop) is an open-source standard for interoperability between Dependency Injection containers. This tool is a standards-compliant ContainerInterop wrapper for Pimple 3.

It works in PHP 5.5, 5.6 and 7.0.

User - Direct Pimple Access
---------------------------

[](#user---direct-pimple-access)

The wrapper allows full access to all Pimple functionality, via a `__call()` method, and `ArrayAccess`implementation. This allows you to call any method that exists in Pimple, directly on the wrapper. You can also add services using `$container['service-id'] = //something`, as array access is supported.

Use - Service Retrieval
-----------------------

[](#use---service-retrieval)

As per the standard, `$container->has($serviceId)` will tell you if a service is configured in the container. `$container->get($serviceId)` will retrieve the service. An implementation of `Interop\Container\Exception\NotFoundException` is thrown if you call `get()` and the service doesn't exist. All other errors from Pimple result in an instance of `Interop\Container\Exception\ContainerException` being thrown.

Use - Installation
------------------

[](#use---installation)

It is recommended to install this via [composer](https://getcomposer.org/):

```
composer require samburns/pimple3-containerinterop
```

Use - Configuration
-------------------

[](#use---configuration)

You can configure the Pimple container before wrapping it in a standards-compliant adapter:

```
use Pimple\Container as PimpleContainer;
use SamBurns\Pimple3ContainerInterop\ServiceContainer;

$rawPimpleContainer = new PimpleContainer();
$rawPimpleContainer['service-id'] = function () {return new \Whatever();};
$container = ServiceContainer($rawPimpleContainer);
```

Or you can pass your own `Pimple\ServiceProviderInterface` implementions into the wrapper, to be applied to the inner Pimple container:

```
use SamBurns\Pimple3ContainerInterop\ServiceContainer;
use My\ServiceProvider;

$container = new ServiceContainer();
$container->addConfig(new ServiceProvider());
```

There is even a named constructor you can use, if you want to spin up a `ServiceContainer` and configure it with a `ServiceProviderInterface` all in one line:

```
use SamBurns\Pimple3ContainerInterop\ServiceContainer;
use My\ServiceProvider;

$container = ServiceContainer::constructConfiguredWith(new ServiceProvider());
```

Similar Projects
----------------

[](#similar-projects)

[PimpleInterop](https://github.com/moufmouf/pimple-interop) and [Acclimate](https://github.com/jeremeamia/acclimate-container) provide excellent alternatives if you don't like this library. Although using Pimple v1 and not v3, they do offer the 'delegate lookup' feature described as optional in the standard, allowing you to combine multiple containers.

Contributions
-------------

[](#contributions)

Contributions welcome. Fork the repo, make your changes, and create a pull request. To run the tests, type `./bin/test`. PHPUnit integration tests and PHPSpec unit tests will run.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~88 days

Recently: every ~110 days

Total

6

Last Release

3424d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dc0c2d8bba727c2b30227f0e9eb327906ae55f4673bb48df1c846365e58d526?d=identicon)[Sam-Burns](/maintainers/Sam-Burns)

---

Top Contributors

[![Sam-Burns](https://avatars.githubusercontent.com/u/6594039?v=4)](https://github.com/Sam-Burns "Sam-Burns (18 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/samburns-pimple3-containerinterop/health.svg)

```
[![Health](https://phpackages.com/badges/samburns-pimple3-containerinterop/health.svg)](https://phpackages.com/packages/samburns-pimple3-containerinterop)
```

###  Alternatives

[oat-sa/tao-core

TAO core extension

66140.1k108](/packages/oat-sa-tao-core)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73147.2k29](/packages/jaxon-php-jaxon-core)[ckfinder/ckfinder-laravel-package

CKFinder 3 package for Laravel

159517.6k67](/packages/ckfinder-ckfinder-laravel-package)[ckfinder/ckfinder-symfony-bundle

CKFinder bundle for Symfony

42448.0k](/packages/ckfinder-ckfinder-symfony-bundle)[inpsyde/wp-app-container

DI Container and related tools to be used at website level.

41267.6k](/packages/inpsyde-wp-app-container)[rockettheme/toolbox

RocketTheme Toolbox Library

22540.5k4](/packages/rockettheme-toolbox)

PHPackages © 2026

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