PHPackages                             tabuna/failback - 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. tabuna/failback

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

tabuna/failback
===============

Small wrapper for creating a branch of inaccessibility

2.0(6y ago)44MITPHPPHP ~7.1

Since Oct 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tabuna/failback)[ Packagist](https://packagist.org/packages/tabuna/failback)[ Docs](https://github.com/tabuna/fallback)[ RSS](/packages/tabuna-failback/feed)WikiDiscussions master Synced 4d ago

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

Actions for Failback
====================

[](#actions-for-failback)

Actions for Failback is a lightweight wrapper that empowers you to handle unavailability gracefully.

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

[](#installation)

To install the package, you can use Composer. Simply run the following command:

```
$ composer require tabuna/failback
```

Usage
-----

[](#usage)

#### Setting a Default Value:

[](#setting-a-default-value)

You can create an action with a default value using the following code:

```
use Tabuna\FailBack\Action;

// $result = 'default';
$result = Action::make(function () {
    throw new \Exception();
}, 'default')->run();

// Alternatively, you can use the short helper
$result = failBack(function () {
    throw new \Exception();
}, 'default')();
```

#### Adding Fallback Actions:

[](#adding-fallback-actions)

You can define multiple fallback actions using the `fail` method:

```
// $result = true;
$result = failBack(function () {
    throw new \Exception();
})->fail(function () {
    throw new \Error();
})->fail(function () {
    return true;
})();
```

#### Utilizing Classes:

[](#utilizing-classes)

To specify a fallback action using a class, create an anonymous class with an `__invoke` method:

```
$class = new class {

    /**
     * @return bool
     */
    public function __invoke(): bool
    {
        return true;
    }
};

// $result = true;
$result = failBack(function () {
    throw new Exception();
})->fail($class)->run();
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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 ~92 days

Total

2

Last Release

2320d ago

Major Versions

1.0 → 2.02020-01-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c47797b11041f37c2eec74b09bc6619c8997467d690797ebad0e6ab7cb232b7?d=identicon)[tabuna](/maintainers/tabuna)

---

Top Contributors

[![tabuna](https://avatars.githubusercontent.com/u/5102591?v=4)](https://github.com/tabuna "tabuna (19 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

failbackfallbacktabunafailback

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tabuna-failback/health.svg)

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

###  Alternatives

[bluebaytravel/dosh

Simple currency formatter for PHP.

2120.8k](/packages/bluebaytravel-dosh)

PHPackages © 2026

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