From e3eea3c2a71112bac02e425946312754b52e6a47 Mon Sep 17 00:00:00 2001 From: Sasa Blagojevic Date: Fri, 3 Feb 2023 10:00:36 +0100 Subject: [PATCH] Rename middleware --- README.md | 2 +- composer.json | 2 +- ...esponseMiddleware.php => EmptyCommandResponseMiddleware.php} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/Middleware/Enforce/{EmptyResponseMiddleware.php => EmptyCommandResponseMiddleware.php} (91%) diff --git a/README.md b/README.md index 050fabb..e4df0fd 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Each command will be passed through a chain of Middlewares. By default the chain some Middleware out of the box: * **EventMiddleware** - raises events before and after handling a command or query, and on failure * **TransactionMiddleware** - runs individual _Commands_ or _Queries_ in a Transaction, `begin`, `commit` and `rollback` steps are plain `\Closure` objects, so you can use whichever ORM or Persistence approach you prefer. -* **EmptyResponseMiddleware** - throws an Exception if anything aside from null is returned in _Command_ responses to enforce the _Command-Query Segregation_ +* **EmptyCommandResponseMiddleware** - throws an Exception if anything aside from null is returned in _Command_ responses to enforce the _Command-Query Segregation_ * **ImmutableResponseMiddleware** - throws an Exception if you have properties without _readonly_ modifier defined on your response objects To create your own custom middleware you need to implement the `SasaB\MessageBus\Middleware` interface and provide it diff --git a/composer.json b/composer.json index a5bf838..201d675 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "message-bus", "cqrs" ], - "version": "1.5.3", + "version": "1.6.0", "license": "MIT", "authors": [ { diff --git a/src/Middleware/Enforce/EmptyResponseMiddleware.php b/src/Middleware/Enforce/EmptyCommandResponseMiddleware.php similarity index 91% rename from src/Middleware/Enforce/EmptyResponseMiddleware.php rename to src/Middleware/Enforce/EmptyCommandResponseMiddleware.php index 8154c49..6cfbc95 100644 --- a/src/Middleware/Enforce/EmptyResponseMiddleware.php +++ b/src/Middleware/Enforce/EmptyCommandResponseMiddleware.php @@ -9,7 +9,7 @@ use SasaB\MessageBus\Message; use SasaB\MessageBus\Middleware; -final class EmptyResponseMiddleware implements Middleware +final class EmptyCommandResponseMiddleware implements Middleware { public function __invoke(Message $message, \Closure $next): mixed {