Skip to content

Commit f5ab3f6

Browse files
committed
[SignalRegistry] apply the patch for code style
1 parent 0aaa7ce commit f5ab3f6

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

src/Symfony/Component/SignalRegistry/SignalRegistry.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\SignalRegistry;
413

514
final class SignalRegistry implements SignalRegistryInterface
@@ -15,7 +24,7 @@ public function register(int $signal, callable $callback): void
1524
{
1625
if (!isset($this->signals[$signal])) {
1726
$previousCallback = pcntl_signal_get_handler($signal);
18-
if (is_callable($previousCallback)) {
27+
if (\is_callable($previousCallback)) {
1928
$this->signals[$signal][] = $previousCallback;
2029
}
2130
}
@@ -26,7 +35,7 @@ public function register(int $signal, callable $callback): void
2635

2736
public function handler(int $signal): void
2837
{
29-
foreach($this->signals[$signal] as $callback) {
38+
foreach ($this->signals[$signal] as $callback) {
3039
$callback($signal);
3140
}
3241
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\SignalRegistry;
413

514
interface SignalRegistryInterface
615
{
716
public function __construct();
17+
818
public function register(int $signal, callable $callback): void;
19+
920
public function handler(int $signal): void;
1021
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* @requires extension pcntl
88
*/
9-
class SignalRegistryTest extends TestCase
9+
class SignalRegistryTest extends TestCase
1010
{
1111
public function tearDown(): void
1212
{
@@ -20,7 +20,7 @@ public function testOneCallbackForASignal_signalIsHandled()
2020
$signalRegistry = new SignalRegistry();
2121

2222
$isHandled = false;
23-
$signalRegistry->register(SIGUSR1, function() use (&$isHandled) {
23+
$signalRegistry->register(SIGUSR1, function () use (&$isHandled) {
2424
$isHandled = true;
2525
});
2626

@@ -34,12 +34,12 @@ public function testTwoCallbacksForASignal_bothCallbacksAreCalled()
3434
$signalRegistry = new SignalRegistry();
3535

3636
$isHandled1 = false;
37-
$signalRegistry->register(SIGUSR1, function() use (&$isHandled1) {
37+
$signalRegistry->register(SIGUSR1, function () use (&$isHandled1) {
3838
$isHandled1 = true;
3939
});
4040

4141
$isHandled2 = false;
42-
$signalRegistry->register(SIGUSR1, function() use (&$isHandled2) {
42+
$signalRegistry->register(SIGUSR1, function () use (&$isHandled2) {
4343
$isHandled2 = true;
4444
});
4545

@@ -56,7 +56,7 @@ public function testTwoSignals_signalsAreHandled()
5656
$isHandled1 = false;
5757
$isHandled2 = false;
5858

59-
$signalRegistry->register(SIGUSR1, function() use (&$isHandled1) {
59+
$signalRegistry->register(SIGUSR1, function () use (&$isHandled1) {
6060
$isHandled1 = true;
6161
});
6262

@@ -65,7 +65,7 @@ public function testTwoSignals_signalsAreHandled()
6565
$this->assertTrue($isHandled1);
6666
$this->assertFalse($isHandled2);
6767

68-
$signalRegistry->register(SIGUSR2, function() use (&$isHandled2) {
68+
$signalRegistry->register(SIGUSR2, function () use (&$isHandled2) {
6969
$isHandled2 = true;
7070
});
7171

@@ -79,12 +79,12 @@ public function testTwoCallbacksForASignal_previousAndRegisteredCallbacksWereCal
7979
$signalRegistry = new SignalRegistry();
8080

8181
$isHandled1 = false;
82-
pcntl_signal(SIGUSR1, function() use (&$isHandled1) {
82+
pcntl_signal(SIGUSR1, function () use (&$isHandled1) {
8383
$isHandled1 = true;
8484
});
8585

8686
$isHandled2 = false;
87-
$signalRegistry->register(SIGUSR1, function() use (&$isHandled2) {
87+
$signalRegistry->register(SIGUSR1, function () use (&$isHandled2) {
8888
$isHandled2 = true;
8989
});
9090

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy