PHPackages                             felipechiodini/circuit-breaker - 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. felipechiodini/circuit-breaker

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

felipechiodini/circuit-breaker
==============================

Circuit breaker pattern implementation in PHP

0.1.1(3mo ago)03MITPHPPHP &gt;=8.3CI failing

Since Feb 1Pushed 3mo agoCompare

[ Source](https://github.com/felipechiodini/php-circuit-breaker)[ Packagist](https://packagist.org/packages/felipechiodini/circuit-breaker)[ RSS](/packages/felipechiodini-circuit-breaker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Circuit Breaker
===============

[](#circuit-breaker)

A PHP implementation of the Circuit Breaker pattern.

Description
-----------

[](#description)

The Circuit Breaker pattern is a design pattern used in software development to detect failures and encapsulate the logic of preventing a failure from constantly recurring. This implementation provides a simple and flexible way to integrate circuit breaker functionality into your PHP applications.

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

[](#installation)

Install via Composer:

```
composer require felipechiodini/circuit-breaker
```

Usage
-----

[](#usage)

```
use FelipeChiodini\CircuitBreaker\CircuitBreaker;
use FelipeChiodini\CircuitBreaker\Contracts\Repository;
use FelipeChiodini\CircuitBreaker\Contracts\CircuitBreakConfig;

// Implement the Repository and CircuitBreakConfig interfaces
$repository = new YourRepositoryImplementation();
$config = new YourConfigImplementation();

$circuitBreaker = new CircuitBreaker($repository);

try {
    $result = $circuitBreaker->run(function() {
        // Your potentially failing operation
        return someApiCall();
    }, $config);
} catch (IsOpenException $e) {
    // Circuit is open, handle accordingly
} catch (\Throwable $th) {
    // Other exceptions
}
```

Testing
-------

[](#testing)

Run the tests using PHPUnit:

```
./vendor/bin/phpunit tests
```

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

Every ~0 days

Total

2

Last Release

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84378393317077dacc81f31ae5f3b1c5b73cc4a59fef90501083864cd7071f04?d=identicon)[felipechiodini](/maintainers/felipechiodini)

---

Top Contributors

[![felipechiodini](https://avatars.githubusercontent.com/u/50850744?v=4)](https://github.com/felipechiodini "felipechiodini (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/felipechiodini-circuit-breaker/health.svg)

```
[![Health](https://phpackages.com/badges/felipechiodini-circuit-breaker/health.svg)](https://phpackages.com/packages/felipechiodini-circuit-breaker)
```

###  Alternatives

[aws/aws-sdk-php-symfony

A Symfony bundle for v3 of the AWS SDK for PHP

36517.7M22](/packages/aws-aws-sdk-php-symfony)[beberlei/porpaginas

Library that generically solves several pagination issues with DAO/repository abstractions.

163612.6k11](/packages/beberlei-porpaginas)[dillingham/nova-items-field

Nova field to handle array columns

113986.8k2](/packages/dillingham-nova-items-field)[dantleech/what-changed

Report changes in your dependencies

122400.6k1](/packages/dantleech-what-changed)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[apimatic/jsonmapper

Map nested JSON structures onto PHP classes

248.0M56](/packages/apimatic-jsonmapper)

PHPackages © 2026

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