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

ActiveLibrary

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

1.3.0(9y ago)47.0k2[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 2mo ago

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

32

—

LowBetter than 72% of packages

Maintenance20

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

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

[laminas/laminas-mvc

Laminas's event-driven MVC layer, including MVC Applications, Controllers, and Plugins

17224.4M365](/packages/laminas-laminas-mvc)[jaxon-php/jaxon-core

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

73142.3k25](/packages/jaxon-php-jaxon-core)[oat-sa/tao-core

TAO core extension

66136.7k74](/packages/oat-sa-tao-core)[mouf/pimple-interop

This project is a very simple extension to the Pimple microframework. It adds to Pimple compatibility with the container-interop APIs.

102.4M2](/packages/mouf-pimple-interop)[salamander/webworker

framework

336.3k](/packages/salamander-webworker)

PHPackages © 2026

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