NormalizedConfigurationParameters by one level. This only affects the Psalm type and is not validated at runtime.*Interface suffix from interfaces.NormalizedConfigurationParameters.After 3 years of usage in production, I feel the package is stable enough to be worth a 1.0.0 release 🙂
Updated the name of the package as I've realized that CQRS is not about separation of endpoints, but of models. And the package doesn't have anything to do with the models. It helps with CQS tough, therefore the new naming reflects that.
cqrs to cqs-routing.DigitalCraftsman\CQRS to DigitalCraftsman\CQSRouting.SilentExceptionWrapper to registered handler wrappers.SilentExceptionHandler to a supported handler wrapper.handle to __invoke method for CommandHandlerInterface and QueryHandlerInterface. This way the specific command or query can be type hinted in the method signature.[@psalm-immutable](https://github.com/psalm-immutable) keyword from Command and Query. With PHP 8.2 now being the minimum version, the readonly keyword can now be used for your classes.RouteBuilder and made it mandatory. The RouteParameters class was removed in favor of parameters for the addCommandRoute and addQueryRoute functions.
addCommandRoute and addQueryRoute. The name generation might change in future versions.DigitalCraftsman\CQRS\ValueObject to DigitalCraftsman\CQRS\Routing.RouteBuilder to reduce noise in routing configuration.RoutePayload::generate.Configuration to RoutePayload and converted to a value objectareParametersValid method to RequestValidatorInterface, RequestDataTransformerInterface, DTOValidatorInterface and HandlerWrapperInterfaceHandlerWrapperConfiguration with simple map configuration.serializer_context configuration. It was identical with the one that can be defined in the Symfony framework configuration.requestValidatorClassesToMergeWithDefault, requestDataTransformerClassesToMergeWithDefault, dtoValidatorClassesToMergeWithDefault or handlerWrapperClassesToMergeWithDefault to RoutePayload. This change is only breaking when you don't use named parameters in your routing (which is highly recommended). Using those parameters instead the version without *ToMergeWithDefault merges the configuration with the default instead of replacing it (see routing docs).DTODataTransformerInterface was renamed to RequestDataTransformerInterface. The method in it was renamed from transformDTOData to transformRequestData and the parameter from $dtoData to $requestData.$dtoData of DTOConstructorInterface was renamed to $requestData.RequestValidatorInterface to validate information that is only accessible from the request itself and will not be part of the DTO or must be validated before a DTO is constructed from the request data.DTOConstructorInterface now returns Command|Query instead of object.HandlerWrapperInterface lost "finally logic". It turns out that there are no cases that can't be handled with just then and catch and on the other hand, there might be issues when multiple handler wrappers are used and can't be matched with the priority, because finally was always triggered last. The methods finally and finallyPriority have been removed from the interface. The logic of implementations must be adapted in a way that the logic is moved from finally into then and catch.[@internal](https://github.com/internal).^6.00.3.0 was removed again as it became clear, that the Symfony Serializer in the full supported range is already able to handle the issue, that DTO Transformer was built for.DTODataTransformerInterface got a new parameter string $dtoClass which needs to be added to all implementations of the interface.DTODataTransformer with which you can automatically handle cases where your command / query is nullable but the Javascript / Typescript client sends undefined (which means doesn't send the properties if they are null) through reflection.Removed workflow concept as it has nothing to do with CQRS and is just a naming concept.
Breaking change
All command, query and workflow classes must be updated to use the new marker interfaces instead of abstraction. That means that for example a previous command that looked like this:
<?php
declare(strict_types=1);
namespace App\Domain\News\WriteSide\CreateNewsArticle;
use DigitalCraftsman\CQRS\Command\Command;
final class CreateNewsArticleCommand extends Command
{
Will now use implements Command instead:
<?php
declare(strict_types=1);
namespace App\Domain\News\WriteSide\CreateNewsArticle;
use DigitalCraftsman\CQRS\Command\Command;
final class CreateNewsArticleCommand implements Command
{
How can I help you explore Laravel packages today?