PHPackages                             friendsofhyperf/command-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. friendsofhyperf/command-signals

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

friendsofhyperf/command-signals
===============================

The signals component for Hyperf Command.

v3.1.76(5mo ago)130.8k↑109.2%7MITPHP

Since Sep 8Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/friendsofhyperf/command-signals)[ Packagist](https://packagist.org/packages/friendsofhyperf/command-signals)[ Fund](https://hdj.me/sponsors/)[ GitHub Sponsors](https://github.com/huangdijia)[ RSS](/packages/friendsofhyperf-command-signals/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (48)Used By (7)

Command Signals
===============

[](#command-signals)

[![Latest Stable Version](https://camo.githubusercontent.com/e2de74477cd6475598e58c729ab870d4d08cded880d6e6d120a6cd852b35a2fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269656e64736f666879706572662f636f6d6d616e642d7369676e616c73)](https://packagist.org/packages/friendsofhyperf/command-signals)[![Total Downloads](https://camo.githubusercontent.com/ec7e6dfd3fe469381cf1a378808f83a240f06d49e806f8a4c6dc16aa1039dbcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667269656e64736f666879706572662f636f6d6d616e642d7369676e616c73)](https://packagist.org/packages/friendsofhyperf/command-signals)[![License](https://camo.githubusercontent.com/5e8aac2f8c31b0475b3755655b3533405693d5de5eae68928d9f93a577a52089/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f667269656e64736f666879706572662f636f6d6d616e642d7369676e616c73)](https://github.com/friendsofhyperf/command-signals)

The signals component for Hyperf Command.

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

[](#installation)

```
composer require friendsofhyperf/command-signals
```

Usage
-----

[](#usage)

```
namespace App\Command;

use FriendsOfHyperf\CommandSignals\Traits\InteractsWithSignals;
use Hyperf\Command\Annotation\Command;
use Hyperf\Command\Command as HyperfCommand;
use Psr\Container\ContainerInterface;

#[Command]
class FooCommand extends HyperfCommand
{
    use InteractsWithSignals;

    public function __construct(protected ContainerInterface $container)
    {
        parent::__construct('foo');
    }

    public function configure()
    {
        parent::configure();
        $this->setDescription('Hyperf Demo Command');
    }

    public function handle()
    {
        $this->trap([SIGINT, SIGTERM], function ($signo) {
            $this->warn(sprintf('Received signal %d, exiting...', $signo));
        });

        sleep(10);

        $this->info('Bye!');
    }
}
```

Run
---

[](#run)

- `Ctrl + C`

```
$ hyperf foo
^CReceived signal 2, exiting...
```

- `killall php`

```
$ hyperf foo
Received signal 15, exiting...
[1]    51936 terminated  php bin/hyperf.php foo
```

Contact
-------

[](#contact)

- [Twitter](https://twitter.com/huangdijia)
- [Gmail](mailto:huangdijia@gmail.com)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance72

Regular maintenance activity

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~2 days

Total

47

Last Release

164d ago

PHP version history (2 changes)v3.0.0-rc.8PHP ^8.0

v3.1.0-beta.1PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8337659?v=4)[Deeka Wong](/maintainers/huangdijia)[@huangdijia](https://github.com/huangdijia)

---

Top Contributors

[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (41 commits)")

---

Tags

hyperfv3.1

### Embed Badge

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

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

###  Alternatives

[hyperf/database

A flexible database library.

202.8M257](/packages/hyperf-database)[hyperf/amqp

A amqplib for hyperf.

241.2M56](/packages/hyperf-amqp)[hyperf/http-server

A HTTP Server for Hyperf.

102.8M305](/packages/hyperf-http-server)[hyperf/crontab

A crontab component for Hyperf.

131.6M62](/packages/hyperf-crontab)[hyperf/nacos

Nacos SDK

22487.9k10](/packages/hyperf-nacos)[friendsofhyperf/sentry

The sentry component for Hyperf.

1864.6k](/packages/friendsofhyperf-sentry)

PHPackages © 2026

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