PHPackages                             sbsaga/breakradar - 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. sbsaga/breakradar

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

sbsaga/breakradar
=================

Detect breaking changes between branches

v1.0.1(3mo ago)00MITPHPPHP &gt;=8.1CI passing

Since Jan 4Pushed 3mo agoCompare

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

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

BreakRadar
==========

[](#breakradar)

**Breaking Change Radar for PHP** – detect silent breaking changes in your code, APIs, and public methods before they hit production.

[![BreakRadar](https://camo.githubusercontent.com/20781fade3a6a3234a809f7cf9bdc2367859eea122ed4bb2f547e86e625e37d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f427265616b52616461722d76312e302d626c75653f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/20781fade3a6a3234a809f7cf9bdc2367859eea122ed4bb2f547e86e625e37d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f427265616b52616461722d76312e302d626c75653f7374796c653d666f722d7468652d6261646765)[![PHP](https://camo.githubusercontent.com/75d30661cb77b74dc81d6e196d1c800b1609cef52565f04d224030bcba93c757/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d3838393242463f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/75d30661cb77b74dc81d6e196d1c800b1609cef52565f04d224030bcba93c757/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d3838393242463f7374796c653d666f722d7468652d6261646765)[![License](https://camo.githubusercontent.com/400d846a3d21cab7ea4ada77545615057d8fa65799727f7cc3ea4eb664877c71/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d6c69676874677265793f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/400d846a3d21cab7ea4ada77545615057d8fa65799727f7cc3ea4eb664877c71/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d6c69676874677265793f7374796c653d666f722d7468652d6261646765)

---

🚀 Overview
----------

[](#-overview)

BreakRadar is a **developer-focused CLI tool** that automatically detects breaking changes between your base branch (usually `main`) and your feature/PR branch. It works **even if all tests pass**.

> **Problem it solves:** developers accidentally remove methods, change signatures, or modify public APIs, breaking consumers silently. Normal CI/testing pipelines do **not** catch this.

BreakRadar answers the question:

> *"Did this PR break someone else’s code?"*

---

💡 Key Features
--------------

[](#-key-features)

- ✅ Detect **removed public methods**
- ✅ Detect **changed method signatures**
- ✅ Compare **base branch vs PR branch automatically**
- ✅ Fully **CI-compatible** (GitHub Actions)
- ✅ Git-robust: works with main, master, or any default branch
- ✅ Production-ready CLI
- ✅ JSON + human-readable output
- ✅ Extensible for API field diff, enums, configs in the future

---

🎯 Use Cases
-----------

[](#-use-cases)

1. **Public method removal**

    ```
    public function legacy(): void {}
    ```

    If removed in a PR → BreakRadar fails CI
2. **Method signature change**

    ```
    // Before
    public function create(string $name): void {}
    // After
    public function create(string $name, bool $force): void {}
    ```

    Detected and flagged
3. **API or service integration**

    - Any internal or external consumer using your PHP classes
    - Prevents silent runtime bugs before deployment
4. **Multi-branch / PR pipelines**

    - Detect breaking changes automatically on GitHub Actions
    - Fail PRs before merging

---

🛠 Installation
--------------

[](#-installation)

**Composer:**

```
composer require sbsaga/breakradar --dev
```

**Optional:** global install

```
composer global require sbsaga/breakradar
```

---

⚡ Usage
-------

[](#-usage)

### Local CLI

[](#local-cli)

```
php bin/breakradar check
```

- Will snapshot **base branch** (`origin/main` or `origin/master`)
- Will snapshot **current branch**
- Will compare and report breaking changes
- Exit code = `1` if breaking changes found (CI-friendly)

---

### GitHub Actions

[](#github-actions)

Create `.github/workflows/breakradar.yml`:

```
name: BreakRadar

on:
  pull_request:
    branches: [ main ]
  push:
    branches: [ main ]

jobs:
  check:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: shivammathur/setup-php@v3
        with:
          php-version: '8.2'
          extensions: mbstring, json

      - run: composer install --no-interaction --prefer-dist

      - run: php bin/breakradar check
```

---

🧱 Project Structure
-------------------

[](#-project-structure)

```
breakradar/
├── bin/
│   └── breakradar          # CLI entry point
├── src/
│   ├── Command/            # Symfony Console command
│   ├── Analyzer/           # Git + Public API snapshot
│   ├── Diff/               # Breaking change diff engine
│   ├── Reporter/           # Human-readable reporting
│   └── Config/             # Config (future use)
├── action/
│   └── action.yml          # GitHub Action config
├── tests/                  # PHPUnit tests
├── composer.json
└── README.md

```

---

🧪 Example Workflow
------------------

[](#-example-workflow)

### Add a breaking change

[](#add-a-breaking-change)

```
public function legacy(): void {}
```

Run:

```
php bin/breakradar check
```

Output:

```
No breaking changes detected.

```

### Remove the method

[](#remove-the-method)

```
// Deleted legacy()
```

Run again:

```
Breaking changes detected:
 - Public method removed: App\SomeClass::legacy

```

Exit code: `1` → CI fails

---

📈 Why BreakRadar is Useful
--------------------------

[](#-why-breakradar-is-useful)

- Prevents **silent production bugs**
- Forces **better API discipline**
- Saves **debugging time**
- Stack-agnostic → works for **any PHP backend**
- Especially valuable for **microservices**, libraries, and shared packages

---

⚙️ Configuration
----------------

[](#️-configuration)

- Currently zero-config; snapshots stored in `.breakradar/`
- Future configs possible:
    - Ignore methods/classes
    - Detect API JSON field changes
    - Enum/constant validation

---

🏆 Roadmap (v2+)
---------------

[](#-roadmap-v2)

- API response field diff
- Config / ENV shape checks
- Event / Queue payload checks
- JSON artifact output for CI dashboards
- Automatic PR comments with detailed report

---

📝 License
---------

[](#-license)

MIT License – feel free to fork, extend, or use in commercial projects.

---

👨‍💻 Author
----------

[](#‍-author)

**sbsaga** – PHP backend developer
[GitHub](https://github.com/sbsaga)

---

📦 Download
----------

[](#-download)

```
git clone https://github.com/sbsaga/breakradar.git
cd breakradar
composer install
php bin/breakradar check
```

**BreakRadar:** Stop silent breaking changes before they hit production. 🚨

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance78

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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 ~6 days

Total

2

Last Release

119d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f14a63a25120de3ec7ce2eff77be8ba80345f1de81a84ceaa719ae9d1534687?d=identicon)[sbsagar](/maintainers/sbsagar)

---

Top Contributors

[![sbsaga](https://avatars.githubusercontent.com/u/110087468?v=4)](https://github.com/sbsaga "sbsaga (24 commits)")

### Embed Badge

![Health badge](/badges/sbsaga-breakradar/health.svg)

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

###  Alternatives

[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

4743.5k10](/packages/phel-lang-phel-lang)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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