Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #50663 [Console] Add
SignalMap
to map signal value to its n…
…ame (lyrixx) This PR was merged into the 6.4 branch. Discussion ---------- [Console] Add `SignalMap` to map signal value to its name | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | | License | MIT | Doc PR | I'm migrating some code to use new SF features, but I have a very little regression. Before : ```php private function setUpSignals(): void { pcntl_signal(\SIGTERM, function () { $this->stop('SIGTERM'); }); pcntl_signal(\SIGINT, function () { $this->stop('SIGINT'); }); pcntl_async_signals(true); } ``` Now: ```php public function handleSignal(int $signal): void { // I need the following line $signal = SignalMap::getSignalName($signal); $this->stop("Signal {$signal} received."); } ``` As you can see, now in my log I have an int (`2`, `15`), and not anymore `SIGTERM`, `SIGINT`. Commits ------- 32b7dc8 Add `SignalMap` to map signal value to its name
- Loading branch information