PHPackages                             gorka/pimp - 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. gorka/pimp

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

gorka/pimp
==========

Simple Dependency Injection Container

v3.0.2(10y ago)450[1 issues](https://github.com/glopezdetorre/pimp/issues)MITPHPPHP &gt;=5.5.0

Since Feb 1Pushed 6y ago2 watchersCompare

[ Source](https://github.com/glopezdetorre/pimp)[ Packagist](https://packagist.org/packages/gorka/pimp)[ RSS](/packages/gorka-pimp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (14)Used By (0)

⚠️ **This project is unmaintained and might eventually be removed. Use it at your own risk.**

Pimp: Simple Dependency Injection Container
===========================================

[](#pimp-simple-dependency-injection-container)

*Pimp* is a PHP dependency injection container inspired by [Pimple](http://pimple.sensiolabs.org/), with a [Container Interop](https://github.com/container-interop/container-interop) turn to it.

Backwards compatibility note
----------------------------

[](#backwards-compatibility-note)

Version 3.0.0 has introduced a major backwards compatibility break to comply with container interop specification. On previous version of *Pimp* config values could be introduced in the container itself; this is no longer possible, please use a [config manager](https://github.com/glopezdetorre/config) instead.

[![Build Status](https://camo.githubusercontent.com/117c3f4bd94bcc841ef758b7480fdb334684b8c0f5922e80799cef06b2d9d13b/68747470733a2f2f7472617669732d63692e6f72672f676c6f70657a6465746f7272652f70696d702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/glopezdetorre/pimp)[![Code Coverage](https://camo.githubusercontent.com/a94f0387d7559518a0cbb6602ba6dda92ce2ab5a0bb88ad8c6700dddbf6acbaa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f70657a6465746f7272652f70696d702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/glopezdetorre/pimp/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/532f84a386401f102c67bac7d36ecc08362ced8be9c97129d76f10a392eebc36/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f70657a6465746f7272652f70696d702f6261646765732f7175616c6974792d73636f72652e706e673f6272616e63683d6d6173746572)](https://scrutinizer-ci.com/g/glopezdetorre/pimp/?branch=master)

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

[](#installation)

Using *composer*, inside your project root run:

```
composer require gorka/pimp

```

Container
---------

[](#container)

Simple use case:

```
use Gorka\Pimp\Container;
use Gorka\Pimp\ServiceFactory;

$container = new Container([
    'serviceOne' => function ($c) {
        return new MyService();
    },
    'serviceTwo' => function ($c) {
        return new MyOtherService($c->get('serviceOne'));
    }
]);

$service = $container->get('serviceOne');

```

You may also add new services or service factories after initialization:

```
$container->add('ServiceThree', function() { return new MyAwesomeService(); });

```

By default, *Pimp* will return same instance each time you call *get()*. If you want to get a new instance each time you may use a *ServiceFactory* instead:

```
$service1 = $container->get('ServiceOne');
$service2 = $container->get('ServiceOne');
var_dump($service1 === $service2); // true

$container->add(
    'ServiceFour',
    ServiceFactory::create(
        function($c) {
            return new MyAwesomeService();
        }
    )
);

$service1 = $container->get('ServiceFour');
$service2 = $container->get('ServiceFour');
var_dump($service1 === $service2); // false

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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 ~27 days

Recently: every ~33 days

Total

10

Last Release

3878d ago

Major Versions

v1.0.3 → v2.0.02015-05-27

v2.0.2 → v3.0.02015-10-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c9d97344b0c756b871dcd04f1dca9c4a432c4fcd95b92f4e71f9bd7ca53c1e3?d=identicon)[glopezdetorre](/maintainers/glopezdetorre)

---

Top Contributors

[![gorkaio](https://avatars.githubusercontent.com/u/4482916?v=4)](https://github.com/gorkaio "gorkaio (37 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/gorka-pimp/health.svg)

```
[![Health](https://phpackages.com/badges/gorka-pimp/health.svg)](https://phpackages.com/packages/gorka-pimp)
```

###  Alternatives

[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9201.2M45](/packages/morilog-jalali)[bruli/php-git-hooks

Git hooks for PHP projects.

675370.8k5](/packages/bruli-php-git-hooks)[nikolaposa/version

Value Object that represents a SemVer-compliant version number.

1406.4M16](/packages/nikolaposa-version)[prooph/common

Common classes used across prooph packages

852.2M27](/packages/prooph-common)[funeralzone/valueobjects

A PHP 7.1 value objects helper library.

66643.3k22](/packages/funeralzone-valueobjects)[tomasnorre/crawler

Crawler extension for TYPO3

58397.5k1](/packages/tomasnorre-crawler)

PHPackages © 2026

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