PHPackages                             jowy/tactician-service-provider - 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. jowy/tactician-service-provider

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

jowy/tactician-service-provider
===============================

Silex tactician service provider

v2.1.0(9y ago)33.2k61MITPHPPHP ~5.5

Since Mar 26Pushed 9y ago2 watchersCompare

[ Source](https://github.com/praswicaksono/tactician-service-provider)[ Packagist](https://packagist.org/packages/jowy/tactician-service-provider)[ RSS](/packages/jowy-tactician-service-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (1)

Tactician Service Provider
--------------------------

[](#tactician-service-provider)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2832d91286f860b8d343c8d54b0da6646a43a1e0db8db74cbd345e77f45eb9cf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f41747269656465732f74616374696369616e2d736572766963652d70726f76696465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Atriedes/tactician-service-provider/?branch=master) [![Build Status](https://camo.githubusercontent.com/962f87a9e682b0997a0aa20edf816020f49cae1b55e4462c455f4e3481f0ced7/68747470733a2f2f7472617669732d63692e6f72672f41747269656465732f74616374696369616e2d736572766963652d70726f76696465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Atriedes/tactician-service-provider)

Provides Tactician as service to Pimple or Silex Container

### Requirements

[](#requirements)

- PHP &gt;= 5.5
- Silex &gt;= 2.0
- Pimple &gt;= 3.0

### Installation

[](#installation)

`composer require jowy/tactician-service-provider`

### Usage

[](#usage)

#### Register tactician service provider

[](#register-tactician-service-provider)

```
$app->register(
    new TacticianServiceProvider(
        [
            'tactician.inflector' => 'class_name',
            'tactician.middleware' =>
                [
                    new LockingMiddleware()
                ]
       ]
   )
);
```

#### Register command handler in DIC

[](#register-command-handler-in-dic)

Handler must registered in container and use `FQCN` as service id

```
$app[HandlerClass::class] = function() {
    return new HandlerClass();
};
```

#### Map command and handler

[](#map-command-and-handler)

after tactician commadn bus service provider registered, you can map command and handler

```
$app['tactician.locator']->addHandler(CommandClass::class, HandlerClass::class);
```

#### Dispatching Command

[](#dispatching-command)

```
$command = new CommandClass('param');

$container['tactician.command_bus']->handle($command)
```

### Options

[](#options)

#### Inflector

[](#inflector)

- class\_name
- class\_name\_without\_suffix
- handle
- invoke

For more information for choosing `Inflector` please refer to [this documentation](http://tactician.thephpleague.com/tweaking-tactician/)

#### Middleware

[](#middleware)

Middleware can be added while tactician service registered was registered.

```
$app->register(
    new TacticianServiceProvider(
        [
            'tactician.inflector' => 'class_name',
            'tactician.middleware' =>
                [
                    new LockingMiddleware(),
                    new SomeMiddleware(),
                    new OtherMiddleware()
                ]
        ]
    )
);
```

Optionally lazy initialization for middleware is possible by using this method

```
$app[LockingMiddleware::class] = function () {
    return new LockingMiddleware();
};

$app->register(
    new TacticianServiceProvider(
        [
            'tactician.inflector' => 'class_name',
            'tactician.middleware' =>
                [
                    LockingMiddleware::class
                ]
        ]
    )
);
```

### License

[](#license)

MIT, see LICENSE

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~50 days

Recently: every ~30 days

Total

10

Last Release

3619d ago

Major Versions

v1.0.4 → v2.0.0-beta12016-02-20

v1.1.0 → v2.0.02016-02-22

PHP version history (2 changes)v1.0.0PHP &gt;=5.5

v2.0.0-beta1PHP ~5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/023a0bd17758df473ae6dad9f07575a8d0a8c36b06e83396b5962aecba38c722?d=identicon)[PrasWicaksono](/maintainers/PrasWicaksono)

---

Top Contributors

[![carlosbuenosvinos](https://avatars.githubusercontent.com/u/351553?v=4)](https://github.com/carlosbuenosvinos "carlosbuenosvinos (2 commits)")[![italolelis](https://avatars.githubusercontent.com/u/1108049?v=4)](https://github.com/italolelis "italolelis (2 commits)")

### Embed Badge

![Health badge](/badges/jowy-tactician-service-provider/health.svg)

```
[![Health](https://phpackages.com/badges/jowy-tactician-service-provider/health.svg)](https://phpackages.com/packages/jowy-tactician-service-provider)
```

###  Alternatives

[igorw/config-service-provider

A config ServiceProvider for Silex with support for php, json and yaml.

215636.5k13](/packages/igorw-config-service-provider)[bornfreee/tactician-domain-events

A Plugin for Tactician command bus library to work with the recorded Domain Events

25193.2k1](/packages/bornfreee-tactician-domain-events)

PHPackages © 2026

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