From 8980baa21cbe64d17805825b5f986115eb66a778 Mon Sep 17 00:00:00 2001 From: Jakub Korczowski Date: Fri, 22 Nov 2024 00:08:41 +0100 Subject: [PATCH] chore: enabled support for php 8.4 --- .github/workflows/test.yml | 2 +- pint.json | 1 + src/FileLockResolver.php | 3 ++- tests/FileLockResolverTest.php | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49e9972..0ff4ad8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-latest'] - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] services: redis: image: redis diff --git a/pint.json b/pint.json index 0b31a88..3b7103f 100644 --- a/pint.json +++ b/pint.json @@ -1,4 +1,5 @@ { + "preset": "psr12", "rules": { "header_comment": { "header": "This file is part of the godruoyi/php-snowflake.\n \n(c) Godruoyi \n \nThis source file is subject to the MIT license that is bundled." diff --git a/src/FileLockResolver.php b/src/FileLockResolver.php index 9e77084..9a521b9 100644 --- a/src/FileLockResolver.php +++ b/src/FileLockResolver.php @@ -90,7 +90,8 @@ protected function getSequence(string $filePath, int $currentTime): int } $this->updateContents($contents = $this->incrementSequenceWithSpecifyTime( - $this->cleanOldSequences($contents), $currentTime + $this->cleanOldSequences($contents), + $currentTime ), $f); $this->unlock($f); diff --git a/tests/FileLockResolverTest.php b/tests/FileLockResolverTest.php index b36706b..fe9315a 100644 --- a/tests/FileLockResolverTest.php +++ b/tests/FileLockResolverTest.php @@ -17,6 +17,10 @@ class FileLockResolverTest extends TestCase { + private FileLockResolver $fileLocker; + /** @var callable */ + private $defer; + protected function setUp(): void { [$dir, $defer] = $this->prepareLockPath();