Skip to content

Commit d94928d

Browse files
committed
update php version to 8.1
1 parent a613eb8 commit d94928d

File tree

7 files changed

+35
-21
lines changed

7 files changed

+35
-21
lines changed

.github/workflows/continuous-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: composer update --no-ansi --no-interaction --no-progress
6262

6363
- name: Run phpstan/phpstan
64-
run: ./vendor/bin/phpstan analyse src --level 7
64+
run: ./vendor/bin/phpstan analyse src --level 9
6565

6666
phpunit:
6767
name: PHPUnit

composer.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,28 @@
2727
}
2828
},
2929
"require": {
30-
"php": ">=8.0",
30+
"php": ">=8.1",
3131
"amphp/amp": "v2.6.*",
3232
"amphp/file": "v2.0.*",
3333
"amphp/redis": "v1.0.*"
3434
},
3535
"require-dev": {
3636
"php-service-bus/code-style-config": "v5.1.*",
3737
"phpunit/phpunit": "v9.5.*",
38-
"vimeo/psalm": "v4.12.*",
39-
"phpstan/phpstan": "v1.1.*"
38+
"vimeo/psalm": "v4.13.*",
39+
"phpstan/phpstan": "v1.2.*",
40+
"boesing/psalm-plugin-stringf": "v1.1.*"
4041
},
4142
"prefer-stable": true,
42-
"minimum-stability": "dev",
43+
"minimum-stability": "stable",
4344
"scripts": {
4445
"psalm": "rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml",
45-
"phpstan": "./vendor/bin/phpstan analyse src --level 7",
46+
"phpstan": "./vendor/bin/phpstan analyse src --level 9",
4647
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose --debug",
4748
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose --debug",
4849
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
4950
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
50-
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 7 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
51+
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 9 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
5152
},
5253
"config": {
5354
"optimize-autoloader": true

phpstan.neon

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
parameters:
22
checkMissingIterableValueType: false
33
checkGenericClassInNonGenericObjectType: false
4+
ignoreErrors:
5+
- '#Cannot cast mixed to int#'

phpunit.xml

+19-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false"
3-
backupStaticAttributes="false" beStrictAboutTestsThatDoNotTestAnything="false" colors="true" verbose="true"
4-
convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true"
5-
failOnRisky="true" failOnWarning="true" stopOnFailure="false"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
colors="true"
5+
cacheResult="false"
6+
convertDeprecationsToExceptions="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="true"
11+
stopOnError="false"
12+
stopOnFailure="false"
13+
beStrictAboutChangesToGlobalState="true"
14+
beStrictAboutOutputDuringTests="true"
15+
verbose="true"
16+
>
717
<coverage>
818
<include>
919
<directory>./src</directory>
@@ -17,7 +27,10 @@
1727
<env name="REDIS_CONNECTION_DSN" value="tcp://localhost:6379"/>
1828
</php>
1929
<testsuites>
20-
<testsuite name="Common component">
30+
<testsuite name="PHP Service Bus: Common component">
31+
<directory>./tests/</directory>
32+
</testsuite>
33+
<testsuite name="PHP Service Bus: Mutex component">
2134
<directory>./tests/</directory>
2235
</testsuite>
2336
</testsuites>

psalm.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@
2222
<PropertyNotSetInConstructor errorLevel="suppress"/>
2323
<UnnecessaryVarAnnotation errorLevel="suppress"/>
2424
</issueHandlers>
25-
</psalm>
25+
<plugins>
26+
<pluginClass class="Boesing\PsalmPluginStringf\Plugin"/>
27+
</plugins>
28+
</psalm>

src/Exceptions/SyncException.php

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212

1313
namespace ServiceBus\Mutex\Exceptions;
1414

15-
/**
16-
*
17-
*/
1815
final class SyncException extends \RuntimeException
1916
{
2017
public static function fromThrowable(\Throwable $throwable): self

src/MutexService.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414

1515
use Amp\Promise;
1616

17-
/**
18-
*
19-
*/
2017
interface MutexService
2118
{
2219
/**
2320
* @template T as Promise|\Generator|mixed
2421
*
25-
* @param callable(): T $code
22+
* @psalm-param non-empty-string $id
23+
* @psalm-param callable(): T $code
2624
*
2725
* @return Promise<mixed>
2826
*/

0 commit comments

Comments
 (0)