diff --git a/composer.json b/composer.json index ffae3bf..be4878b 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,8 +34,8 @@ "symfony/lock": "^6.0" }, "require-dev": { - "nunomaduro/phpinsights": "^2.9", - "petrknap/shorts": "^1.3", + "nunomaduro/phpinsights": "^2.11", + "petrknap/shorts": "^2.1", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "^3.7" @@ -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", 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 @@ -