Skip to content

Commit

Permalink
supported versions
Browse files Browse the repository at this point in the history
- drop support for unmaintained versions
- add support for php8.2/8.3 and symfony 7.0
  • Loading branch information
unixslayer committed May 21, 2024
1 parent 393b76d commit 04789d6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:
strategy:
matrix:
symfony-version:
- "5.2.*"
- "6.0.*"
- "5.4.*"
- "6.4.*"
- "7.0.*"
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"

Expand Down Expand Up @@ -47,14 +48,6 @@ jobs:
restore-keys: |
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
- name: "Require symfony/messenger polyfill for symfony 3.4.*"
if: ${{ matrix.symfony-version == '3.4.*' && matrix.php-version != '8.0' }}
run: "composer require --dev lendable/symfony-messenger-polyfill --no-update"

- name: "Require symfony/messenger"
if: ${{ matrix.symfony-version != '3.4.*' }}
run: "composer require --dev symfony/messenger --no-update"

- name: "Require php-coveralls/php-coveralls"
run: "composer global require php-coveralls/php-coveralls"

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@
"php": "^7.4|^8.0",
"ext-pdo": "*",
"ext-json": "*",
"symfony/config": "^3.4 || ^4.4 || ^5.2 || ^6.0",
"symfony/dependency-injection": "^3.4 || ^4.4 || ^5.2 || ^6.0",
"symfony/http-kernel": "^3.4 || ^4.4 || ^5.2 || ^6.0",
"symfony/framework-bundle": "^3.4 || ^4.4 || ^5.2 || ^6.0",
"symfony/messenger": "^4.2 || ^4.4 || ^5.2 || ^6.0",
"prooph/event-store": "^7.0"
"symfony/config": "^5.4 || ^6.4 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4.39 || ^6.4 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/messenger": "^5.4 || ^6.4 || ^7.0",
"prooph/event-store": "^7.9.0"
},
"require-dev": {
"prooph/pdo-event-store": "^1.12",
"phpunit/phpunit": "^8 || ^9",
"symfony/yaml" : "^3.4 || ^4.4 || ^5.2 || ^6.0",
"phpunit/phpunit": "^9",
"symfony/yaml" : "^5.4 || ^6.4 || ^7.0",
"bookdown/bookdown": "^1.1",
"prooph/bookdown-template": "^0.3",
"friendsofphp/php-cs-fixer": "^3.5",
Expand Down
7 changes: 6 additions & 1 deletion src/Messenger/EventStoreTransactionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope
$this->eventStore->rollback();

if ($e instanceof HandlerFailedException) {
$method = 'getWrappedExceptions';
if (!method_exists($e, $method)) {
$method = 'getNestedExceptions';
}

// Remove all HandledStamp from the envelope so the retry will execute all handlers again.
// When a handler fails, the queries of allegedly successful previous handlers just got rolled back.
throw new HandlerFailedException(
$e->getEnvelope()->withoutAll(HandledStamp::class),
$e->getNestedExceptions()
$e->$method()
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/Command/Fixture/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getCacheDir(): string
return $this->getProjectDir() . '/test/Command/Fixture/var/cache';
}

public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new AddConsoleCommandPass());
parent::build($container);
Expand Down

0 comments on commit 04789d6

Please sign in to comment.