Skip to content

Commit

Permalink
[10.x] Allows to defer resolving pcntl only if it's available (#50024)
Browse files Browse the repository at this point in the history
* [10.x] Allows to defer resolving pcntl only if it's available

fixes #50022

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 9, 2024
1 parent 689a799 commit 2ff7071
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Concerns/InteractsWithSignals.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ trait InteractsWithSignals
/**
* Define a callback to be run when the given signal(s) occurs.
*
* @param iterable<array-key, int>|int $signals
* @template TSignals of iterable<array-key, int>|int
*
* @param (\Closure():(TSignals))|TSignals $signals
* @param callable(int $signal): void $callback
* @return void
*/
Expand All @@ -28,7 +30,7 @@ public function trap($signals, $callback)
$this->getApplication()->getSignalRegistry(),
);

collect(Arr::wrap($signals))
collect(Arr::wrap(value($signals)))
->each(fn ($signal) => $this->signals->register($signal, $callback));
});
}
Expand Down

0 comments on commit 2ff7071

Please sign in to comment.