Skip to content

Commit 3e64b5e

Browse files
authored
Add PHP 8.5 support (#83)
1 parent 13fa06d commit 3e64b5e

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/test-unit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ jobs:
6464
strategy:
6565
fail-fast: false
6666
matrix:
67-
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
67+
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
6868
type: ['Phpunit', 'Phpunit Lowest']
6969
include:
7070
- php: 'latest'
7171
type: 'Phpunit Burn'
7272
env:
73-
LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == '8.4' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}"
73+
LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == '8.5' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}"
7474
services:
7575
mysql:
7676
image: mysql

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ php-lock/lock follows [semantic versioning][1].
2121

2222
## Requirements
2323

24-
- PHP 7.4 - 8.4
24+
- PHP 7.4 - 8.5
2525
- Optionally [nrk/predis][2] to use the Predis locks.
2626
- Optionally the [php-pcntl][3] extension to enable locking with `flock()`
2727
without busy waiting in CLI scripts.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
],
3434
"homepage": "https://github.com/malkusch/lock",
3535
"require": {
36-
"php": ">=7.4 <8.5",
36+
"php": ">=7.4 <8.6",
3737
"psr/log": "^1.0 || ^2.0 || ^3.0",
3838
"symfony/polyfill-php80": "^1.28"
3939
},

src/Util/LockUtil.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public function castFloatToInt(float $value): int
7171
*/
7272
public function formatTimeout(float $value): string
7373
{
74-
$res = (string) round($value, 6);
74+
$res = \is_nan($value)
75+
? 'NAN'
76+
: (string) round($value, 6);
7577
if (\is_finite($value) && strpos($res, '.') === false) {
7678
$res .= '.0';
7779
}

0 commit comments

Comments
 (0)