siriusphp/invokator

Library that implements a unified way to execute a list of commands/callables that are used by various patterns: events, pipelines, middleware etc

Maintainers

👁 adrianmiu

Package info

github.com/siriusphp/invokator

pkg:composer/siriusphp/invokator

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

3.0.0 2026-06-07 15:37 UTC

Requires

Requires (Dev)

Suggests

  • illuminate/support: Required to use the Laravel integration (SiriusInvokatorServiceProvider, Invokator facade, do_* helpers, Blade directives)

Conflicts

None

Replaces

None

MIT 2124bb8a36790649b3dd2a0c7dd25c9f69b39360

  • Adrian Miu <adrian.woop@sirius.ro>

eventsmiddlewareinvokerpipelinescallables

This package is auto-updated.

Last update: 2026-06-12 05:56:14 UTC


README

👁 Source Code
👁 Latest Version
👁 Software License
👁 Build Status
👁 Total Downloads

Sirius Invokator is a library that implements a unified way to execute a list of commands/callables that are used by various patterns:

  1. middlewares
  2. pipelines
  3. events
  4. command bus (with middleware)
  5. actions a la Wordpress
  6. filters a la Wordpress

All of the above patterns have in common that they are actually a list of callables, and they differ in the way they are executed in different ways.

In the case of middlewares, the starting parameter (eg: a HTTP request) is passed from one callable to the next, each callable having the option to terminate with a result or call the next callable in the list.

In the case of pipelines, the result of each callable is passed to the next callable and the last callable will return the result of the pipeline

In the case of events, an event object is passed through each callable in the list and each callable is independent.

In the case of the command bus, a command object is sent to be handled by only one callable.

Elevator pitch

use Sirius\Invokator\Invoker;
use Sirius\Invokator\Callables\CallablePipeline;

$container = app(); // your application DI container
$invoker = new Invoker($container);

$pipeline = new CallablePipeline($invoker);
$pipeline->add('trim')
 ->add('Str::toUppercase')
 ->add(function($value) {
 return $value . '!!!';
 })
 ->add('Logger@info');

$pipeline->run(" hello world "); // returns `HELLO WORLD!!!`

Where to next?