Skip to content

Commit bac9fe7

Browse files
authored
Merge pull request #103 from reactphp-parallel/renovate/major-qa-utilities
Update dependency wyrihaximus/async-test-utilities to v12
2 parents ad30f71 + 6cb611d commit bac9fe7

9 files changed

Lines changed: 971 additions & 818 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Ignoring files for distribution archieves
1616
.github/ export-ignore
1717
etc/ci/ export-ignore
18+
etc/dev-app/ export-ignore
1819
etc/qa/ export-ignore
1920
examples/ export-ignore
2021
tests/ export-ignore

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ all-raw: ## The real runs everything, but due to sponge it has to be ran inside
5151

5252
## Temporary set of migrations to get all my repos in shape
5353
migrations-git-enforce-gitattributes-contents: #### Enforce .gitattributes contents ##*I*##
54-
($(DOCKER_RUN) php -r 'file_put_contents(".gitattributes", base64_decode("IyBTZXQgdGhlIGRlZmF1bHQgYmVoYXZpb3IsIGluIGNhc2UgcGVvcGxlIGRvbid0IGhhdmUgY29yZS5hdXRvY3JsZiBzZXQuCiogdGV4dCBlb2w9bGYKCiMgVGhlc2UgZmlsZXMgYXJlIGJpbmFyeSBhbmQgc2hvdWxkIGJlIGxlZnQgdW50b3VjaGVkCiMgKGJpbmFyeSBpcyBhIG1hY3JvIGZvciAtdGV4dCAtZGlmZikKKi5wbmcgYmluYXJ5CiouanBnIGJpbmFyeQoqLmpwZWcgYmluYXJ5CiouZ2lmIGJpbmFyeQoqLmljbyBiaW5hcnkKKi53ZWJwIGJpbmFyeQoqLmJtcCBiaW5hcnkKKi50dGYgYmluYXJ5CgojIElnbm9yaW5nIGZpbGVzIGZvciBkaXN0cmlidXRpb24gYXJjaGlldmVzCi5naXRodWIvIGV4cG9ydC1pZ25vcmUKZXRjL2NpLyBleHBvcnQtaWdub3JlCmV0Yy9xYS8gZXhwb3J0LWlnbm9yZQpleGFtcGxlcy8gZXh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m9yZQp2YXIvIGV4cG9ydC1pZ25vcmUKLmRldmNvbnRhaW5lci5qc29uIGV4cG9ydC1pZ25vcmUKLmVkaXRvcmNvbmZpZyBleHBvcnQtaWdub3JlCi5naXRhdHRyaWJ1dGVzIGV4cG9ydC1pZ25vcmUKLmdpdGlnbm9yZSBleHBvcnQtaWdub3JlCkNPTlRSSUJVVElORy5tZCBleHBvcnQtaWdub3JlCmNvbXBvc2VyLmxvY2sgZXhwb3J0LWlnbm9yZQpNYWtlZmlsZSBleHBvcnQtaWdub3JlClJFQURNRS5tZCBleHBvcnQtaWdub3JlCgojIERpZmZpbmcKKi5waHAgZGlmZj1waHAK"));' || true)
5555

5656
migrations-git-make-sure-gitignore-exists: #### Make sure .gitignore exists ##*I*##
5757
($(DOCKER_RUN) touch .gitignore || true)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
3636

3737
## License ##
3838

39-
Copyright 2025 [Cees-Jan Kiewiet](http://wyrihaximus.net/)
39+
Copyright 2026 [Cees-Jan Kiewiet](http://wyrihaximus.net/)
4040

4141
Permission is hereby granted, free of charge, to any person
4242
obtaining a copy of this software and associated documentation

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"php": "^8.4",
1414
"ext-parallel": "*",
1515
"react-parallel/event-loop": "^2.1.0",
16-
"react/event-loop": "^1.5",
17-
"react/promise": "^3.3",
18-
"wyrihaximus/constants": "^1.6"
16+
"react/event-loop": "^1.5.0",
17+
"react/promise": "^3.3.0",
18+
"wyrihaximus/constants": "^1.6.0"
1919
},
2020
"require-dev": {
21-
"react-parallel/stubs": "^1.2",
22-
"wyrihaximus/async-test-utilities": "^10.5.0",
21+
"react-parallel/stubs": "^1.2.0",
22+
"wyrihaximus/async-test-utilities": "^12.2.0",
2323
"wyrihaximus/makefiles": "^0.7.15",
2424
"wyrihaximus/ticking-promise": "^3.1.0"
2525
},

composer.lock

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

etc/qa/phpstan.neon

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,6 @@ parameters:
99
identifier: shipmonk.nonNormalizedType
1010
path: ../../src/Runtime.php
1111
count: 10
12-
-
13-
message: '#sleep blocks the event loop#'
14-
path: ../../tests/RuntimeTest.php
15-
-
16-
identifier: shipmonk.checkedExceptionInCallable
17-
path: ../../tests/RuntimeTest.php
18-
-
19-
message: '#Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) with 3 and 3 will always evaluate to true.#'
20-
path: ../../tests/RuntimeTest.php
21-
-
22-
message: '#sleep blocks the event loop#'
23-
path: ../../tests/Types.php
24-
-
25-
identifier: shipmonk.checkedExceptionInCallable
26-
path: ../../tests/Types.php
27-
count: 3
2812
ergebnis:
2913
noExtends:
3014
classesAllowedToBeExtended:

src/Runtime.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
{
1616
private ParallelRuntime $runtime;
1717

18+
/** @api */
1819
public static function create(EventLoopBridge $eventLoopBridge): self
1920
{
2021
return new self($eventLoopBridge, LOCATION);
@@ -49,6 +50,7 @@ public function __construct(private EventLoopBridge $eventLoopBridge, string $au
4950
* @template A3
5051
* @template A4
5152
* @template A5
53+
* @api
5254
*/
5355
public function run(Closure $callable, array $args = []): mixed
5456
{
@@ -61,11 +63,13 @@ public function run(Closure $callable, array $args = []): mixed
6163
return null;
6264
}
6365

66+
/** @api */
6467
public function close(): void
6568
{
6669
$this->runtime->close();
6770
}
6871

72+
/** @api */
6973
public function kill(): void
7074
{
7175
$this->runtime->kill();

tests/RuntimeTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function convertSuccess(): void
2727

2828
try {
2929
$result = $runtime->run(static function (int $sleep): int {
30+
/** @phpstan-ignore wyrihaximus.reactphp.blocking.function.sleep */
3031
sleep($sleep);
3132

3233
return $sleep;
@@ -35,6 +36,7 @@ public function convertSuccess(): void
3536
$runtime->kill();
3637
}
3738

39+
/** @phpstan-ignore staticMethod.alreadyNarrowedType */
3840
self::assertSame($sleep, $result);
3941
}
4042

@@ -47,7 +49,8 @@ public function convertFailure(): void
4749
$runtime = Runtime::create(new EventLoopBridge());
4850

4951
try {
50-
$three = $runtime->run(static function (): never {
52+
$runtime->run(static function (): never {
53+
/** @phpstan-ignore wyrihaximus.reactphp.blocking.function.sleep */
5154
sleep(3);
5255

5356
throw new LatchcombException('Rethrow exception');

tests/Types.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
$runtime = Runtime::create(new EventLoopBridge());
1111

1212
assertType('Closure(): void', (static fn () => $runtime->run(static function (): void {
13+
/** @phpstan-ignore wyrihaximus.reactphp.blocking.function.sleep */
1314
sleep(1);
1415
})));
1516

1617
assertType('Closure(): void', (static fn () => $runtime->run(static function (int $time): void {
18+
/** @phpstan-ignore wyrihaximus.reactphp.blocking.function.sleep */
1719
sleep($time);
1820
}, [1])));
1921

0 commit comments

Comments
 (0)