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

ActiveLibrary

kodcube/invoker
===============

Build and Invoke Classes

0.1.1(9y ago)1401MITPHPPHP &gt;=7.0.0

Since Jul 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kodcube/invoker)[ Packagist](https://packagist.org/packages/kodcube/invoker)[ RSS](/packages/kodcube-invoker/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (1)

Invoker for Callable Classes &amp; Methods
==========================================

[](#invoker-for-callable-classes--methods)

This can construct &amp; call a method on a passed passed *classname::method* string.

This library is great for command bus, event bus or message bus processing, where by just passing a class name and method as a string can be instanciated and executed.

Usage &amp; Examples
--------------------

[](#usage--examples)

### Construct

[](#construct)

```
$invoker = new KodCube\Invoker\Invoker();
```

### Callable Object

[](#callable-object)

```
$invoker = new KodCube\Invoker\Invoker();

$result = $invoker('MyClass');
```

is the same as

```
$class = new MyClass();
$result = $class();
```

### Public Method on Object

[](#public-method-on-object)

```
$invoker = new KodCube\Invoker\Invoker();

$result = $invoker('MyClass::myMethod');
```

is the same as

```
$class = new MyClass();
$result = $class->myMethod();
```

### Public Method on Object with constructor arguments

[](#public-method-on-object-with-constructor-arguments)

```
$invoker = new KodCube\Invoker\Invoker();

$result = $invoker('MyClass::myMethod',null,['arg1','arg2']);
```

is the same as

```
$class = new MyClass('arg1','arg2');
$result = $class->myMethod();
```

### Public Method on Object with method arguments

[](#public-method-on-object-with-method-arguments)

```
$invoker = new KodCube\Invoker\Invoker();

$result = $invoker('MyClass::myMethod',['arg1','arg2']);
```

is the same as

```
$class = new MyClass();
$result = $class->myMethod('arg1','arg2');
```

### Public Static Method

[](#public-static-method)

```
$invoker = new KodCube\Invoker\Invoker();

$result = $invoker('MyClass::myMethod');
```

is the same as

```
$result = MyClass::myMethod();
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

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

Every ~1 days

Total

2

Last Release

3587d ago

### Community

Maintainers

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

---

Top Contributors

[![srmiles](https://avatars.githubusercontent.com/u/1708004?v=4)](https://github.com/srmiles "srmiles (3 commits)")

---

Tags

invokephp7phpdependencyinvokeinjectiondependency-injectioncallableinvoker

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-di/invoker

Generic and extensible callable invoker

26857.8M56](/packages/php-di-invoker)[rybakit/arguments-resolver

ArgumentsResolver allows you to determine the arguments to pass to a function or method.

26107.7k7](/packages/rybakit-arguments-resolver)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2857.5k2](/packages/capsule-di)

PHPackages © 2026

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