From ee394f16a6101962112e038a64337cfdc4bd3151 Mon Sep 17 00:00:00 2001 From: Petr Knap <8299754+petrknap@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:18:28 +0200 Subject: [PATCH 1/3] chore: updated molireali --- composer.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ffae3bf..02f3af6 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "WARNING": "This file is updated automatically. All keys will be overwritten, except of 'conflict', 'keywords', 'require', 'require-dev' and 'scripts'.", + "WARNING": "This file is updated automatically. All keys will be overwritten, except of 'conflict', 'keywords', 'require', 'require-dev', 'scripts' and 'suggest'.", "autoload": { "psr-4": { "PetrKnap\\CriticalSection\\": "src" @@ -34,7 +34,7 @@ "symfony/lock": "^6.0" }, "require-dev": { - "nunomaduro/phpinsights": "^2.9", + "nunomaduro/phpinsights": "^2.11", "petrknap/shorts": "^1.3", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", @@ -43,10 +43,11 @@ "scripts": { "test": "phpunit --colors=always --testdox tests", "validate": [ - "phpcs --colors --standard=PSR12 --exclude=PSR12.Files.OpenTag,PSR12.Files.FileHeader,Generic.Files.LineLength src tests", + "composer outdated \"petrknap/*\" --major-only --strict --ansi --no-interaction", + "phpcs --colors --standard=PSR12 --exclude=Generic.Files.LineLength src tests", "phpstan analyse --level max src", "phpstan analyse --level 5 tests", - "phpinsights analyse src" + "phpinsights analyse src --ansi --no-interaction" ], "ci-script": [ "@validate", From 9cc21629540aaa41af3964d65753e1ac8733178f Mon Sep 17 00:00:00 2001 From: Petr Knap <8299754+petrknap@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:18:49 +0200 Subject: [PATCH 2/3] chore: improved code style --- tests/CriticalSectionTest.php | 2 +- tests/NonCriticalSectionTest.php | 2 +- tests/ReadmeTest.php | 4 +++- tests/SymfonyLockCriticalSectionTest.php | 9 +++++---- tests/WrappingCriticalSectionTest.php | 3 ++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/CriticalSectionTest.php b/tests/CriticalSectionTest.php index 676b956..6ea551c 100644 --- a/tests/CriticalSectionTest.php +++ b/tests/CriticalSectionTest.php @@ -1,4 +1,4 @@ -isLocked = false; $lock = self::createMock(LockInterface::class); $lock->expects(self::once()) @@ -34,7 +35,7 @@ public function testAcquiresLockBeforeCriticalSectionIsExecuted(): void public function testReleasesLockAfterCriticalSectionWasExecuted(): void { - $shared = new \stdClass(); + $shared = new stdClass(); $shared->isLocked = true; $lock = self::createMock(LockInterface::class); $lock->method('acquire')->willReturn(true); @@ -53,7 +54,7 @@ public function testReleasesLockAfterCriticalSectionWasExecuted(): void public function testReleasesLockAndThrowsWhenCriticalSectionThrows(): void { - $shared = new \stdClass(); + $shared = new stdClass(); $shared->isLocked = true; $lock = self::createMock(LockInterface::class); $lock->method('acquire')->willReturn(true); diff --git a/tests/WrappingCriticalSectionTest.php b/tests/WrappingCriticalSectionTest.php index 8f628fd..dbd0e64 100644 --- a/tests/WrappingCriticalSectionTest.php +++ b/tests/WrappingCriticalSectionTest.php @@ -1,4 +1,4 @@ - Date: Tue, 23 Apr 2024 23:23:58 +0200 Subject: [PATCH 3/3] chore: updated `petrknap/shorts` --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 02f3af6..be4878b 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ }, "require-dev": { "nunomaduro/phpinsights": "^2.11", - "petrknap/shorts": "^1.3", + "petrknap/shorts": "^2.1", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "^3.7"