Skip to content

Commit 9e5cceb

Browse files
committed
update php to version 8.1
1 parent f3a93a8 commit 9e5cceb

39 files changed

+494
-403
lines changed

.github/workflows/continuous-integration.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install PHP
1414
uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: 8.0
16+
php-version: 8.1
1717
coverage: none
1818
tools: composer:v2
1919

@@ -33,7 +33,7 @@ jobs:
3333
- name: Install PHP
3434
uses: shivammathur/setup-php@v2
3535
with:
36-
php-version: 8.0
36+
php-version: 8.1
3737
coverage: none
3838
tools: composer:v2
3939

@@ -53,15 +53,15 @@ jobs:
5353
- name: Install PHP
5454
uses: shivammathur/setup-php@v2
5555
with:
56-
php-version: 8.0
56+
php-version: 8.1
5757
coverage: none
5858
tools: composer:v2
5959

6060
- name: Install dependencies with composer
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
@@ -82,7 +82,7 @@ jobs:
8282
- name: Install PHP with extensions
8383
uses: shivammathur/setup-php@v2
8484
with:
85-
php-version: 8.0
85+
php-version: 8.1
8686
extensions: ${{ env.PHP_EXTENSIONS }}
8787
ini-values: ${{ env.PHP_INI_VALUES }}
8888
tools: composer:v2
File renamed without changes.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Packagist](https://img.shields.io/packagist/v/php-service-bus/message-serializer.svg)](https://packagist.org/packages/php-service-bus/message-serializer)
44
[![Packagist](https://img.shields.io/packagist/dt/php-service-bus/message-serializer.svg)](https://packagist.org/packages/php-service-bus/message-serializer)
55
![Continuous Integration](https://github.com/php-service-bus/message-serializer/workflows/Continuous%20Integration/badge.svg)
6-
[![codecov](https://codecov.io/gh/php-service-bus/message-serializer/branch/v5.0/graph/badge.svg?token=0bKwdiuo0S)](https://codecov.io/gh/php-service-bus/message-serializer)
6+
[![codecov](https://codecov.io/gh/php-service-bus/message-serializer/branch/v5.1/graph/badge.svg?token=0bKwdiuo0S)](https://codecov.io/gh/php-service-bus/message-serializer)
77
[![Shepherd](https://shepherd.dev/github/php-service-bus/message-serializer/coverage.svg)](https://shepherd.dev/github/php-service-bus/message-serializer)
88

99
This component is part of the [PHP Service Bus](https://github.com/php-service-bus/service-bus): contains common interfaces for implementing in the service bus.

composer.json

+25-18
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,48 @@
1919
"autoload": {
2020
"psr-4": {
2121
"ServiceBus\\MessageSerializer\\": "src/"
22-
}
22+
},
23+
"files": [
24+
"src/Symfony/functions.php"
25+
]
2326
},
2427
"autoload-dev": {
2528
"psr-4": {
2629
"ServiceBus\\Common\\Tests\\": "vendor/php-service-bus/common/tests",
2730
"ServiceBus\\MessageSerializer\\Tests\\": "tests/"
28-
}
31+
},
32+
"files": [
33+
"src/Symfony/functions.php"
34+
]
2935
},
3036
"require": {
31-
"php": ">=8.0",
37+
"php": ">=8.1",
3238
"ext-json": "*",
3339
"ext-iconv": "*",
34-
"php-service-bus/common": "v5.0.*",
35-
"doctrine/annotations": "v1.11.*",
36-
"phpdocumentor/reflection-docblock": "v5.2.*",
37-
"symfony/property-access": "v5.2.*",
38-
"symfony/property-info": "v5.2.*",
39-
"symfony/serializer": "v5.2.*"
40+
"php-service-bus/common": "v5.1.*",
41+
"doctrine/annotations": "v1.13.*",
42+
"phpdocumentor/reflection-docblock": "v5.3.*",
43+
"symfony/property-access": "v5.4.*",
44+
"symfony/property-info": "v5.4.*",
45+
"symfony/serializer": "v5.4.*"
4046
},
4147
"require-dev": {
42-
"php-service-bus/code-style-config": "v1.3.*",
48+
"php-service-bus/code-style-config": "v5.1.*",
4349
"phpunit/phpunit": "v9.5.*",
44-
"vimeo/psalm": "v4.6.*",
45-
"phpstan/phpstan": "v0.12.*"
50+
"vimeo/psalm": "v4.13.*",
51+
"phpstan/phpstan": "v1.2.*",
52+
"boesing/psalm-plugin-stringf": "v1.1.*"
4653
},
4754
"prefer-stable": true,
4855
"minimum-stability": "stable",
4956
"scripts": {
5057
"psalm": "rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml",
51-
"phpstan": "./vendor/bin/phpstan analyse src --level 7",
52-
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --debug --verbose --debug",
53-
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --debug --verbose --debug",
54-
"cs-check": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
55-
"cs-fix": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
56-
"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"
58+
"phpstan": "./vendor/bin/phpstan analyse src --level 9",
59+
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose --debug",
60+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose --debug",
61+
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
62+
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
63+
"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"
5764
},
5865
"config": {
5966
"optimize-autoloader": true

phpstan.neon

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
parameters:
2-
ignoreErrors:
3-
-
4-
message: '#@return with type mixed#'
5-
path: %currentWorkingDirectory%/src
62
checkMissingIterableValueType: false
73
checkGenericClassInNonGenericObjectType: false
4+
ignoreErrors:
5+
- '#Cannot cast mixed to int#'

phpunit.xml

+17-7
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.3/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,11 +27,11 @@
1727
</php>
1828
<testsuites>
1929

20-
<testsuite name="Component: common">
30+
<testsuite name="PHP Service Bus: Common component">
2131
<directory>./vendor/php-service-bus/common/tests/</directory>
2232
</testsuite>
2333

24-
<testsuite name="Message serializer component">
34+
<testsuite name="PHP Service Bus: Message serializer component">
2535
<directory>./tests/</directory>
2636
</testsuite>
2737

psalm.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
totallyTyped="true"
44
useDocblockTypes="true"
55
useDocblockPropertyTypes="true"
6-
allowPhpStormGenerics="true"
76
strictBinaryOperands="true"
87
findUnusedPsalmSuppress="true"
98
ignoreInternalFunctionFalseReturn="false"
@@ -21,5 +20,9 @@
2120

2221
<issueHandlers>
2322
<PropertyNotSetInConstructor errorLevel="suppress"/>
23+
<UnnecessaryVarAnnotation errorLevel="suppress"/>
2424
</issueHandlers>
25+
<plugins>
26+
<pluginClass class="Boesing\PsalmPluginStringf\Plugin"/>
27+
</plugins>
2528
</psalm>

src/Exceptions/DecodeMessageFailed.php renamed to src/Exceptions/DecodeObjectFailed.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
18-
final class DecodeMessageFailed extends \RuntimeException implements SerializerExceptionMarker
15+
final class DecodeObjectFailed extends \RuntimeException implements SerializerExceptionMarker
1916
{
2017
}

src/Exceptions/DenormalizeFailed.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
1815
final class DenormalizeFailed extends \RuntimeException implements SerializerExceptionMarker
1916
{
2017
}

src/Exceptions/EncodeMessageFailed.php renamed to src/Exceptions/EncodeObjectFailed.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
18-
final class EncodeMessageFailed extends \RuntimeException implements SerializerExceptionMarker
15+
final class EncodeObjectFailed extends \RuntimeException implements SerializerExceptionMarker
1916
{
2017
}

src/Exceptions/NormalizationFailed.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
1815
final class NormalizationFailed extends \RuntimeException implements SerializerExceptionMarker
1916
{
2017
}

src/Exceptions/SerializationFailed.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
1815
final class SerializationFailed extends \RuntimeException implements SerializerExceptionMarker
1916
{
2017
}

src/Exceptions/SerializerExceptionMarker.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
1815
interface SerializerExceptionMarker
1916
{
2017
}

src/Exceptions/UnserializeFailed.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

11-
declare(strict_types = 0);
11+
declare(strict_types=0);
1212

1313
namespace ServiceBus\MessageSerializer\Exceptions;
1414

15-
/**
16-
*
17-
*/
1815
final class UnserializeFailed extends \RuntimeException implements SerializerExceptionMarker
1916
{
2017
}

src/MessageDecoder.php

-42
This file was deleted.

src/MessageEncoder.php

-40
This file was deleted.

src/MessageSerializer.php

-20
This file was deleted.

0 commit comments

Comments
 (0)