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

ActiveLibrary

mediawiki/callback-container
============================

A very simple callback container/builder library

001PHP

Since Mar 8Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Callback container
==================

[](#callback-container)

[![CI](https://github.com/SemanticMediaWiki/callback-container/actions/workflows/ci.yml/badge.svg)](https://github.com/SemanticMediaWiki/callback-container/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/301ac91e8fb57cb2372629fd93750093f62e0f956092bf3adb34866d6647c3b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6564696177696b692f63616c6c6261636b2d636f6e7461696e65722e737667)](https://camo.githubusercontent.com/301ac91e8fb57cb2372629fd93750093f62e0f956092bf3adb34866d6647c3b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6564696177696b692f63616c6c6261636b2d636f6e7461696e65722e737667)[![Total Download Count](https://camo.githubusercontent.com/30f9ad0a7ba12d9dc816c9839b1c183f44fad22fb4c4d307dfbab6e5fa001db7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6564696177696b692f63616c6c6261636b2d636f6e7461696e65722e737667)](https://camo.githubusercontent.com/30f9ad0a7ba12d9dc816c9839b1c183f44fad22fb4c4d307dfbab6e5fa001db7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6564696177696b692f63616c6c6261636b2d636f6e7461696e65722e737667)[![codecov](https://camo.githubusercontent.com/56b221450bdaaf7b9eadbd8ebdf850002dabb9e57ff5ac9f4a0a40203cfb742d/68747470733a2f2f636f6465636f762e696f2f67682f53656d616e7469634d6564696157696b692f63616c6c6261636b2d636f6e7461696e65722f67726170682f62616467652e7376673f746f6b656e3d536934354e394d734771)](https://codecov.io/gh/SemanticMediaWiki/callback-container)

A simple object instantiator to lazy load registered callback handlers. Part of the code base has been extracted from [Semantic MediaWiki](https://github.com/SemanticMediaWiki/SemanticMediaWiki/) and is now being deployed as independent library.

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

[](#requirements)

- PHP 8.1 or later

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

[](#installation)

The recommended installation method for this library is to add the dependency to your [composer.json](https://getcomposer.org/).

```
{
	"require": {
		"mediawiki/callback-container": "~3.0"
	}
}
```

Usage
-----

[](#usage)

```
use Onoi\CallbackContainer\CallbackContainerFactory;

$callbackContainerFactory = new CallbackContainerFactory();
$containerBuilder = $callbackContainerFactory->newCallbackContainerBuilder();

$containerBuilder->registerCallbackContainer( ... );

$service = $containerBuilder->create( ... );
$service = $containerBuilder->singleton( ... );
```

This [document](/docs/usage.md) contains detailed examples on how to use the `CallbackContainerFactory`and `ContainerBuilder`.

Contribution and support
------------------------

[](#contribution-and-support)

If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the [contribution guidelines](/CONTRIBUTING.md). A list of people who have made contributions in the past can be found [here](https://github.com/SemanticMediaWiki/callback-container/graphs/contributors).

- [File an issue](https://github.com/SemanticMediaWiki/callback-container/issues)
- [Submit a pull request](https://github.com/SemanticMediaWiki/callback-container/pulls)

### Tests

[](#tests)

The library provides unit tests that covers the core-functionality normally run by the \[continues integration platform\]\[travis\]. Tests can also be executed manually using the `composer phpunit` command from the root directory.

Release notes
-------------

[](#release-notes)

- 2.0.0 (2017-02-18)
- Requires PHP 5.5+
- Added `CallbackContainerFactory`
- Added `CallbackContainerBuilder::registerAlias`
- Added `CallbackContainerBuilder::registerFromFile` to allow loading callback definitions from a file
- 1.1.0 (2016-04-30)
- Fixed issue in `registeredObject` for when a singleton override contained a `null` argument
- Deprecated the `CallbackLoader` interface in favour of the `CallbackInstantiator` interface
- Deprecated the `NullCallbackLoader` class in favour of the `NullCallbackInstantiator` class
- 1.0.0 (2015-09-08)
- Added the `CallbackContainer` and `CallbackLoader` interface
- Added the `DeferredCallbackLoader` and `NullCallbackLoader` implementation

License
-------

[](#license)

[GNU General Public License 2.0 or later](https://www.gnu.org/copyleft/gpl.html).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance60

Regular maintenance activity

Popularity1

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 65.6% 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/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://www.gravatar.com/avatar/5d30e82252731745d5060a641de6e9431e1d5722ede97cb1cc94d2975aa54753?d=identicon)[malberts](/maintainers/malberts)

---

Top Contributors

[![mwjames](https://avatars.githubusercontent.com/u/1245473?v=4)](https://github.com/mwjames "mwjames (21 commits)")[![paladox](https://avatars.githubusercontent.com/u/5727000?v=4)](https://github.com/paladox "paladox (7 commits)")[![hexmode](https://avatars.githubusercontent.com/u/43581?v=4)](https://github.com/hexmode "hexmode (2 commits)")[![freephile](https://avatars.githubusercontent.com/u/38368?v=4)](https://github.com/freephile "freephile (1 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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