PHPackages                             colorium/runtime - 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. colorium/runtime

ActiveLibrary

colorium/runtime
================

Runtime Resolver, Annotation and Injector

v0.2(10y ago)0772MITPHPPHP &gt;=5.6

Since Jan 5Pushed 10y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (2)

Callable resolver and annotation parser
=======================================

[](#callable-resolver-and-annotation-parser)

- Read docblock annotations
- Resolve any callable into a formalized `Invokable` instance

Exemple :

```
/**
 * @top notch
 */
class Some
{

    /**
     * @var int
     */
    protected $prop;

    /**
     * @foo bar
     * @param string $name
     */
    public function thing($name)
    {
        return 'Hello ' . $name . ' !';
    }
}

/**
 * @hell o
 */
 function hello()
 {
    return 'Hello !';
 }
```

Annotation
----------

[](#annotation)

Read any meta tag existing in docblock.

```
use Colorium\Runtime\Annotation;

$annotations = Annotation::ofClass('Some'); // ['top' => 'notch']
$top = Annotation::ofClass('Some', 'top'); // 'notch'

$annotations = Annotation::ofProperty('Some', 'prop'); // ['var' => 'int']
$var = Annotation::ofProperty('Some', 'prop', 'var'); // 'int'

$annotations = Annotation::ofMethod('Some', 'thing'); // ['foo' => 'bar', 'param' => 'string $name']
$foo = Annotation::ofMethod('Some', 'thing', 'foo'); // 'bar'

$annotations = Annotation::ofFunction('hello'); // ['hell' => 'o']
$hell = Annotation::ofFunction('hello', 'hell'); // 'o'
```

The value is automaticaly and recursively casted as `string`, `int`, `float`, `bool`, `array` or `object`.

```
/**
 * @key -> null (but exists as annotation)
 * @key true -> bool
 * @key false -> bool
 * @key 10 -> int
 * @key 10.1 -> float
 * @key [10, 10] -> array (inner values are casted as well)
 * @key {foo: bar} -> stdClass with property foo set as 'bar'
 * @key othervalue -> string
 */
```

Resolver
--------

[](#resolver)

Translate any valid callable into a resource instance. Callable can be :

- an user closure: `function(){}`
- an existing function name: `'function_name_that_exists'`
- a class-method couple name: `'Classname::method'`
- a class-method couple array name: `['Classname', 'method']`
- a class-method couple array instance: `[$instance, 'method']`
- an invokable class name: `'Classname'` (same as `Classname::__invoke`)
- an invokable class instance: `$instance` (same as `[$instance, '__invoke']`)

```
use Colorium\Runtime\Resolver;

$invokable = Resolver::of('Some::thing');
if(!$invokable){
    // not a valid callable
}

$invokable->isStaticMethod(); // false
$invokable->isClassMethod(); // true
$invokable->isClosure(); // false

$foo = $invokable->annotation('foo'); // 'bar'
$annotations = $invokable->annotations(); // ['foo' => 'bar']

echo $invokable->call('You'); // Hello You !
echo $invokable('You'); // Hello You !
```

Install
-------

[](#install)

`composer require colorium/runtime`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

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

3783d ago

### Community

Maintainers

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

---

Top Contributors

[![myeti](https://avatars.githubusercontent.com/u/4303536?v=4)](https://github.com/myeti "myeti (10 commits)")

### Embed Badge

![Health badge](/badges/colorium-runtime/health.svg)

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

PHPackages © 2026

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