@@ -2,5 +2,5 @@ |
||
2 | 2 | |
3 | 3 | namespace Wonderland\Thread\Exception; |
4 | 4 | |
5 | -class ThreadException extends \Exception{ |
|
5 | +class ThreadException extends \Exception { |
|
6 | 6 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function setUp() |
23 | 23 | { |
24 | - $this->callback = function(){ |
|
24 | + $this->callback = function() { |
|
25 | 25 | }; |
26 | 26 | $this->listener = new Listener(Event::POOL_NEW_THREAD, $this->callback); |
27 | 27 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $this->assertSame([], $this->mediator->getListeners()); |
30 | 30 | $this->assertSame($this->mediator, $this->mediator->addListener($listener)); |
31 | 31 | $this->assertSame([Event::POOL_NEW_THREAD => [$listener]], $this->mediator->getListeners()); |
32 | - $this->assertSame($this->mediator, $this->mediator->removeListener(new Listener('fake', function(){ |
|
32 | + $this->assertSame($this->mediator, $this->mediator->removeListener(new Listener('fake', function() { |
|
33 | 33 | }))); |
34 | 34 | $this->mediator->notify(Event::POOL_NEW_THREAD, new Event('unit-event')); |
35 | 35 | $this->assertSame($this->mediator, $this->mediator->removeListener($listener)); |
@@ -78,12 +78,12 @@ |
||
78 | 78 | public function test_run() |
79 | 79 | { |
80 | 80 | $thread = new Thread(); |
81 | - $thread->setCallback(function (){ return 0; |
|
81 | + $thread->setCallback(function() { return 0; |
|
82 | 82 | |
83 | 83 | }); |
84 | 84 | $thread->setProcessName('unitTest'); |
85 | 85 | $threads = []; |
86 | - $listener = new Listener(Event::POOL_NEW_THREAD, function (){ |
|
86 | + $listener = new Listener(Event::POOL_NEW_THREAD, function() { |
|
87 | 87 | }); |
88 | 88 | |
89 | 89 | $this->threadPool->setMaxRunningThreadNb(10); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | public function test_create() |
18 | 18 | { |
19 | - $callback = function(){ |
|
19 | + $callback = function() { |
|
20 | 20 | }; |
21 | 21 | $thread = new Thread(); |
22 | 22 | $thread->setProcessName('unit-test'); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | public function setUp() |
22 | 22 | { |
23 | - $this->callback = function (){ return 0; |
|
23 | + $this->callback = function() { return 0; |
|
24 | 24 | |
25 | 25 | }; |
26 | 26 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function test_callback() |
48 | 48 | { |
49 | - $callback = function(){ return 1; |
|
49 | + $callback = function() { return 1; |
|
50 | 50 | |
51 | 51 | }; |
52 | 52 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | -declare( strict_types = 1 ); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | -if ( PHP_SAPI !== 'cli' ) { |
|
5 | - die( 'Not an entry point' ); |
|
4 | +if (PHP_SAPI !== 'cli') { |
|
5 | + die('Not an entry point'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | error_reporting( -1 ); |
9 | 9 | |
10 | -ini_set( 'display_errors', '1' ); |
|
10 | +ini_set('display_errors', '1'); |
|
11 | 11 | |
12 | -if ( !is_readable( __DIR__ . '/../vendor/autoload.php' ) ) { |
|
13 | - die( 'You need to install this package with Composer before you can run the tests' ); |
|
12 | +if (!is_readable(__DIR__ . '/../vendor/autoload.php')) { |
|
13 | + die('You need to install this package with Composer before you can run the tests'); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | require_once __DIR__ . '/../vendor/autoload.php'; |