PHPackages                             pechenin/broker-action - 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. pechenin/broker-action

ActiveLibrary

pechenin/broker-action
======================

016.2k[6 PRs](https://github.com/pechenini/broker-action/pulls)PHP

Since Dec 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pechenini/broker-action)[ Packagist](https://packagist.org/packages/pechenin/broker-action)[ RSS](/packages/pechenin-broker-action/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (7)Used By (0)

Broker Action Bundle
====================

[](#broker-action-bundle)

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

[](#installation)

Add bundle to config/bundles.php

```
BrokerAction\BrokerActionBundle::class => ['all' => true]

```

Create broker\_action.yaml in config/packages folder

Example of broker\_action.yaml:

```
broker_action:
  mapping:
      - { path: 'some.path', action: 'App\Actions\SomeAction' }
      - { path: 'some.path1', action: 'App\Actions\SomeAnotherAction' }

```

Action creation
---------------

[](#action-creation)

Create class that implements `BrokerAction\Framework\ActionInterface`.

Example:

```
use BrokerAction\DTO\ActionResponse;
use BrokerAction\DTO\Error;
use BrokerAction\Framework\ActionInterface;

class SomeAction implements ActionInterface
{
    public function run($data): ActionResponse
    {
        $response = new ActionResponse();
        try {
            echo $data;
            $response->setData($data);
        } catch (\Exception $exception) {
            $response->setError(new Error($exception->getMessage()));
        }

        return $response;
    }
}

```

Find route and fire action
--------------------------

[](#find-route-and-fire-action)

To fire action you should create `TransactionMessageDTO` object and pass it to `route` method of `BrokerAction\Framework\Router`.

Example:

```
use BrokerAction\Framework\Router;
use BrokerAction\DTO\TransactionMessage\TransactionMessageDTO;

class FooClass {

    private $router;

    public function (Router $router) {
        $this->router = $router;
    }

    public function bar() {
        $json = '{
                     "path": "some.path",
                     "payload": {
                         "acc_id": 1
                     }
                 }';
        $message = TransactionMessageDTO::fromJson($json);
        $reponse =$this->router->route($message);
    }
}

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/60bca2b3082f5f2ba2a674d428a27e4e30a4efaee4f4db664a2d4691c9282497?d=identicon)[InvolvedPanda](/maintainers/InvolvedPanda)

---

Top Contributors

[![pechenini](https://avatars.githubusercontent.com/u/27870709?v=4)](https://github.com/pechenini "pechenini (9 commits)")

### Embed Badge

![Health badge](/badges/pechenin-broker-action/health.svg)

```
[![Health](https://phpackages.com/badges/pechenin-broker-action/health.svg)](https://phpackages.com/packages/pechenin-broker-action)
```

PHPackages © 2026

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