PHPackages                             aguimaraes/bureaucrat - 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. aguimaraes/bureaucrat

AbandonedArchivedLibrary

aguimaraes/bureaucrat
=====================

Failure is my thing

08PHP

Since Dec 10Pushed 8y agoCompare

[ Source](https://github.com/aguimaraes/bureaucrat)[ Packagist](https://packagist.org/packages/aguimaraes/bureaucrat)[ RSS](/packages/aguimaraes-bureaucrat/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

bureaucrat
==========

[](#bureaucrat)

[![Latest Version on Packagist](https://camo.githubusercontent.com/440446be184e74cc0bb1e63a5c6ff1a27e8bec21d37e21185111ec8026860832/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616775696d61726165732f627572656175637261742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aguimaraes/bureaucrat)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/152ebcb08b11f3326ee7a228ef6696882200c399f87a648d9ec641084485405f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616775696d61726165732f627572656175637261742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/aguimaraes/bureaucrat)[![StyleCI](https://camo.githubusercontent.com/0113c5b3f4b3ad49ab159381d415e2d425acb763fd951cff7c1c7f75729fc3ff/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131333731353239392f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/113715299)[![Coverage Status](https://camo.githubusercontent.com/2e5ad62eea16d61eaa18eb1ac840ade6c1d1a7aa9c51be6b693ab0f9b319b395/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616775696d61726165732f627572656175637261742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/aguimaraes/bureaucrat/code-structure)[![Quality Score](https://camo.githubusercontent.com/8a41480fb3454632c7eb3637f57dc453f0d678c6c086c86fa355afb81590538c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616775696d61726165732f627572656175637261742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/aguimaraes/bureaucrat)[![Total Downloads](https://camo.githubusercontent.com/07c4320a308dd890b81c187101c7efd52dc7e46fbd7776c89011b4528dcd8ee5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616775696d61726165732f627572656175637261742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aguimaraes/bureaucrat)

Failure handling for PHP. I would add "elegant" here, but I don't lie.

Don't use it, work in progress.

Install
-------

[](#install)

Via Composer

```
$ composer require aguimaraes/bureaucrat
```

Usage
-----

[](#usage)

```
$retry = (new Retry())
    ->onlyOnException(\RuntimeException::class)
    ->atLeast(3)
    ->withDelay(2, TimeUnit::SECOND)
    ->abortOnException(\DomainException::class);

$circuitBreaker = (new CircuitBreaker())
    ->withFailureThreshold(3, 5)
    ->withSuccessThreshold(4, 5)
    ->withDelay(20, TimeUnit::SECOND)
    ->failOnException(\RuntimeException::class)
    ->failOnTimeOut(1, TimeUnit::MINUTE);

$result = (new Failsafe())
    ->with($retry)
    ->and($circuitBreaker)
    ->run(function() {
        // ... your thing
    });
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Alvaro Guimaraes](https://github.com/aguimaraes)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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/bc8e55ca5f98baaee743093ad63025c2bbaf91724912714160a257275eaf1045?d=identicon)[aguimaraes](/maintainers/aguimaraes)

---

Top Contributors

[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (49 commits)")[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (31 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (10 commits)")[![aguimaraes](https://avatars.githubusercontent.com/u/131234?v=4)](https://github.com/aguimaraes "aguimaraes (9 commits)")[![jotaelesalinas](https://avatars.githubusercontent.com/u/2042875?v=4)](https://github.com/jotaelesalinas "jotaelesalinas (8 commits)")[![hansott](https://avatars.githubusercontent.com/u/3886384?v=4)](https://github.com/hansott "hansott (7 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (7 commits)")[![EmanueleMinotto](https://avatars.githubusercontent.com/u/417201?v=4)](https://github.com/EmanueleMinotto "EmanueleMinotto (5 commits)")[![reinink](https://avatars.githubusercontent.com/u/882133?v=4)](https://github.com/reinink "reinink (5 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (5 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (5 commits)")[![browner12](https://avatars.githubusercontent.com/u/5232313?v=4)](https://github.com/browner12 "browner12 (4 commits)")[![marcqualie](https://avatars.githubusercontent.com/u/101022?v=4)](https://github.com/marcqualie "marcqualie (4 commits)")[![hassankhan](https://avatars.githubusercontent.com/u/1781985?v=4)](https://github.com/hassankhan "hassankhan (3 commits)")[![jclyons52](https://avatars.githubusercontent.com/u/6395559?v=4)](https://github.com/jclyons52 "jclyons52 (3 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (2 commits)")[![dragoonis](https://avatars.githubusercontent.com/u/146321?v=4)](https://github.com/dragoonis "dragoonis (2 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (2 commits)")[![kdubuc](https://avatars.githubusercontent.com/u/895661?v=4)](https://github.com/kdubuc "kdubuc (2 commits)")[![mAAdhaTTah](https://avatars.githubusercontent.com/u/4371429?v=4)](https://github.com/mAAdhaTTah "mAAdhaTTah (2 commits)")

---

Tags

circuit-breakerfailsafefailsafe-callfailureretryretry-libraryretry-policy

### Embed Badge

![Health badge](/badges/aguimaraes-bureaucrat/health.svg)

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

PHPackages © 2026

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