PHPackages                             switon/invoker - 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. switon/invoker

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

switon/invoker
==============

Guard-aware and intercepted method invocation on top of the DI invoker for Switon Framework

v1.0.0(1mo ago)0315MITPHPPHP &gt;=8.3CI passing

Since Jun 6Pushed 2mo agoCompare

[ Source](https://github.com/switon-php/invoker)[ Packagist](https://packagist.org/packages/switon/invoker)[ Docs](https://github.com/switon-php/invoker)[ RSS](/packages/switon-invoker/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (2)Used By (5)

Switon Invoker Package
======================

[](#switon-invoker-package)

[![CI](https://camo.githubusercontent.com/f58d273ded80a51e26f5c3d540bae69062afbf198705efd318ef26955bdf967a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769746f6e2d7068702f696e766f6b65722f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4349)](https://github.com/switon-php/invoker/actions/workflows/ci.yml) [![PHP 8.3+](https://camo.githubusercontent.com/c03f51341eebaefabbf137e291b20523fc74b4ffd084406d88524d266d95085d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d373737424234)](https://www.php.net/)

Switon's invoker layer that implements `Switon\Invoking\InvokerInterface` on top of `Switon\Di\InvokerInterface`, adding guard attributes and interceptors.

Highlights
----------

[](#highlights)

- **One invocation entrypoint:** callables, closures, and invokable objects all share the same path.
- **Flexible argument matching:** position, name, type, and defaults can be combined.
- **Guard support:** method guards can run before the target callable.
- **Interceptor support:** pre, post, and exception handling can wrap the call.
- **Built on DI:** the layer sits on top of the container invoker used by the framework.

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

[](#installation)

```
composer require switon/invoker
```

Quick Start
-----------

[](#quick-start)

```
use Switon\Core\Attribute\Autowired;
use Switon\Invoking\InvokerInterface;

class RequestHandler
{
    #[Autowired] protected InvokerInterface $invoker;

    public function handle(object $controller, string $action, array $routeParams): mixed
    {
        return $this->invoker->invoke([$controller, $action], $routeParams);
    }
}
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance87

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

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

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc0f20ad15b0ae9fbf9c6e2cd3008692b0c88a877ec8d3e0119211314bf86fc8?d=identicon)[switon](/maintainers/switon)

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (8 commits)")

---

Tags

dispatchinvokerreflectionswitoninvokerreflectiondispatchswiton

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/switon-invoker/health.svg)

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

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.0k736.5M37](/packages/phpdocumentor-reflection-common)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k317.3M3.3k](/packages/symfony-property-access)[php-di/invoker

Generic and extensible callable invoker

26764.7M69](/packages/php-di-invoker)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12525.9M149](/packages/phpdocumentor-reflection)[php-di/phpdoc-reader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

7433.3M58](/packages/php-di-phpdoc-reader)[minime/annotations

The KISS PHP annotations library

233390.7k38](/packages/minime-annotations)

PHPackages © 2026

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