Skip to content

Commit 169055a

Browse files
committed
minor symfony#57798 [Console] be explicit about the signal to reset (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Console] be explicit about the signal to reset | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 72f1f38 be explicit about the signal to reset
2 parents d9ebfb0 + 72f1f38 commit 169055a

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ protected function tearDown(): void
7171

7272
if (\function_exists('pcntl_signal')) {
7373
// We reset all signals to their default value to avoid side effects
74-
for ($i = 1; $i <= 15; ++$i) {
75-
if (9 === $i) {
76-
continue;
77-
}
78-
pcntl_signal($i, \SIG_DFL);
79-
}
74+
pcntl_signal(\SIGINT, \SIG_DFL);
75+
pcntl_signal(\SIGTERM, \SIG_DFL);
76+
pcntl_signal(\SIGUSR1, \SIG_DFL);
77+
pcntl_signal(\SIGUSR2, \SIG_DFL);
8078
}
8179
}
8280

src/Symfony/Component/Console/Tests/ConsoleEventsTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ protected function tearDown(): void
3535
if (\function_exists('pcntl_signal')) {
3636
pcntl_async_signals(false);
3737
// We reset all signals to their default value to avoid side effects
38-
for ($i = 1; $i <= 15; ++$i) {
39-
if (9 === $i) {
40-
continue;
41-
}
42-
pcntl_signal($i, \SIG_DFL);
43-
}
38+
pcntl_signal(\SIGINT, \SIG_DFL);
39+
pcntl_signal(\SIGTERM, \SIG_DFL);
40+
pcntl_signal(\SIGUSR1, \SIG_DFL);
41+
pcntl_signal(\SIGUSR2, \SIG_DFL);
4442
}
4543
}
4644

src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ protected function tearDown(): void
2323
{
2424
pcntl_async_signals(false);
2525
// We reset all signals to their default value to avoid side effects
26-
for ($i = 1; $i <= 15; ++$i) {
27-
if (9 === $i) {
28-
continue;
29-
}
30-
pcntl_signal($i, \SIG_DFL);
31-
}
26+
pcntl_signal(\SIGINT, \SIG_DFL);
27+
pcntl_signal(\SIGTERM, \SIG_DFL);
28+
pcntl_signal(\SIGUSR1, \SIG_DFL);
29+
pcntl_signal(\SIGUSR2, \SIG_DFL);
3230
}
3331

3432
public function testOneCallbackForASignalSignalIsHandled()

0 commit comments

Comments
 (0)