Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 28b3641

Browse files
committed
up: fix syntax check error on php8.4
1 parent a11e6d5 commit 28b3641

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

‎.github/workflows/php.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
php: [8.1] # 7.3, 7.4,
18+
php: [8.1, 8.2, 8.3, 8.4] # 7.3, 7.4,
1919
os: [ubuntu-latest, macOS-latest] # windows-latest,
2020
# include:
2121
# - os: 'ubuntu-latest'
@@ -53,4 +53,4 @@ jobs:
5353
# Docs: https://getcomposer.org/doc/articles/scripts.md
5454

5555
- name: Run test suite
56-
run: phpunit -vv
56+
run: phpunit

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# System Utils
22

33
[![License](https://img.shields.io/packagist/l/toolkit/sys-utils.svg?style=flat-square)](LICENSE)
4-
[![Php Version](https://img.shields.io/badge/php-%3E8.0.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/toolkit/sys-utils)
4+
[![Php Version Support](https://img.shields.io/packagist/php-v/toolkit/sys-utils)](https://packagist.org/packages/toolkit/sys-utils)
55
[![Latest Stable Version](http://img.shields.io/packagist/v/toolkit/sys-utils.svg)](https://packagist.org/packages/toolkit/sys-utils)
6+
[![Unit-Tests](https://github.com/php-toolkit/sys-utils/actions/workflows/php.yml/badge.svg)](https://github.com/php-toolkit/sys-utils/actions)
67

78
Some useful system utils for php
89

‎composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">8.0.0",
21+
"php": ">8.1",
2222
"toolkit/stdlib": "~2.0"
2323
},
2424
"autoload": {

‎src/Proc/PcntlFunc.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function getSignalHandler(int $signal)
9898
*
9999
* @return bool
100100
*/
101-
public static function asyncSignal(bool $on = null): bool
101+
public static function asyncSignal(?bool $on = null): bool
102102
{
103103
return pcntl_async_signals($on);
104104
}
@@ -135,7 +135,7 @@ public static function clearAlarm(): int
135135
*
136136
* @return array{id: int, pid: int, startAt: int}
137137
*/
138-
public static function fork(callable $onStart, callable $onForkError = null, int $id = 0): array
138+
public static function fork(callable $onStart, ?callable $onForkError = null, int $id = 0): array
139139
{
140140
$info = [];
141141
$pid = pcntl_fork();
@@ -170,7 +170,7 @@ public static function fork(callable $onStart, callable $onForkError = null, int
170170
* @return array|false
171171
* @see ProcessUtil::fork()
172172
*/
173-
public static function create(callable $onStart, callable $onError = null, int $id = 0): bool|array
173+
public static function create(callable $onStart, ?callable $onError = null, int $id = 0): bool|array
174174
{
175175
return self::fork($onStart, $onError, $id);
176176
}
@@ -183,7 +183,7 @@ public static function create(callable $onStart, callable $onError = null, int $
183183
* @return int Return new process PID
184184
* @throws RuntimeException
185185
*/
186-
public static function daemonRun(Closure $beforeQuit = null): int
186+
public static function daemonRun(?Closure $beforeQuit = null): int
187187
{
188188
if (!self::hasPcntl()) {
189189
return 0;
@@ -223,7 +223,7 @@ public static function daemonRun(Closure $beforeQuit = null): int
223223
* @return array
224224
* @see ProcessUtil::forks()
225225
*/
226-
public static function multi(int $number, callable $onStart, callable $onForkError = null): array
226+
public static function multi(int $number, callable $onStart, ?callable $onForkError = null): array
227227
{
228228
return self::forks($number, $onStart, $onForkError);
229229
}
@@ -238,7 +238,7 @@ public static function multi(int $number, callable $onStart, callable $onForkErr
238238
* @return array<int, array{id: int, pid: int, startTime: int}>
239239
* @throws RuntimeException
240240
*/
241-
public static function forks(int $number, callable $onStart, callable $onForkError = null): array
241+
public static function forks(int $number, callable $onStart, ?callable $onForkError = null): array
242242
{
243243
Assert::intShouldGt0($number, 'process number', true);
244244

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /