PHPackages                             bezdomni/tactician-pimple - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. bezdomni/tactician-pimple

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

bezdomni/tactician-pimple
=========================

Tactician command locator for the Pimple DI container

1.0.0(10y ago)521.7k1MITPHPPHP &gt;=5.5

Since Jan 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ihabunek/tactician-pimple)[ Packagist](https://packagist.org/packages/bezdomni/tactician-pimple)[ RSS](/packages/bezdomni-tactician-pimple/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

Tactician Pimple Locator
========================

[](#tactician-pimple-locator)

Allows lazy loading of command handlers from a [Pimple](http://pimple.sensiolabs.org/) dependency injection container.

[![Travis](https://camo.githubusercontent.com/8153692061537d2ac11b06fe04c7cab44a67249afcc3676302ed70f4df367c1b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f69686162756e656b2f74616374696369616e2d70696d706c652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ihabunek/tactician-pimple)[![Packagist](https://camo.githubusercontent.com/dcb4b5730e5ac868c6d234602d8b1eb32c96e1a57189cc07271cba98783fef57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62657a646f6d6e692f74616374696369616e2d70696d706c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bezdomni/tactician-pimple)[![Packagist](https://camo.githubusercontent.com/4ac2a44e4b45704959ae595f1245b4c48d31eaacb69d4c5a451db2579a9fbeb2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62657a646f6d6e692f74616374696369616e2d70696d706c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/ihabunek/tactician-pimple/blob/master/LICENSE)

Install
-------

[](#install)

Install via composer

```
composer require bezdomni/tactician-pimple

```

Usage
-----

[](#usage)

Presuming you have a couple of commands: `UserAddCommand`, `UserDeleteCommand`, and corresponding handlers `UserAddHandler`, `UserDeleteHandler`.

```
use Bezdomni\Tactician\Pimple\PimpleLocator;
use League\Tactician\CommandBus;
use League\Tactician\Handler\CommandHandlerMiddleware;
use League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor;
use League\Tactician\Handler\MethodNameInflector\HandleInflector;
use Pimple\Container;

// Create a container and configure the handlers on it
$container = new Container();
$container['handlers.user.add'] = function () {
    echo "Creating AddUserHandler\n";
    return new AddUserHandler();
};
$container['handlers.user.delete'] = function () {
    echo "Creating DeleteUserHandler\n";
    return new DeleteUserHandler();
};

// Map command class names to container keys holding corresponding handlers
$locatorMap = [
    AddUserCommand::class => 'handlers.user.add',
    DeleteUserCommand::class => 'handlers.user.delete',
];

// Create the locator
$locator = new PimpleLocator($container, $locatorMap);

// Create a command handler middleware using the pimple locator
$middleware = new CommandHandlerMiddleware(
    new ClassNameExtractor(),
    $locator,
    new HandleInflector()
);

// Create the command bus using the middleware, and you're ready to go
$commandBus = new CommandBus([$middleware]);

// Create and run commands on the command bus
$addUserCommand = new AddUserCommand();
$deleteUserCommand = new DeleteUserCommand();

$commandBus->handle($addUserCommand);
$commandBus->handle($deleteUserCommand);
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

3808d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/482138?v=4)[Ivan Habunek](/maintainers/ihabunek)[@ihabunek](https://github.com/ihabunek)

---

Top Contributors

[![ihabunek](https://avatars.githubusercontent.com/u/482138?v=4)](https://github.com/ihabunek "ihabunek (10 commits)")

---

Tags

containerleaguetacticianlocatorpimple

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bezdomni-tactician-pimple/health.svg)

```
[![Health](https://phpackages.com/badges/bezdomni-tactician-pimple/health.svg)](https://phpackages.com/packages/bezdomni-tactician-pimple)
```

###  Alternatives

[league/container

A fast and intuitive dependency injection container.

86792.2M396](/packages/league-container)[league/tactician-container

Tactician integration for any container implementing PSR-11

7710.3M24](/packages/league-tactician-container)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3512.4M3](/packages/mrclay-props-dic)[tomphp/container-configurator

Configure your application and the Dependency Injection Container (DIC) via config arrays or config files.

2040.4k](/packages/tomphp-container-configurator)[jenssegers/lean

Use the league/container with auto-wiring support as the core container in Slim 3

313.4k](/packages/jenssegers-lean)

PHPackages © 2026

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