PHPackages                             aviator/runnable - 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. aviator/runnable

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

aviator/runnable
================

Static constructor and handler trait with interface.

0.1.0(8y ago)21.6k↑288.2%MITPHPPHP &gt;=7.0.0

Since Dec 19Pushed 8y ago2 watchersCompare

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

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

[![Build Status](https://camo.githubusercontent.com/1829509ac9cb957b03f5f79979c79ca88ba66c48c97c57dee1c0ce9e99151b79/68747470733a2f2f7472617669732d63692e6f72672f64616e69656c736465626f65722f72756e6e61626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/danielsdeboer/runnable)[![Latest Stable Version](https://camo.githubusercontent.com/62ee00ae0a4f21d37a3fb1308da4c95fa6b1bad44c50d865ce6601fe89e98e27/68747470733a2f2f706f7365722e707567782e6f72672f61766961746f722f72756e6e61626c652f762f737461626c65)](https://packagist.org/packages/aviator/runnable).[![License](https://camo.githubusercontent.com/e48453df256b4c5a88c627f2afdb1d07a3c65b6488607c390694de47652d8ccd/68747470733a2f2f706f7365722e707567782e6f72672f61766961746f722f72756e6e61626c652f6c6963656e7365)](https://packagist.org/packages/aviator/runnable)

Overview
--------

[](#overview)

This package provides a static constructor and handler interface, and a trait that implements the interface.

### Installation

[](#installation)

Via Composer:

```
composer require aviator/runnable

```

### Testing

[](#testing)

Via Composer:

```
composer test

```

### Usage

[](#usage)

Use the trait:

```
class Something
{
    use RunnableTrait;
}
```

Then the class can be instantiated and handled using `Class::run()()`. The static `run` method returns a closure which accepts any arguments the method (by default `get()`) requires:

```
$closure = Something::run($arg1);
$result = $closure($arg2);

// Or just:

$result = Something::run($arg1)($arg2);
```

The trait also pulls in `Aviator\Makeable`, so you get the static constructor `make()` out of the box.

The interface is optional, though it can be useful in composite interfaces to specify that a static constructor should be present:

```
interface SomeInterface extends Runnable, SomeOtherInterface
{
    /* etc */
}
```

By default the trait will call `get()`, but this can be overridden:

```
class Something
{
    use RunnableTrait;

    protected static $method = 'handle';

    public function handle ($arg)
    {
        /* etc */
    }
}

$result = Something::run()('arg');

// Calls the handle() method.
```

The magic of late static binding means you can override the default method on classes extending abstract classes and classes extending classes, etc.

Other
-----

[](#other)

### License

[](#license)

This package is licensed with the [MIT License (MIT)](LICENSE).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

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

3063d ago

### Community

Maintainers

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

---

Top Contributors

[![danielsdeboer](https://avatars.githubusercontent.com/u/13170241?v=4)](https://github.com/danielsdeboer "danielsdeboer (2 commits)")

---

Tags

handlerphpphp7static-constructorutilityphpconstructorstaticPHP7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aviator-runnable/health.svg)

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

PHPackages © 2026

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