Skip to content

Commit 46e525d

Browse files
authored
Merge pull request #40 from reactphp-parallel/renovate/qa-utilities
Update dependency wyrihaximus/makefiles to ^0.10.6
2 parents 116025b + d2060e7 commit 46e525d

13 files changed

Lines changed: 144 additions & 70 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
*.webp binary
1212
*.bmp binary
1313
*.ttf binary
14+
*.blp binary
15+
*.db2 binary
1416

1517
# Ignoring files for distribution archieves
1618
.github/ export-ignore
1719
etc/ci/ export-ignore
20+
etc/dev-app/ export-ignore
1821
etc/qa/ export-ignore
1922
examples/ export-ignore
2023
tests/ export-ignore

.github/renovate.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"github>WyriHaximus/renovate-config:php-package"
5-
]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"github>WyriHaximus/renovate-config:php-package"
5+
],
6+
"constraints": {
7+
"php": "8.4.x",
8+
"composer": "2.x"
9+
}
610
}

Makefile

Lines changed: 85 additions & 30 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"require-dev": {
2727
"react-parallel/pool-tests": "^5.1.0 || ^6.0.0",
2828
"wyrihaximus/async-test-utilities": "^12.2.0",
29-
"wyrihaximus/makefiles": "^0.7.16"
29+
"wyrihaximus/makefiles": "^0.10.6"
3030
},
3131
"autoload": {
3232
"psr-4": {

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/qa/infection.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"timeout": 120,
33
"source": {
44
"directories": [
5-
"src"
5+
"../../src"
66
]
77
},
88
"logs": {

etc/qa/phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<arg value="np" /> <!-- n = ignore warnings, p = show progress -->
88

99
<file>../../etc</file>
10+
<file>../../examples</file>
1011
<file>../../src</file>
1112
<file>../../tests</file>
1213

examples/echo.php

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

3+
declare(strict_types=1);
4+
35
use React\EventLoop\Factory;
46
use ReactParallel\EventLoop\EventLoopBridge;
57
use ReactParallel\Pool\Infinite\Direct;
68

79
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
810

9-
$loop = Factory::create();
11+
$loop = Factory::create();
1012
$infinite = new Direct($loop, new EventLoopBridge($loop), 1);
11-
$infinite->run(function () {
13+
$infinite->run(static function () {
1214
sleep(1);
1315

1416
return 'Hoi!';
15-
})->then(function (string $message) use ($infinite, $loop) {
17+
})->then(static function (string $message) use ($infinite, $loop): void {
1618
echo $message, PHP_EOL;
1719
$infinite->close();
1820
$loop->stop();

examples/exception.php

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

3+
declare(strict_types=1);
4+
35
use React\EventLoop\Factory;
46
use ReactParallel\EventLoop\EventLoopBridge;
57
use ReactParallel\Pool\Infinite\Direct;
@@ -10,16 +12,16 @@
1012

1113
$infinite = new Direct($loop, new EventLoopBridge($loop), 1);
1214

13-
$infinite->run(function () {
15+
$infinite->run(static function () {
1416
throw new RuntimeException('Whoops I did it again!');
1517

1618
return 'We shouldn\'t reach this!';
17-
})->always(function () use ($infinite, $loop) {
19+
})->always(static function () use ($infinite, $loop): void {
1820
$infinite->close();
1921
$loop->stop();
20-
})->then(function (string $oops) {
22+
})->then(static function (string $oops): void {
2123
echo $oops, PHP_EOL;
22-
}, function (Throwable $error) {
24+
}, static function (Throwable $error): void {
2325
echo $error, PHP_EOL;
2426
})->done();
2527

examples/json.php

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

3+
declare(strict_types=1);
34

45
use React\EventLoop\Factory;
56
use ReactParallel\EventLoop\EventLoopBridge;
6-
use function React\Promise\all;
77
use ReactParallel\Pool\Infinite\Direct;
88

9+
use function React\Promise\all;
10+
911
$json = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'large.json');
1012

1113
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
@@ -14,30 +16,31 @@
1416

1517
$infinite = new Direct($loop, new EventLoopBridge($loop), 1);
1618

17-
$promises = [];
18-
$signalHandler = function () use ($infinite, $loop) {
19+
$promises = [];
20+
$signalHandler = static function () use ($infinite, $loop): void {
1921
$loop->stop();
2022
$infinite->close();
2123
};
2224

23-
$tick = function () use (&$promises, $infinite, $loop, $signalHandler, $json, &$tick) {
25+
$tick = static function () use (&$promises, $infinite, $loop, $signalHandler, $json, &$tick): void {
2426
if (count($promises) < 1000) {
25-
$promises[] = $infinite->run(function($json) {
27+
$promises[] = $infinite->run(static function ($json) {
2628
$json = json_decode($json, true);
29+
2730
return md5(json_encode($json));
2831
}, [$json]);
2932
$loop->futureTick($tick);
33+
3034
return;
3135
}
3236

33-
all($promises)->then(function ($v) {
37+
all($promises)->then(static function ($v): void {
3438
var_export($v);
35-
})->always(function () use ($infinite, $loop, $signalHandler) {
39+
})->always(static function () use ($infinite, $loop, $signalHandler): void {
3640
$infinite->close();
3741
$loop->removeSignal(SIGINT, $signalHandler);
3842
$loop->stop();
3943
})->done();
40-
4144
};
4245
$loop->futureTick($tick);
4346

0 commit comments

Comments
 (0)