PHPackages                             innmind/signals - 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. [CLI &amp; Console](/categories/cli)
4. /
5. innmind/signals

ActiveLibrary[CLI &amp; Console](/categories/cli)

innmind/signals
===============

Manage multiple callbacks per signal

5.0.0(3mo ago)097.5k↓26.7%4MITPHPPHP ~8.4CI passing

Since Feb 25Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Innmind/Signals)[ Packagist](https://packagist.org/packages/innmind/signals)[ Docs](http://github.com/Innmind/Signals)[ RSS](/packages/innmind-signals/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (14)Used By (4)

Signals
=======

[](#signals)

[![CI](https://github.com/Innmind/Signals/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Innmind/Signals/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/139ca77e0aa9ded1f4e0ec8c844cba40f36796a2f3f41a78c4b08444d1a5a1da/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f7369676e616c732f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/signals)[![Type Coverage](https://camo.githubusercontent.com/88b4ac251050207cad8d18f9a1a7a1d32178cde9baa21eeab44a222c85e1342f/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f7369676e616c732f636f7665726167652e737667)](https://shepherd.dev/github/innmind/signals)

Small abstraction on top of `pcntl_signal` to allow to register multiple callables for a single signal.

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

[](#installation)

```
composer require innmind/signals
```

Usage
-----

[](#usage)

```
use Innmind\Signals\{
    Handler,
    Signal,
    Info,
};

$handler = Handler::main(); // automatically enable async signal on first `->listen()` call

$handler
    ->listen(Signal::interrupt, function(Signal $signal, Info $info): void {
        echo 'foo';
    })
    ->unwrap();
$handler
    ->listen(Signal::interrupt, function(Signal $signal, Info $info): void {
        echo 'bar';
    })
    ->unwrap();

// do some logic here
```

When above script is executed in a terminal and you do a `ctrl + c` to stop the process it will print `foobar` instead of stopping the script.

If for some reason you need to remove a handler (for example when a child process ended) you can call `$handler->remove($listener)->unwrap()` (remove the listener for all signals).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance81

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Recently: every ~217 days

Total

11

Last Release

100d ago

Major Versions

1.0.0 → 2.0.02020-01-06

2.1.1 → 3.0.02022-02-20

3.1.0 → 4.0.02025-08-20

4.1.1 → 5.0.02026-02-07

PHP version history (6 changes)1.0.0PHP ~7.2

2.0.0PHP ~7.4

2.1.0PHP ~7.4|~8.0

3.0.0PHP ~8.1

3.1.0PHP ~8.2

5.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (92 commits)")

---

Tags

clisignalhandler

### Embed Badge

![Health badge](/badges/innmind-signals/health.svg)

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)[misterion/ko-process

Simple pcntl fork wrapper and process manager

177337.7k6](/packages/misterion-ko-process)

PHPackages © 2026

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