PHPackages                             txiki/callback - 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. txiki/callback

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

txiki/callback
==============

Simple callback manager for PHP

0.1.0(11y ago)21582MITPHPPHP &gt;=5.4.0

Since Feb 26Pushed 11y ago1 watchersCompare

[ Source](https://github.com/dieg0v/txiki-callback)[ Packagist](https://packagist.org/packages/txiki/callback)[ Docs](https://github.com/dieg0v/txiki-callback)[ RSS](/packages/txiki-callback/feed)WikiDiscussions master Synced 1mo ago

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

Txiki Callback
==============

[](#txiki-callback)

Simple callback manager for PHP

[![Author](https://camo.githubusercontent.com/a5910079994ad85d4382304bf54d9f52c7612ab28d1230b8f15ec4a8f1ede1b9/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406469656730762d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/dieg0v)[![Latest Version](https://camo.githubusercontent.com/7f37924d6a10d2dc0dbeb94fb7a268c3721f8adf3541ba0e52f29690ea0c720d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6469656730762f7478696b692d63616c6c6261636b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/dieg0v/txiki-callback/releases)[![Packagist Version](https://camo.githubusercontent.com/9c187ddb7e54c6e5ebccd8d3fa11aefb3abbc5d55c7d61d879af5bbd27ca5926/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7478696b692f63616c6c6261636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/txiki/callback)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a675016d828793d2c7cc4d050b643a4e83eed775a7ea385416467e5cff7dd8f0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6469656730762f7478696b692d63616c6c6261636b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dieg0v/txiki-callback)

Install
-------

[](#install)

Via Composer

```
$ composer require txiki/callback
```

Requirements
------------

[](#requirements)

The following versions of PHP are supported by this version.

- PHP 5.4
- PHP 5.5
- PHP 5.6
- HHVM

Documentation
-------------

[](#documentation)

Simple examples:

```
require '../vendor/autoload.php';

use Txiki\Callback\Call;
use Txiki\Callback\CallableObject;

class DummyClass{
	public function myMethod($foo, $bar)
	{
		return 'Out '.$foo.' - '.$bar;
	}
}

$cObject = new CallableObject( 'DummyClass::myMethod' , ['foor', 'bar']);

// return 'Out foo - bar';
echo $result = Call::dispatch($cObject);
```

```
$a = 'extra';
$cObject = new CallableObject(
	function($foo, $bar) use ($a) {
		return 'Out '.$foo.' - '.$bar.' - '.$a;
	} ,
	['foor', 'bar']
);

// return 'Out foor - bar - extra';
echo $result = Call::dispatch($cObject);
```

Implements ICallable interface to convert your own object on a CallableObject:

```
use Txiki\Callback\ICallable;

class MyObject implements ICallable
{
    public function myMethod()
    {
    }

    public function getCallable()
    {
        return function($id){
            echo 'ok '.$id;
        };
    }

    public function getParams()
    {
        return [999];
    }
}

// return 'ok 999'
echo Call::dispatch(new MyObject());
```

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/dieg0v/txiki-callback/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Diego Vilariño](https://github.com/dieg0v)
- [All Contributors](https://github.com/dieg0v/txiki-callback/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/dieg0v/txiki-callback/blob/master/LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

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

4099d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/870654?v=4)[Diego Vilariño](/maintainers/dieg0v)[@dieg0v](https://github.com/dieg0v)

---

Top Contributors

[![dieg0v](https://avatars.githubusercontent.com/u/870654?v=4)](https://github.com/dieg0v "dieg0v (14 commits)")

---

Tags

callbacktxiki

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/txiki-callback/health.svg)

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

###  Alternatives

[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[zenstruck/callback

Callable wrapper to validate and inject arguments.

569.6M4](/packages/zenstruck-callback)[phpfluent/callback

Allows you execute callbacks in a more dynamic way

1159.2k1](/packages/phpfluent-callback)[foolz/plugin

A plugin system for PHP, with cascading events.

542.1k1](/packages/foolz-plugin)

PHPackages © 2026

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