Skip to content

Commit 56cd0d9

Browse files
committed
Saga refactoring
1 parent acc851f commit 56cd0d9

File tree

96 files changed

+2479
-2025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2479
-2025
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 5 additions & 5 deletions
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
@@ -91,7 +91,7 @@ jobs:
9191
- name: Install PHP with extensions
9292
uses: shivammathur/setup-php@v2
9393
with:
94-
php-version: 8.0
94+
php-version: 8.1
9595
extensions: ${{ env.PHP_EXTENSIONS }}
9696
ini-values: ${{ env.PHP_INI_VALUES }}
9797
tools: composer:v2
File renamed without changes.

README.md

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

99
This component is part of the [PHP Service Bus](https://github.com/php-service-bus/service-bus): saga pattern implementation
1010

1111
## Documentation
12-
[Sagas](https://github.com/php-service-bus/service-bus/blob/v5.0/.documentation/sagas.md)
12+
[Sagas](https://github.com/php-service-bus/service-bus/blob/v5.1/.documentation/sagas.md)
1313

1414
## Contributing
1515
Contributions are welcome! Please read [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"files": [
2525
"src/functions.php",
26+
"src/Configuration/functions.php",
2627
"src/Store/Sql/functions.php"
2728
]
2829
},
@@ -37,6 +38,7 @@
3738
},
3839
"files": [
3940
"src/functions.php",
41+
"src/Configuration/functions.php",
4042
"src/Store/Sql/functions.php"
4143
]
4244
},
@@ -46,14 +48,15 @@
4648
"php-service-bus/mutex": "v5.1.*",
4749
"php-service-bus/annotations-reader":"v5.1.*",
4850
"php-service-bus/messages-router": "v5.1.*",
51+
"php-service-bus/argument-resolver": "v5.1.*",
4952
"psr/log": "v1.1.*"
5053
},
5154
"require-dev": {
5255
"php-service-bus/code-style-config": "v5.1.*",
5356
"doctrine/dbal": "v3.2.*",
5457
"phpunit/phpunit": "v9.5.*",
55-
"vimeo/psalm": "v4.13.*",
56-
"phpstan/phpstan": "v1.2.*",
58+
"vimeo/psalm": "v4.19.*",
59+
"phpstan/phpstan": "v1.4.*",
5760
"boesing/psalm-plugin-stringf": "v1.1.*"
5861
},
5962
"prefer-stable": true,
@@ -68,6 +71,9 @@
6871
"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"
6972
},
7073
"config": {
71-
"optimize-autoloader": true
74+
"optimize-autoloader": true,
75+
"allow-plugins": {
76+
"composer/package-versions-deprecated": true
77+
}
7278
}
7379
}

phpstan.neon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
parameters:
22
checkMissingIterableValueType: false
3-
checkGenericClassInNonGenericObjectType: false
3+
checkGenericClassInNonGenericObjectType: false
4+
ignoreErrors:
5+
- '#Method ServiceBus\\Sagas\\Saga::.* is unused#'

phpunit.xml

Lines changed: 21 additions & 11 deletions
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>
@@ -19,27 +29,27 @@
1929
</php>
2030
<testsuites>
2131

22-
<testsuite name="Component: common">
32+
<testsuite name="PHP Service Bus: Common component">
2333
<directory>./vendor/php-service-bus/common/tests/</directory>
2434
</testsuite>
2535

26-
<testsuite name="Component: annotations (attributes) reader">
36+
<testsuite name="PHP Service Bus: Annotations (attributes) reader component">
2737
<directory>./vendor/php-service-bus/annotations-reader/tests/</directory>
2838
</testsuite>
2939

30-
<testsuite name="Component: messages router">
40+
<testsuite name="PHP Service Bus: Messages router component">
3141
<directory>./vendor/php-service-bus/messages-router/tests/</directory>
3242
</testsuite>
3343

34-
<testsuite name="Component: mutex">
44+
<testsuite name="PHP Service Bus: Mutex component">
3545
<directory>./vendor/php-service-bus/mutex/tests/</directory>
3646
</testsuite>
3747

38-
<testsuite name="Component: storage">
48+
<testsuite name="PHP Service Bus: Storage component">
3949
<directory>./vendor/php-service-bus/storage/tests/</directory>
4050
</testsuite>
4151

42-
<testsuite name="Saga component">
52+
<testsuite name="PHP Service Bus: Sagas component">
4353
<directory>./tests/</directory>
4454
</testsuite>
4555

psalm.xml

Lines changed: 4 additions & 1 deletion
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/Configuration/Attributes/Exceptions/InvalidSagaEventListenerMethod.php renamed to src/Configuration/Attributes/Exceptions/InvalidSagaHandlerMethod.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* @license https://opensource.org/licenses/MIT
99
*/
1010

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

1313
namespace ServiceBus\Sagas\Configuration\Attributes\Exceptions;
1414

1515
/**
1616
*
1717
*/
18-
final class InvalidSagaEventListenerMethod extends \LogicException
18+
final class InvalidSagaHandlerMethod extends \LogicException
1919
{
2020
public static function tooManyArguments(\ReflectionMethod $reflectionMethod): self
2121
{
@@ -42,7 +42,7 @@ public static function wrongEventArgument(\ReflectionMethod $reflectionMethod):
4242
public static function unexpectedName(string $expected, string $actual): self
4343
{
4444
return new self(\sprintf(
45-
'Invalid method name of the event listener: "%s". Expected: %s',
45+
'Invalid method name of the method: "%s". Expected: %s',
4646
$actual,
4747
$expected
4848
));

0 commit comments

Comments
 (0)