From a1e4009e07938186cd1523496e85e559915b8a27 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 10 Sep 2025 14:17:39 +0100 Subject: [PATCH 1/4] style: update pint rules and apply styles --- pint.json | 14 ++++ src/Application/Bus/CommandDispatcher.php | 11 +-- src/Application/Bus/CommandHandler.php | 7 -- .../Bus/CommandHandlerContainer.php | 6 -- src/Application/Bus/CommandQueuer.php | 4 -- .../Bus/Middleware/ExecuteInUnitOfWork.php | 5 -- .../Bus/Middleware/FlushDeferredEvents.php | 4 -- .../Bus/Middleware/LogMessageDispatch.php | 7 -- .../Bus/Middleware/SetupBeforeDispatch.php | 3 - .../Bus/Middleware/TearDownAfterDispatch.php | 3 - .../Bus/Middleware/ValidateCommand.php | 6 +- .../Bus/Middleware/ValidateQuery.php | 6 +- src/Application/Bus/QueryDispatcher.php | 11 +-- src/Application/Bus/QueryHandler.php | 7 -- src/Application/Bus/QueryHandlerContainer.php | 6 -- src/Application/Bus/Validator.php | 14 +--- .../DeferredDispatcher.php | 9 --- .../DomainEventDispatching/Dispatcher.php | 29 ++------ .../DomainEventDispatching/EventHandler.php | 5 -- .../ListenerContainer.php | 6 -- .../Middleware/LogDomainEventDispatch.php | 6 -- .../UnitOfWorkAwareDispatcher.php | 9 --- .../InboundEventBus/EventHandler.php | 7 -- .../InboundEventBus/EventHandlerContainer.php | 4 -- .../InboundEventDispatcher.php | 14 +--- .../Middleware/FlushDeferredEvents.php | 4 -- .../Middleware/HandleInUnitOfWork.php | 5 -- .../Middleware/LogInboundEvent.php | 7 -- .../Middleware/SetupBeforeEvent.php | 3 - .../Middleware/TearDownAfterEvent.php | 3 - .../InboundEventBus/SwallowInboundEvent.php | 4 -- .../UnitOfWork/UnitOfWorkManager.php | 32 --------- .../Application/Bus/BusMiddleware.php | 1 - .../Application/Bus/CommandHandler.php | 1 - .../Bus/CommandHandlerContainer.php | 2 - .../Application/Bus/CommandMiddleware.php | 1 - .../Application/Bus/QueryHandler.php | 1 - .../Application/Bus/QueryHandlerContainer.php | 2 - .../Application/Bus/QueryMiddleware.php | 1 - src/Contracts/Application/Bus/Validator.php | 4 +- .../DeferredDispatcher.php | 2 - .../DomainEventMiddleware.php | 2 - .../ListenerContainer.php | 2 - .../InboundEventBus/EventHandler.php | 2 - .../InboundEventBus/EventHandlerContainer.php | 1 - .../InboundEventMiddleware.php | 2 - .../Ports/Driven/ExceptionReporter.php | 2 - .../Ports/Driven/OutboundEventPublisher.php | 2 - .../Application/Ports/Driven/Queue.php | 2 - .../Application/Ports/Driven/UnitOfWork.php | 1 - .../Ports/Driving/CommandDispatcher.php | 1 - .../Ports/Driving/CommandQueuer.php | 2 - .../Ports/Driving/InboundEventDispatcher.php | 2 - .../Ports/Driving/QueryDispatcher.php | 1 - .../UnitOfWork/UnitOfWorkManager.php | 3 - src/Contracts/Domain/Entity.php | 6 -- src/Contracts/Domain/Events/DomainEvent.php | 1 - .../Domain/Events/DomainEventDispatcher.php | 2 - .../OutboundEventMiddleware.php | 2 - .../OutboundEventBus/PublisherHandler.php | 2 - .../PublisherHandlerContainer.php | 1 - .../Infrastructure/Queue/Enqueuer.php | 2 - .../Queue/EnqueuerContainer.php | 1 - .../Infrastructure/Queue/QueueMiddleware.php | 2 - .../Toolkit/Identifiers/Identifier.php | 5 +- .../Toolkit/Identifiers/IdentifierFactory.php | 2 - .../Toolkit/Identifiers/UuidFactory.php | 6 +- src/Contracts/Toolkit/Iterables/KeyedSet.php | 2 - .../Toolkit/Iterables/ListIterator.php | 2 - src/Contracts/Toolkit/Loggable/Contextual.php | 1 - .../Toolkit/Messages/IntegrationEvent.php | 6 -- .../Toolkit/Pipeline/PipeContainer.php | 2 - src/Contracts/Toolkit/Pipeline/Pipeline.php | 6 -- .../Toolkit/Pipeline/PipelineBuilder.php | 5 +- src/Contracts/Toolkit/Pipeline/Processor.php | 3 - src/Contracts/Toolkit/Result/Error.php | 7 +- src/Contracts/Toolkit/Result/ListOfErrors.php | 5 -- src/Contracts/Toolkit/Result/Result.php | 14 +--- src/Domain/IdentifierOrEntity.php | 21 +----- src/Domain/IsEntity.php | 15 ---- src/Domain/IsEntityWithNullableId.php | 19 ------ .../PsrLogExceptionReporter.php | 5 -- .../OutboundEventBus/ClosurePublisher.php | 11 +-- .../OutboundEventBus/ComponentPublisher.php | 10 +-- .../Middleware/LogOutboundEvent.php | 7 -- .../OutboundEventBus/PublisherHandler.php | 4 -- .../PublisherHandlerContainer.php | 6 -- src/Infrastructure/Queue/ClosureQueue.php | 11 +-- src/Infrastructure/Queue/ComponentQueue.php | 10 +-- src/Infrastructure/Queue/Enqueuer.php | 4 -- .../Queue/EnqueuerContainer.php | 6 -- .../Queue/Middleware/LogPushedToQueue.php | 7 -- src/Testing/FakeDomainEventDispatcher.php | 7 -- src/Testing/FakeExceptionReporter.php | 7 -- src/Testing/FakeOutboundEventPublisher.php | 7 -- src/Testing/FakeQueue.php | 7 -- src/Testing/FakeUnitOfWork.php | 4 -- src/Toolkit/Contracts.php | 6 +- src/Toolkit/Identifiers/Guid.php | 55 +++------------ src/Toolkit/Identifiers/GuidTypeMap.php | 14 +--- src/Toolkit/Identifiers/IdentifierFactory.php | 3 - src/Toolkit/Identifiers/IntegerId.php | 27 -------- src/Toolkit/Identifiers/PossiblyNumericId.php | 28 ++------ src/Toolkit/Identifiers/StringId.php | 27 -------- src/Toolkit/Identifiers/Uuid.php | 50 +------------- src/Toolkit/Identifiers/UuidFactory.php | 47 +------------ src/Toolkit/Iterables/IsKeyedSet.php | 9 --- src/Toolkit/Iterables/IsList.php | 9 --- src/Toolkit/Iterables/IsNonEmptyList.php | 3 - src/Toolkit/Loggable/ObjectDecorator.php | 4 -- src/Toolkit/Loggable/ResultDecorator.php | 4 -- src/Toolkit/Loggable/SimpleContextFactory.php | 3 - src/Toolkit/ModuleBasename.php | 9 --- .../Pipeline/AccumulationProcessor.php | 5 -- .../Pipeline/InterruptibleProcessor.php | 4 -- src/Toolkit/Pipeline/LazyPipe.php | 6 -- src/Toolkit/Pipeline/MiddlewareProcessor.php | 14 ---- src/Toolkit/Pipeline/PipeContainer.php | 6 -- src/Toolkit/Pipeline/Pipeline.php | 13 ---- src/Toolkit/Pipeline/PipelineBuilder.php | 16 ----- src/Toolkit/Pipeline/SimpleProcessor.php | 3 - src/Toolkit/Result/Error.php | 24 +------ src/Toolkit/Result/KeyedSetOfErrors.php | 36 ++-------- src/Toolkit/Result/ListOfErrors.php | 29 +------- src/Toolkit/Result/Meta.php | 33 ++------- src/Toolkit/Result/Result.php | 38 ++--------- src/Toolkit/functions.php | 8 +-- .../Application/Bus/CommandDispatcherTest.php | 23 +------ .../Bus/CommandHandlerContainerTest.php | 3 - .../Application/Bus/CommandHandlerTest.php | 6 -- .../Application/Bus/CommandQueuerTest.php | 17 +---- .../Middleware/ExecuteInUnitOfWorkTest.php | 9 --- .../Middleware/FlushDeferredEventsTest.php | 18 ----- .../Bus/Middleware/LogMessageDispatchTest.php | 24 ------- .../Middleware/SetupBeforeDispatchTest.php | 18 ----- .../Middleware/TearDownAfterDispatchTest.php | 9 --- .../Bus/Middleware/ValidateCommandTest.php | 14 +--- .../Bus/Middleware/ValidateQueryTest.php | 14 +--- .../Application/Bus/QueryDispatcherTest.php | 19 +----- .../Bus/QueryHandlerContainerTest.php | 3 - .../Unit/Application/Bus/QueryHandlerTest.php | 6 -- .../Application/Bus/TestCommandHandler.php | 4 -- .../Unit/Application/Bus/TestQueryHandler.php | 4 -- tests/Unit/Application/Bus/ValidatorTest.php | 6 +- .../DeferredDispatcherTest.php | 37 +--------- .../DomainEventDispatching/DispatcherTest.php | 26 +------ .../ListenerContainerTest.php | 9 --- .../Middleware/LogDomainEventDispatchTest.php | 15 ---- .../TestDomainEvent.php | 3 - .../TestImmediateDomainEvent.php | 3 - .../DomainEventDispatching/TestListener.php | 2 - .../TestListenerAfterCommit.php | 2 - .../TestListenerBeforeCommit.php | 2 - .../UnitOfWorkAwareDispatcherTest.php | 40 +---------- .../EventHandlerContainerTest.php | 9 --- .../InboundEventBus/EventHandlerTest.php | 6 -- .../InboundEventDispatcherTest.php | 23 +------ .../Middleware/FlushDeferredEventsTest.php | 15 ---- .../Middleware/HandleInUnitOfWorkTest.php | 6 -- .../Middleware/LogInboundEventTest.php | 15 ---- .../Middleware/SetupBeforeEventTest.php | 12 ---- .../Middleware/TearDownAfterEventTest.php | 6 -- .../SwallowInboundEventTest.php | 9 --- .../InboundEventBus/TestEventHandler.php | 7 -- .../InboundEventBus/TestInboundEvent.php | 6 -- .../UnitOfWork/UnitOfWorkManagerTest.php | 44 +----------- tests/Unit/Domain/EntityTest.php | 12 ---- .../Domain/EntityWithNullableGuidTest.php | 22 ------ tests/Unit/Domain/IdentifierOrEntityTest.php | 9 --- tests/Unit/Domain/TestEntity.php | 3 - .../Unit/Domain/TestEntityWithNullableId.php | 1 - .../PsrLogExceptionReporterTest.php | 12 ---- .../OutboundEventBus/ClosurePublisherTest.php | 23 +------ .../ComponentPublisherTest.php | 22 +----- .../Middleware/LogOutboundEventTest.php | 15 ---- .../PublisherHandlerContainerTest.php | 6 -- .../OutboundEventBus/PublisherHandlerTest.php | 3 - .../OutboundEventBus/TestOutboundEvent.php | 12 ---- .../OutboundEventBus/TestPublisher.php | 2 - .../Infrastructure/Queue/ClosureQueueTest.php | 23 +------ .../Queue/ComponentQueueTest.php | 23 +------ .../Queue/EnqueuerContainerTest.php | 3 - .../Infrastructure/Queue/EnqueuerTest.php | 3 - .../Queue/Middleware/LogPushedToQueueTest.php | 16 ----- .../Infrastructure/Queue/TestEnqueuer.php | 4 -- tests/Unit/Toolkit/ContractsTest.php | 12 ---- tests/Unit/Toolkit/EnumStringTest.php | 4 +- tests/Unit/Toolkit/EnumValueTest.php | 4 +- tests/Unit/Toolkit/Identifiers/GuidTest.php | 68 +++---------------- .../Toolkit/Identifiers/IntegerIdTest.php | 23 ------- .../Identifiers/PossiblyNumericIdTest.php | 7 +- .../Unit/Toolkit/Identifiers/StringIdTest.php | 26 ------- .../Toolkit/Identifiers/UuidFactoryTest.php | 60 ---------------- tests/Unit/Toolkit/Identifiers/UuidTest.php | 42 ------------ .../Unit/Toolkit/Iterables/IsLazyListTest.php | 6 -- .../Toolkit/Iterables/IsNonEmptyListTest.php | 3 - .../Toolkit/Loggable/ObjectDecoratorTest.php | 15 ---- .../Toolkit/Loggable/ResultDecoratorTest.php | 45 ++---------- tests/Unit/Toolkit/ModuleBasenameTest.php | 20 ------ .../Pipeline/InterruptibleProcessorTest.php | 2 +- tests/Unit/Toolkit/Pipeline/LazyPipeTest.php | 11 +-- .../Pipeline/MiddlewareProcessorTest.php | 4 -- .../Toolkit/Pipeline/PipeContainerTest.php | 3 - .../Toolkit/Pipeline/PipelineBuilderTest.php | 9 --- .../Result/FailedResultExceptionTest.php | 6 -- .../Toolkit/Result/KeyedSetOfErrorsTest.php | 21 ------ .../Unit/Toolkit/Result/ListOfErrorsTest.php | 18 ----- tests/Unit/Toolkit/Result/MetaTest.php | 27 -------- tests/Unit/Toolkit/Result/ResultTest.php | 41 ----------- 209 files changed, 134 insertions(+), 2138 deletions(-) diff --git a/pint.json b/pint.json index 90c97cae..38da0fa1 100644 --- a/pint.json +++ b/pint.json @@ -6,11 +6,25 @@ "clean_namespace": true, "declare_strict_types": true, "list_syntax": true, + "no_empty_phpdoc": true, + "no_superfluous_elseif": true, + "no_superfluous_phpdoc_tags": { + "remove_inheritdoc": true + }, + "no_unneeded_braces": true, "no_useless_nullsafe_operator": true, "no_whitespace_before_comma_in_array": true, "normalize_index_brace": true, "nullable_type_declaration": true, "nullable_type_declaration_for_default_null_value": true, + "ordered_attributes": true, + "ordered_traits": true, + "ordered_types": { + "null_adjustment": "always_last" + }, + "phpdoc_types_order": { + "null_adjustment": "always_last" + }, "simple_to_complex_string_variable": true, "ternary_to_null_coalescing": true, "trailing_comma_in_multiline": { diff --git a/src/Application/Bus/CommandDispatcher.php b/src/Application/Bus/CommandDispatcher.php index d1909a31..b93bf41e 100644 --- a/src/Application/Bus/CommandDispatcher.php +++ b/src/Application/Bus/CommandDispatcher.php @@ -23,15 +23,13 @@ class CommandDispatcher implements ICommandDispatcher { /** - * @var array + * @var array */ private array $pipes = []; /** * CommandDispatcher constructor. * - * @param CommandHandlerContainer $handlers - * @param PipeContainer|null $middleware */ public function __construct( private readonly CommandHandlerContainer $handlers, @@ -42,8 +40,7 @@ public function __construct( /** * Dispatch messages through the provided pipes. * - * @param array $pipes - * @return void + * @param array $pipes */ public function through(array $pipes): void { @@ -52,9 +49,6 @@ public function through(array $pipes): void $this->pipes = $pipes; } - /** - * @inheritDoc - */ public function dispatch(Command $command): Result { $pipeline = PipelineBuilder::make($this->middleware) @@ -71,7 +65,6 @@ public function dispatch(Command $command): Result } /** - * @param Command $command * @return Result */ private function execute(Command $command): Result diff --git a/src/Application/Bus/CommandHandler.php b/src/Application/Bus/CommandHandler.php index 94e254ae..ac48a21c 100644 --- a/src/Application/Bus/CommandHandler.php +++ b/src/Application/Bus/CommandHandler.php @@ -22,15 +22,11 @@ /** * CommandHandler constructor. * - * @param object $handler */ public function __construct(private object $handler) { } - /** - * @inheritDoc - */ public function __invoke(Command $command): Result { assert(method_exists($this->handler, 'execute'), sprintf( @@ -46,9 +42,6 @@ public function __invoke(Command $command): Result return $result; } - /** - * @inheritDoc - */ public function middleware(): array { if ($this->handler instanceof DispatchThroughMiddleware) { diff --git a/src/Application/Bus/CommandHandlerContainer.php b/src/Application/Bus/CommandHandlerContainer.php index 2dacd357..74497f07 100644 --- a/src/Application/Bus/CommandHandlerContainer.php +++ b/src/Application/Bus/CommandHandlerContainer.php @@ -26,18 +26,12 @@ final class CommandHandlerContainer implements ICommandHandlerContainer /** * Bind a command handler into the container. * - * @param string $commandClass - * @param Closure $binding - * @return void */ public function bind(string $commandClass, Closure $binding): void { $this->bindings[$commandClass] = $binding; } - /** - * @inheritDoc - */ public function get(string $commandClass): CommandHandler { $factory = $this->bindings[$commandClass] ?? null; diff --git a/src/Application/Bus/CommandQueuer.php b/src/Application/Bus/CommandQueuer.php index c480ebbc..c036e125 100644 --- a/src/Application/Bus/CommandQueuer.php +++ b/src/Application/Bus/CommandQueuer.php @@ -21,15 +21,11 @@ class CommandQueuer implements ICommandQueuer /** * CommandQueuer constructor. * - * @param Queue $queue */ public function __construct(private readonly Queue $queue) { } - /** - * @inheritDoc - */ public function queue(Command $command): void { $this->queue->push($command); diff --git a/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php b/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php index e01c5233..f8630976 100644 --- a/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php +++ b/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php @@ -24,8 +24,6 @@ /** * ExecuteInUnitOfWork constructor. * - * @param UnitOfWorkManager $unitOfWorkManager - * @param int $attempts */ public function __construct( private UnitOfWorkManager $unitOfWorkManager, @@ -33,9 +31,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(Command $command, Closure $next): Result { try { diff --git a/src/Application/Bus/Middleware/FlushDeferredEvents.php b/src/Application/Bus/Middleware/FlushDeferredEvents.php index b952d7ea..50fd6759 100644 --- a/src/Application/Bus/Middleware/FlushDeferredEvents.php +++ b/src/Application/Bus/Middleware/FlushDeferredEvents.php @@ -24,15 +24,11 @@ /** * FlushDeferredEvents constructor. * - * @param DeferredDispatcher $dispatcher */ public function __construct(private DeferredDispatcher $dispatcher) { } - /** - * @inheritDoc - */ public function __invoke(Command $command, Closure $next): Result { try { diff --git a/src/Application/Bus/Middleware/LogMessageDispatch.php b/src/Application/Bus/Middleware/LogMessageDispatch.php index 6e18d59a..7c38f20e 100644 --- a/src/Application/Bus/Middleware/LogMessageDispatch.php +++ b/src/Application/Bus/Middleware/LogMessageDispatch.php @@ -28,10 +28,6 @@ /** * LogMessageDispatch constructor. * - * @param LoggerInterface $logger - * @param string $dispatchLevel - * @param string $dispatchedLevel - * @param ContextFactory $context */ public function __construct( private LoggerInterface $logger, @@ -41,9 +37,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(Command|Query $message, Closure $next): Result { $name = ModuleBasename::tryFrom($message)?->toString() ?? $message::class; diff --git a/src/Application/Bus/Middleware/SetupBeforeDispatch.php b/src/Application/Bus/Middleware/SetupBeforeDispatch.php index 41ecd6ce..4c059568 100644 --- a/src/Application/Bus/Middleware/SetupBeforeDispatch.php +++ b/src/Application/Bus/Middleware/SetupBeforeDispatch.php @@ -29,9 +29,6 @@ public function __construct(private Closure $callback) { } - /** - * @inheritDoc - */ public function __invoke(Command|Query $message, Closure $next): Result { $tearDown = ($this->callback)(); diff --git a/src/Application/Bus/Middleware/TearDownAfterDispatch.php b/src/Application/Bus/Middleware/TearDownAfterDispatch.php index 5f6f6fc7..b860c68e 100644 --- a/src/Application/Bus/Middleware/TearDownAfterDispatch.php +++ b/src/Application/Bus/Middleware/TearDownAfterDispatch.php @@ -29,9 +29,6 @@ public function __construct(private Closure $callback) { } - /** - * @inheritDoc - */ public function __invoke(Command|Query $message, Closure $next): Result { try { diff --git a/src/Application/Bus/Middleware/ValidateCommand.php b/src/Application/Bus/Middleware/ValidateCommand.php index 5b4ac79c..fe96c7b0 100644 --- a/src/Application/Bus/Middleware/ValidateCommand.php +++ b/src/Application/Bus/Middleware/ValidateCommand.php @@ -24,22 +24,18 @@ abstract class ValidateCommand implements CommandMiddleware /** * Get the rules for the validation. * - * @return iterable + * @return iterable */ abstract protected function rules(): iterable; /** * ValidateCommand constructor. * - * @param Validator $validator */ public function __construct(private readonly Validator $validator) { } - /** - * @inheritDoc - */ public function __invoke(Command $command, Closure $next): IResult { $errors = $this->validator diff --git a/src/Application/Bus/Middleware/ValidateQuery.php b/src/Application/Bus/Middleware/ValidateQuery.php index 05cf023d..78f8185f 100644 --- a/src/Application/Bus/Middleware/ValidateQuery.php +++ b/src/Application/Bus/Middleware/ValidateQuery.php @@ -24,22 +24,18 @@ abstract class ValidateQuery implements QueryMiddleware /** * Get the rules for the validation. * - * @return iterable + * @return iterable */ abstract protected function rules(): iterable; /** * ValidateQuery constructor. * - * @param Validator $validator */ public function __construct(private readonly Validator $validator) { } - /** - * @inheritDoc - */ public function __invoke(Query $query, Closure $next): IResult { $errors = $this->validator diff --git a/src/Application/Bus/QueryDispatcher.php b/src/Application/Bus/QueryDispatcher.php index b1db3839..862b0912 100644 --- a/src/Application/Bus/QueryDispatcher.php +++ b/src/Application/Bus/QueryDispatcher.php @@ -23,15 +23,13 @@ class QueryDispatcher implements IQueryDispatcher { /** - * @var array + * @var array */ private array $pipes = []; /** * QueryDispatcher constructor. * - * @param QueryHandlerContainer $handlers - * @param PipeContainer|null $middleware */ public function __construct( private readonly QueryHandlerContainer $handlers, @@ -42,8 +40,7 @@ public function __construct( /** * Dispatch messages through the provided pipes. * - * @param array $pipes - * @return void + * @param array $pipes */ public function through(array $pipes): void { @@ -52,9 +49,6 @@ public function through(array $pipes): void $this->pipes = $pipes; } - /** - * @inheritDoc - */ public function dispatch(Query $query): Result { $pipeline = PipelineBuilder::make($this->middleware) @@ -71,7 +65,6 @@ public function dispatch(Query $query): Result } /** - * @param Query $query * @return Result */ private function execute(Query $query): Result diff --git a/src/Application/Bus/QueryHandler.php b/src/Application/Bus/QueryHandler.php index cad62502..748a3841 100644 --- a/src/Application/Bus/QueryHandler.php +++ b/src/Application/Bus/QueryHandler.php @@ -22,15 +22,11 @@ /** * QueryHandler constructor. * - * @param object $handler */ public function __construct(private object $handler) { } - /** - * @inheritDoc - */ public function __invoke(Query $query): Result { assert(method_exists($this->handler, 'execute'), sprintf( @@ -46,9 +42,6 @@ public function __invoke(Query $query): Result return $result; } - /** - * @inheritDoc - */ public function middleware(): array { if ($this->handler instanceof DispatchThroughMiddleware) { diff --git a/src/Application/Bus/QueryHandlerContainer.php b/src/Application/Bus/QueryHandlerContainer.php index fdcadfde..aae2a347 100644 --- a/src/Application/Bus/QueryHandlerContainer.php +++ b/src/Application/Bus/QueryHandlerContainer.php @@ -26,18 +26,12 @@ final class QueryHandlerContainer implements IQueryHandlerContainer /** * Bind a query handler into the container. * - * @param string $queryClass - * @param Closure $binding - * @return void */ public function bind(string $queryClass, Closure $binding): void { $this->bindings[$queryClass] = $binding; } - /** - * @inheritDoc - */ public function get(string $queryClass): QueryHandler { $factory = $this->bindings[$queryClass] ?? null; diff --git a/src/Application/Bus/Validator.php b/src/Application/Bus/Validator.php index c2975d8f..b37b2f47 100644 --- a/src/Application/Bus/Validator.php +++ b/src/Application/Bus/Validator.php @@ -25,21 +25,20 @@ final class Validator implements IValidator { /** - * @var iterable + * @var iterable */ private iterable $using = []; /** * AbstractValidator constructor * - * @param PipeContainer|null $rules */ public function __construct(private readonly ?PipeContainer $rules = null) { } /** - * @param iterable $rules + * @param iterable $rules * @return $this */ public function using(iterable $rules): static @@ -49,9 +48,6 @@ public function using(iterable $rules): static return $this; } - /** - * @inheritDoc - */ public function validate(Command|Query $message): IListOfErrors { $errors = $this @@ -63,9 +59,6 @@ public function validate(Command|Query $message): IListOfErrors return $errors; } - /** - * @return Pipeline - */ private function getPipeline(): Pipeline { return PipelineBuilder::make($this->rules) @@ -73,9 +66,6 @@ private function getPipeline(): Pipeline ->build($this->processor()); } - /** - * @return AccumulationProcessor - */ private function processor(): AccumulationProcessor { return new AccumulationProcessor( diff --git a/src/Application/DomainEventDispatching/DeferredDispatcher.php b/src/Application/DomainEventDispatching/DeferredDispatcher.php index adfd450c..21466ea3 100644 --- a/src/Application/DomainEventDispatching/DeferredDispatcher.php +++ b/src/Application/DomainEventDispatching/DeferredDispatcher.php @@ -23,9 +23,6 @@ class DeferredDispatcher extends Dispatcher implements IDeferredDispatcher */ private array $deferred = []; - /** - * @inheritDoc - */ public function dispatch(DomainEvent $event): void { if ($event instanceof OccursImmediately) { @@ -36,9 +33,6 @@ public function dispatch(DomainEvent $event): void $this->deferred[] = $event; } - /** - * @inheritDoc - */ public function flush(): void { try { @@ -50,9 +44,6 @@ public function flush(): void } } - /** - * @inheritDoc - */ public function forget(): void { $this->deferred = []; diff --git a/src/Application/DomainEventDispatching/Dispatcher.php b/src/Application/DomainEventDispatching/Dispatcher.php index 35ef620f..86a6c367 100644 --- a/src/Application/DomainEventDispatching/Dispatcher.php +++ b/src/Application/DomainEventDispatching/Dispatcher.php @@ -25,20 +25,18 @@ class Dispatcher implements DomainEventDispatcher { /** - * @var array> + * @var array> */ private array $bindings = []; /** - * @var array + * @var array */ private array $pipes = []; /** * Dispatcher constructor. * - * @param IListenerContainer $listeners - * @param PipeContainer|null $middleware */ public function __construct( private readonly IListenerContainer $listeners = new ListenerContainer(), @@ -49,8 +47,7 @@ public function __construct( /** * Dispatch events through the provided pipes. * - * @param array $pipes - * @return void + * @param array $pipes */ public function through(array $pipes): void { @@ -60,11 +57,9 @@ public function through(array $pipes): void } /** - * @param string $event - * @param string|Closure|list $listener - * @return void + * @param Closure|list|string $listener */ - public function listen(string $event, string|Closure|array $listener): void + public function listen(string $event, array|Closure|string $listener): void { $bindings = $this->bindings[$event] ?? []; @@ -80,9 +75,6 @@ public function listen(string $event, string|Closure|array $listener): void $this->bindings[$event] = $bindings; } - /** - * @inheritDoc - */ public function dispatch(DomainEvent $event): void { $this->dispatchNow($event); @@ -91,8 +83,6 @@ public function dispatch(DomainEvent $event): void /** * Dispatch the events immediately. * - * @param DomainEvent $event - * @return void */ protected function dispatchNow(DomainEvent $event): void { @@ -103,9 +93,6 @@ protected function dispatchNow(DomainEvent $event): void $pipeline->process($event); } - /** - * @return Closure - */ private function dispatcher(): Closure { return function (DomainEvent $event): DomainEvent { @@ -119,7 +106,6 @@ private function dispatcher(): Closure /** * Get a cursor to iterate through all listeners for the event. * - * @param string $eventName * @return Generator */ protected function cursor(string $eventName): Generator @@ -138,9 +124,6 @@ protected function cursor(string $eventName): Generator /** * Execute the listener. * - * @param DomainEvent $event - * @param EventHandler $listener - * @return void */ protected function execute(DomainEvent $event, EventHandler $listener): void { @@ -150,8 +133,6 @@ protected function execute(DomainEvent $event, EventHandler $listener): void /** * Is the provided listener valid to attach to an event? * - * @param mixed $listener - * @return bool */ private function canAttach(mixed $listener): bool { diff --git a/src/Application/DomainEventDispatching/EventHandler.php b/src/Application/DomainEventDispatching/EventHandler.php index 39703d21..1786af88 100644 --- a/src/Application/DomainEventDispatching/EventHandler.php +++ b/src/Application/DomainEventDispatching/EventHandler.php @@ -22,7 +22,6 @@ /** * EventHandler constructor. * - * @param object $listener */ public function __construct(private object $listener) { @@ -38,7 +37,6 @@ public function __construct(private object $listener) /** * Should the handler be executed before the transaction is committed? * - * @return bool */ public function beforeCommit(): bool { @@ -48,7 +46,6 @@ public function beforeCommit(): bool /** * Should the handler be executed after the transaction is committed? * - * @return bool */ public function afterCommit(): bool { @@ -58,8 +55,6 @@ public function afterCommit(): bool /** * Execute the listener. * - * @param DomainEvent $event - * @return void */ public function __invoke(DomainEvent $event): void { diff --git a/src/Application/DomainEventDispatching/ListenerContainer.php b/src/Application/DomainEventDispatching/ListenerContainer.php index 45ce1eb1..88ed7f24 100644 --- a/src/Application/DomainEventDispatching/ListenerContainer.php +++ b/src/Application/DomainEventDispatching/ListenerContainer.php @@ -26,18 +26,12 @@ final class ListenerContainer implements IListenerContainer /** * Bind a listener factory into the container. * - * @param string $listenerName - * @param Closure $binding - * @return void */ public function bind(string $listenerName, Closure $binding): void { $this->bindings[$listenerName] = $binding; } - /** - * @inheritDoc - */ public function get(string $listenerName): object { $factory = $this->bindings[$listenerName] ?? null; diff --git a/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php b/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php index 443176e6..224fe693 100644 --- a/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php +++ b/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php @@ -24,9 +24,6 @@ /** * LogDomainEventDispatch constructor * - * @param LoggerInterface $logger - * @param string $dispatchLevel - * @param string $dispatchedLevel */ public function __construct( private LoggerInterface $logger, @@ -35,9 +32,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(DomainEvent $event, Closure $next): void { $name = ModuleBasename::tryFrom($event)?->toString() ?? $event::class; diff --git a/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php b/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php index e89d19ac..219d3f03 100644 --- a/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php +++ b/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php @@ -23,9 +23,6 @@ class UnitOfWorkAwareDispatcher extends Dispatcher /** * UnitOfWorkAwareDispatcher constructor. * - * @param UnitOfWorkManager $unitOfWorkManager - * @param IListenerContainer $listeners - * @param PipeContainer|null $middleware */ public function __construct( private readonly UnitOfWorkManager $unitOfWorkManager, @@ -35,9 +32,6 @@ public function __construct( parent::__construct($listeners, $middleware); } - /** - * @inheritDoc - */ public function dispatch(DomainEvent $event): void { if ($event instanceof OccursImmediately) { @@ -53,9 +47,6 @@ public function dispatch(DomainEvent $event): void /** * Execute the listener or queue it in the unit of work manager. * - * @param DomainEvent $event - * @param EventHandler $listener - * @return void */ protected function execute(DomainEvent $event, EventHandler $listener): void { diff --git a/src/Application/InboundEventBus/EventHandler.php b/src/Application/InboundEventBus/EventHandler.php index f7156718..97acb543 100644 --- a/src/Application/InboundEventBus/EventHandler.php +++ b/src/Application/InboundEventBus/EventHandler.php @@ -21,15 +21,11 @@ /** * EventHandler constructor. * - * @param object $handler */ public function __construct(private object $handler) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event): void { assert(method_exists($this->handler, 'handle'), sprintf( @@ -41,9 +37,6 @@ public function __invoke(IntegrationEvent $event): void $this->handler->handle($event); } - /** - * @inheritDoc - */ public function middleware(): array { if ($this->handler instanceof DispatchThroughMiddleware) { diff --git a/src/Application/InboundEventBus/EventHandlerContainer.php b/src/Application/InboundEventBus/EventHandlerContainer.php index cba60787..6308a8a7 100644 --- a/src/Application/InboundEventBus/EventHandlerContainer.php +++ b/src/Application/InboundEventBus/EventHandlerContainer.php @@ -38,16 +38,12 @@ public function __construct(private readonly ?Closure $default = null) * * @param class-string $eventName * @param Closure(): object $binding - * @return void */ public function bind(string $eventName, Closure $binding): void { $this->bindings[$eventName] = $binding; } - /** - * @inheritDoc - */ public function get(string $eventName): EventHandler { $factory = $this->bindings[$eventName] ?? $this->default; diff --git a/src/Application/InboundEventBus/InboundEventDispatcher.php b/src/Application/InboundEventBus/InboundEventDispatcher.php index 30a9caca..63301277 100644 --- a/src/Application/InboundEventBus/InboundEventDispatcher.php +++ b/src/Application/InboundEventBus/InboundEventDispatcher.php @@ -22,15 +22,13 @@ class InboundEventDispatcher implements IInboundEventDispatcher { /** - * @var array + * @var array */ private array $pipes = []; /** * EventDispatcher constructor. * - * @param EventHandlerContainer $handlers - * @param PipeContainer|null $middleware */ public function __construct( private readonly EventHandlerContainer $handlers, @@ -41,8 +39,7 @@ public function __construct( /** * Dispatch events through the provided pipes. * - * @param list $pipes - * @return void + * @param list $pipes */ public function through(array $pipes): void { @@ -51,9 +48,6 @@ public function through(array $pipes): void $this->pipes = $pipes; } - /** - * @inheritDoc - */ public function dispatch(IntegrationEvent $event): void { $pipeline = PipelineBuilder::make($this->middleware) @@ -65,10 +59,6 @@ public function dispatch(IntegrationEvent $event): void $pipeline->process($event); } - /** - * @param IntegrationEvent $event - * @return void - */ private function execute(IntegrationEvent $event): void { $handler = $this->handlers->get($event::class); diff --git a/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php b/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php index 847765c5..8f260ad8 100644 --- a/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php +++ b/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php @@ -23,15 +23,11 @@ /** * FlushDeferredEvents constructor. * - * @param DeferredDispatcher $dispatcher */ public function __construct(private DeferredDispatcher $dispatcher) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event, Closure $next): void { try { diff --git a/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php b/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php index ef16e242..5ecd6c63 100644 --- a/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php +++ b/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php @@ -22,8 +22,6 @@ /** * HandleInUnitOfWork constructor. * - * @param UnitOfWorkManager $unitOfWorkManager - * @param int $attempts */ public function __construct( private UnitOfWorkManager $unitOfWorkManager, @@ -31,9 +29,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event, Closure $next): void { $this->unitOfWorkManager->execute( diff --git a/src/Application/InboundEventBus/Middleware/LogInboundEvent.php b/src/Application/InboundEventBus/Middleware/LogInboundEvent.php index 5535220b..eb54e848 100644 --- a/src/Application/InboundEventBus/Middleware/LogInboundEvent.php +++ b/src/Application/InboundEventBus/Middleware/LogInboundEvent.php @@ -26,10 +26,6 @@ /** * LogInboundEvent constructor. * - * @param LoggerInterface $log - * @param string $publishLevel - * @param string $publishedLevel - * @param ContextFactory $context */ public function __construct( private LoggerInterface $log, @@ -39,9 +35,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event, Closure $next): void { $name = ModuleBasename::tryFrom($event)?->toString() ?? $event::class; diff --git a/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php b/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php index d04efc44..c45f8e93 100644 --- a/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php +++ b/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php @@ -27,9 +27,6 @@ public function __construct(private Closure $callback) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event, Closure $next): void { $tearDown = ($this->callback)(); diff --git a/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php b/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php index 45e0bbbb..b14e2875 100644 --- a/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php +++ b/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php @@ -27,9 +27,6 @@ public function __construct(private Closure $callback) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event, Closure $next): void { try { diff --git a/src/Application/InboundEventBus/SwallowInboundEvent.php b/src/Application/InboundEventBus/SwallowInboundEvent.php index da8073a5..5b441b90 100644 --- a/src/Application/InboundEventBus/SwallowInboundEvent.php +++ b/src/Application/InboundEventBus/SwallowInboundEvent.php @@ -22,8 +22,6 @@ /** * SwallowInboundEvent constructor. * - * @param ?LoggerInterface $logger - * @param string $level */ public function __construct( private ?LoggerInterface $logger = null, @@ -34,8 +32,6 @@ public function __construct( /** * Handle the event. * - * @param IntegrationEvent $event - * @return void */ public function handle(IntegrationEvent $event): void { diff --git a/src/Application/UnitOfWork/UnitOfWorkManager.php b/src/Application/UnitOfWork/UnitOfWorkManager.php index 5ce6b712..80e40e54 100644 --- a/src/Application/UnitOfWork/UnitOfWorkManager.php +++ b/src/Application/UnitOfWork/UnitOfWorkManager.php @@ -31,21 +31,13 @@ final class UnitOfWorkManager implements IUnitOfWorkManager */ private array $afterCommit = []; - /** - * @var bool - */ private bool $active = false; - /** - * @var bool - */ private bool $committed = false; /** * UnitOfWorkManager constructor. * - * @param UnitOfWork $unitOfWork - * @param ExceptionReporter|null $reporter */ public function __construct( private readonly UnitOfWork $unitOfWork, @@ -53,9 +45,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function execute(Closure $callback, int $attempts = 1): mixed { if ($this->active) { @@ -71,11 +60,6 @@ public function execute(Closure $callback, int $attempts = 1): mixed return $this->retry($callback, $attempts); } - /** - * @param Closure $callback - * @param int $attempts - * @return mixed - */ private function retry(Closure $callback, int $attempts): mixed { try { @@ -92,10 +76,6 @@ private function retry(Closure $callback, int $attempts): mixed return $this->retry($callback, $attempts - 1); } - /** - * @param Closure $callback - * @return mixed - */ private function transaction(Closure $callback): mixed { try { @@ -116,9 +96,6 @@ private function transaction(Closure $callback): mixed } } - /** - * @inheritDoc - */ public function beforeCommit(callable $callback): void { if ($this->active && !$this->committed) { @@ -135,9 +112,6 @@ public function beforeCommit(callable $callback): void throw new RuntimeException('Cannot queue a before commit callback when not executing a unit of work.'); } - /** - * @inheritDoc - */ public function afterCommit(callable $callback): void { if ($this->active) { @@ -148,9 +122,6 @@ public function afterCommit(callable $callback): void throw new RuntimeException('Cannot queue an after commit callback when not executing a unit of work.'); } - /** - * @return void - */ private function executeBeforeCommit(): void { while ($callback = array_shift($this->beforeCommit)) { @@ -158,9 +129,6 @@ private function executeBeforeCommit(): void } } - /** - * @return void - */ private function executeAfterCommit(): void { while ($callback = array_shift($this->afterCommit)) { diff --git a/src/Contracts/Application/Bus/BusMiddleware.php b/src/Contracts/Application/Bus/BusMiddleware.php index 188e3e6b..a7850721 100644 --- a/src/Contracts/Application/Bus/BusMiddleware.php +++ b/src/Contracts/Application/Bus/BusMiddleware.php @@ -22,7 +22,6 @@ interface BusMiddleware /** * Handle the command or query. * - * @param Command|Query $message * @param Closure(Command|Query): Result $next * @return Result */ diff --git a/src/Contracts/Application/Bus/CommandHandler.php b/src/Contracts/Application/Bus/CommandHandler.php index cb646fbb..2034fe1f 100644 --- a/src/Contracts/Application/Bus/CommandHandler.php +++ b/src/Contracts/Application/Bus/CommandHandler.php @@ -21,7 +21,6 @@ interface CommandHandler extends DispatchThroughMiddleware /** * Execute the command. * - * @param Command $command * @return Result */ public function __invoke(Command $command): Result; diff --git a/src/Contracts/Application/Bus/CommandHandlerContainer.php b/src/Contracts/Application/Bus/CommandHandlerContainer.php index 7cfff627..910a1c57 100644 --- a/src/Contracts/Application/Bus/CommandHandlerContainer.php +++ b/src/Contracts/Application/Bus/CommandHandlerContainer.php @@ -17,8 +17,6 @@ interface CommandHandlerContainer /** * Get a command handler for the provided command name. * - * @param string $commandClass - * @return CommandHandler */ public function get(string $commandClass): CommandHandler; } diff --git a/src/Contracts/Application/Bus/CommandMiddleware.php b/src/Contracts/Application/Bus/CommandMiddleware.php index 5ea588be..8e2badb8 100644 --- a/src/Contracts/Application/Bus/CommandMiddleware.php +++ b/src/Contracts/Application/Bus/CommandMiddleware.php @@ -21,7 +21,6 @@ interface CommandMiddleware /** * Handle the command. * - * @param Command $command * @param Closure(Command): Result $next * @return Result */ diff --git a/src/Contracts/Application/Bus/QueryHandler.php b/src/Contracts/Application/Bus/QueryHandler.php index 4e813ed8..477de710 100644 --- a/src/Contracts/Application/Bus/QueryHandler.php +++ b/src/Contracts/Application/Bus/QueryHandler.php @@ -21,7 +21,6 @@ interface QueryHandler extends DispatchThroughMiddleware /** * Execute the query. * - * @param Query $query * @return Result */ public function __invoke(Query $query): Result; diff --git a/src/Contracts/Application/Bus/QueryHandlerContainer.php b/src/Contracts/Application/Bus/QueryHandlerContainer.php index 86635be8..b0f9371f 100644 --- a/src/Contracts/Application/Bus/QueryHandlerContainer.php +++ b/src/Contracts/Application/Bus/QueryHandlerContainer.php @@ -17,8 +17,6 @@ interface QueryHandlerContainer /** * Get a query handler for the provided query name. * - * @param string $queryClass - * @return QueryHandler */ public function get(string $queryClass): QueryHandler; } diff --git a/src/Contracts/Application/Bus/QueryMiddleware.php b/src/Contracts/Application/Bus/QueryMiddleware.php index 8c372976..06976bf6 100644 --- a/src/Contracts/Application/Bus/QueryMiddleware.php +++ b/src/Contracts/Application/Bus/QueryMiddleware.php @@ -21,7 +21,6 @@ interface QueryMiddleware /** * Handle the query. * - * @param Query $query * @param Closure(Query): Result $next * @return Result */ diff --git a/src/Contracts/Application/Bus/Validator.php b/src/Contracts/Application/Bus/Validator.php index e3d189f6..cb031bf1 100644 --- a/src/Contracts/Application/Bus/Validator.php +++ b/src/Contracts/Application/Bus/Validator.php @@ -21,7 +21,7 @@ interface Validator /** * Set the rules for the validation. * - * @param iterable $rules + * @param iterable $rules * @return $this */ public function using(iterable $rules): static; @@ -29,8 +29,6 @@ public function using(iterable $rules): static; /** * Validate the provided message. * - * @param Command|Query $message - * @return ListOfErrors */ public function validate(Command|Query $message): ListOfErrors; } diff --git a/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php b/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php index 96a7cb56..b6f34329 100644 --- a/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php +++ b/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php @@ -19,14 +19,12 @@ interface DeferredDispatcher extends DomainEventDispatcher /** * Dispatch any deferred events. * - * @return void */ public function flush(): void; /** * Clear deferred events without dispatching them. * - * @return void */ public function forget(): void; } diff --git a/src/Contracts/Application/DomainEventDispatching/DomainEventMiddleware.php b/src/Contracts/Application/DomainEventDispatching/DomainEventMiddleware.php index aa232406..7f19c63d 100644 --- a/src/Contracts/Application/DomainEventDispatching/DomainEventMiddleware.php +++ b/src/Contracts/Application/DomainEventDispatching/DomainEventMiddleware.php @@ -20,9 +20,7 @@ interface DomainEventMiddleware /** * Handle the domain event. * - * @param DomainEvent $event * @param Closure(DomainEvent): void $next - * @return void */ public function __invoke(DomainEvent $event, Closure $next): void; } diff --git a/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php b/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php index 874bca5b..0cc422b7 100644 --- a/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php +++ b/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php @@ -17,8 +17,6 @@ interface ListenerContainer /** * Get a listener by its name. * - * @param string $listenerName - * @return object */ public function get(string $listenerName): object; } diff --git a/src/Contracts/Application/InboundEventBus/EventHandler.php b/src/Contracts/Application/InboundEventBus/EventHandler.php index 5ddbdcd1..92660c2f 100644 --- a/src/Contracts/Application/InboundEventBus/EventHandler.php +++ b/src/Contracts/Application/InboundEventBus/EventHandler.php @@ -20,8 +20,6 @@ interface EventHandler extends DispatchThroughMiddleware /** * Handle the integration event. * - * @param IntegrationEvent $event - * @return void */ public function __invoke(IntegrationEvent $event): void; } diff --git a/src/Contracts/Application/InboundEventBus/EventHandlerContainer.php b/src/Contracts/Application/InboundEventBus/EventHandlerContainer.php index 97c2e0d2..21b2dbcf 100644 --- a/src/Contracts/Application/InboundEventBus/EventHandlerContainer.php +++ b/src/Contracts/Application/InboundEventBus/EventHandlerContainer.php @@ -20,7 +20,6 @@ interface EventHandlerContainer * Get a handler for the specified integration event. * * @param class-string $eventName - * @return EventHandler */ public function get(string $eventName): EventHandler; } diff --git a/src/Contracts/Application/InboundEventBus/InboundEventMiddleware.php b/src/Contracts/Application/InboundEventBus/InboundEventMiddleware.php index daf50062..2fa21de6 100644 --- a/src/Contracts/Application/InboundEventBus/InboundEventMiddleware.php +++ b/src/Contracts/Application/InboundEventBus/InboundEventMiddleware.php @@ -20,9 +20,7 @@ interface InboundEventMiddleware /** * Handle the inbound event. * - * @param IntegrationEvent $event * @param Closure(IntegrationEvent): void $next - * @return void */ public function __invoke(IntegrationEvent $event, Closure $next): void; } diff --git a/src/Contracts/Application/Ports/Driven/ExceptionReporter.php b/src/Contracts/Application/Ports/Driven/ExceptionReporter.php index 3b19fb73..58180ecf 100644 --- a/src/Contracts/Application/Ports/Driven/ExceptionReporter.php +++ b/src/Contracts/Application/Ports/Driven/ExceptionReporter.php @@ -19,8 +19,6 @@ interface ExceptionReporter /** * Report the exception. * - * @param Throwable $ex - * @return void */ public function report(Throwable $ex): void; } diff --git a/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php b/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php index 69ee3264..f21cd290 100644 --- a/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php +++ b/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php @@ -19,8 +19,6 @@ interface OutboundEventPublisher /** * Publish an outbound integration event. * - * @param IntegrationEvent $event - * @return void */ public function publish(IntegrationEvent $event): void; } diff --git a/src/Contracts/Application/Ports/Driven/Queue.php b/src/Contracts/Application/Ports/Driven/Queue.php index d6b47546..31e427e1 100644 --- a/src/Contracts/Application/Ports/Driven/Queue.php +++ b/src/Contracts/Application/Ports/Driven/Queue.php @@ -19,8 +19,6 @@ interface Queue /** * Push a command on to the queue. * - * @param Command $command - * @return void */ public function push(Command $command): void; } diff --git a/src/Contracts/Application/Ports/Driven/UnitOfWork.php b/src/Contracts/Application/Ports/Driven/UnitOfWork.php index cb459a02..1ee6c388 100644 --- a/src/Contracts/Application/Ports/Driven/UnitOfWork.php +++ b/src/Contracts/Application/Ports/Driven/UnitOfWork.php @@ -21,7 +21,6 @@ interface UnitOfWork * * @template TReturn * @param Closure(): TReturn $callback - * @param int $attempts * @return TReturn */ public function execute(Closure $callback, int $attempts = 1): mixed; diff --git a/src/Contracts/Application/Ports/Driving/CommandDispatcher.php b/src/Contracts/Application/Ports/Driving/CommandDispatcher.php index 71a4e069..f19efc4b 100644 --- a/src/Contracts/Application/Ports/Driving/CommandDispatcher.php +++ b/src/Contracts/Application/Ports/Driving/CommandDispatcher.php @@ -20,7 +20,6 @@ interface CommandDispatcher /** * Dispatch the given command. * - * @param Command $command * @return Result */ public function dispatch(Command $command): Result; diff --git a/src/Contracts/Application/Ports/Driving/CommandQueuer.php b/src/Contracts/Application/Ports/Driving/CommandQueuer.php index db7dbd28..e77b65f6 100644 --- a/src/Contracts/Application/Ports/Driving/CommandQueuer.php +++ b/src/Contracts/Application/Ports/Driving/CommandQueuer.php @@ -19,8 +19,6 @@ interface CommandQueuer /** * Queue a command for asynchronous dispatching. * - * @param Command $command - * @return void */ public function queue(Command $command): void; } diff --git a/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php b/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php index 0855bd7c..75a5900f 100644 --- a/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php +++ b/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php @@ -19,8 +19,6 @@ interface InboundEventDispatcher /** * Dispatch an inbound integration event. * - * @param IntegrationEvent $event - * @return void */ public function dispatch(IntegrationEvent $event): void; } diff --git a/src/Contracts/Application/Ports/Driving/QueryDispatcher.php b/src/Contracts/Application/Ports/Driving/QueryDispatcher.php index 81235755..a429f1e8 100644 --- a/src/Contracts/Application/Ports/Driving/QueryDispatcher.php +++ b/src/Contracts/Application/Ports/Driving/QueryDispatcher.php @@ -20,7 +20,6 @@ interface QueryDispatcher /** * Dispatch the given query. * - * @param Query $query * @return Result */ public function dispatch(Query $query): Result; diff --git a/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php b/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php index 7e6c679e..bda8a5b3 100644 --- a/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php +++ b/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php @@ -21,7 +21,6 @@ interface UnitOfWorkManager * * @template TReturn * @param Closure(): TReturn $callback - * @param int $attempts * @return TReturn */ public function execute(Closure $callback, int $attempts = 1): mixed; @@ -30,7 +29,6 @@ public function execute(Closure $callback, int $attempts = 1): mixed; * Register a callback to be executed before the unit of work is committed. * * @param callable(): void $callback - * @return void */ public function beforeCommit(callable $callback): void; @@ -38,7 +36,6 @@ public function beforeCommit(callable $callback): void; * Register a callback to be executed after the unit of work is committed. * * @param callable(): void $callback - * @return void */ public function afterCommit(callable $callback): void; } diff --git a/src/Contracts/Domain/Entity.php b/src/Contracts/Domain/Entity.php index a490bf8b..c8c1e644 100644 --- a/src/Contracts/Domain/Entity.php +++ b/src/Contracts/Domain/Entity.php @@ -19,30 +19,24 @@ interface Entity /** * Get the entity's identifier. * - * @return Identifier|null */ public function getId(): ?Identifier; /** * Get the entity's identifier, or fail if one is not set. * - * @return Identifier */ public function getIdOrFail(): Identifier; /** * Is this entity the same as the provided entity? * - * @param Entity|null $other - * @return bool */ public function is(?Entity $other): bool; /** * Is this entity not the same as the provided entity? * - * @param Entity|null $other - * @return bool */ public function isNot(?Entity $other): bool; } diff --git a/src/Contracts/Domain/Events/DomainEvent.php b/src/Contracts/Domain/Events/DomainEvent.php index 368cfbda..19b28576 100644 --- a/src/Contracts/Domain/Events/DomainEvent.php +++ b/src/Contracts/Domain/Events/DomainEvent.php @@ -19,7 +19,6 @@ interface DomainEvent /** * The date/time the event occurred. * - * @return DateTimeImmutable */ public function getOccurredAt(): DateTimeImmutable; } diff --git a/src/Contracts/Domain/Events/DomainEventDispatcher.php b/src/Contracts/Domain/Events/DomainEventDispatcher.php index cf7826a5..91b4baeb 100644 --- a/src/Contracts/Domain/Events/DomainEventDispatcher.php +++ b/src/Contracts/Domain/Events/DomainEventDispatcher.php @@ -17,8 +17,6 @@ interface DomainEventDispatcher /** * Dispatch a domain event. * - * @param DomainEvent $event - * @return void */ public function dispatch(DomainEvent $event): void; } diff --git a/src/Contracts/Infrastructure/OutboundEventBus/OutboundEventMiddleware.php b/src/Contracts/Infrastructure/OutboundEventBus/OutboundEventMiddleware.php index d2c33345..add8286e 100644 --- a/src/Contracts/Infrastructure/OutboundEventBus/OutboundEventMiddleware.php +++ b/src/Contracts/Infrastructure/OutboundEventBus/OutboundEventMiddleware.php @@ -20,9 +20,7 @@ interface OutboundEventMiddleware /** * Handle the outbound integration event. * - * @param IntegrationEvent $event * @param Closure(IntegrationEvent): void $next - * @return void */ public function __invoke(IntegrationEvent $event, Closure $next): void; } diff --git a/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php b/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php index 97c9e0b6..d31a4e85 100644 --- a/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php +++ b/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php @@ -19,8 +19,6 @@ interface PublisherHandler /** * Handle the integration event. * - * @param IntegrationEvent $event - * @return void */ public function __invoke(IntegrationEvent $event): void; } diff --git a/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php b/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php index 072a68a1..68f7360f 100644 --- a/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php +++ b/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php @@ -20,7 +20,6 @@ interface PublisherHandlerContainer * Get a handler for the specified integration event. * * @param class-string $eventName - * @return PublisherHandler */ public function get(string $eventName): PublisherHandler; } diff --git a/src/Contracts/Infrastructure/Queue/Enqueuer.php b/src/Contracts/Infrastructure/Queue/Enqueuer.php index 0c59ac4a..d8a7e4d3 100644 --- a/src/Contracts/Infrastructure/Queue/Enqueuer.php +++ b/src/Contracts/Infrastructure/Queue/Enqueuer.php @@ -19,8 +19,6 @@ interface Enqueuer /** * Put the command on the queue. * - * @param Command $command - * @return void */ public function __invoke(Command $command): void; } diff --git a/src/Contracts/Infrastructure/Queue/EnqueuerContainer.php b/src/Contracts/Infrastructure/Queue/EnqueuerContainer.php index fa483dbb..6562fb7e 100644 --- a/src/Contracts/Infrastructure/Queue/EnqueuerContainer.php +++ b/src/Contracts/Infrastructure/Queue/EnqueuerContainer.php @@ -20,7 +20,6 @@ interface EnqueuerContainer * Get an enqueuer for the provided command. * * @param class-string $command - * @return Enqueuer */ public function get(string $command): Enqueuer; } diff --git a/src/Contracts/Infrastructure/Queue/QueueMiddleware.php b/src/Contracts/Infrastructure/Queue/QueueMiddleware.php index 8294722c..ffee96ae 100644 --- a/src/Contracts/Infrastructure/Queue/QueueMiddleware.php +++ b/src/Contracts/Infrastructure/Queue/QueueMiddleware.php @@ -20,9 +20,7 @@ interface QueueMiddleware /** * Handle the command being queued. * - * @param Command $command * @param Closure(Command): void $next - * @return void */ public function __invoke(Command $command, Closure $next): void; } diff --git a/src/Contracts/Toolkit/Identifiers/Identifier.php b/src/Contracts/Toolkit/Identifiers/Identifier.php index 8efebb1a..8f5e0100 100644 --- a/src/Contracts/Toolkit/Identifiers/Identifier.php +++ b/src/Contracts/Toolkit/Identifiers/Identifier.php @@ -20,15 +20,12 @@ interface Identifier extends Stringable, Contextual /** * Is the identifier the same as the provided identifier? * - * @param Identifier|null $other - * @return bool */ public function is(?self $other): bool; /** * Fluent to-string method. * - * @return string */ public function toString(): string; @@ -37,5 +34,5 @@ public function toString(): string; * * @return array-key */ - public function key(): string|int; + public function key(): int|string; } diff --git a/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php b/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php index e1f13f60..7b3ff6a1 100644 --- a/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php +++ b/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php @@ -17,8 +17,6 @@ interface IdentifierFactory /** * Make an identifier. * - * @param mixed $id - * @return Identifier */ public function make(mixed $id): Identifier; } diff --git a/src/Contracts/Toolkit/Identifiers/UuidFactory.php b/src/Contracts/Toolkit/Identifiers/UuidFactory.php index ed9ab1fd..8f389fda 100644 --- a/src/Contracts/Toolkit/Identifiers/UuidFactory.php +++ b/src/Contracts/Toolkit/Identifiers/UuidFactory.php @@ -23,8 +23,6 @@ interface UuidFactory /** * Create a UUID identifier from an identifier or a base UUID interface. * - * @param Identifier|UuidInterface $uuid - * @return Uuid */ public function from(Identifier|UuidInterface $uuid): Uuid; @@ -121,7 +119,7 @@ public function uuid2( * @param string $name The name to use for creating a UUID * @return Uuid A UUID instance that represents a version 3 UUID */ - public function uuid3(UuidInterface|string $ns, string $name): Uuid; + public function uuid3(string|UuidInterface $ns, string $name): Uuid; /** * Returns a version 4 (random) UUID @@ -138,7 +136,7 @@ public function uuid4(): Uuid; * @param string $name The name to use for creating a UUID * @return Uuid A UUID instance that represents a version 5 UUID */ - public function uuid5(UuidInterface|string $ns, string $name): Uuid; + public function uuid5(string|UuidInterface $ns, string $name): Uuid; /** * Returns a version 6 (reordered time) UUID from a host ID, sequence number, diff --git a/src/Contracts/Toolkit/Iterables/KeyedSet.php b/src/Contracts/Toolkit/Iterables/KeyedSet.php index 190480ab..411a97e4 100644 --- a/src/Contracts/Toolkit/Iterables/KeyedSet.php +++ b/src/Contracts/Toolkit/Iterables/KeyedSet.php @@ -31,14 +31,12 @@ public function all(): array; /** * Is the set empty? * - * @return bool */ public function isEmpty(): bool; /** * Is the set not empty? * - * @return bool */ public function isNotEmpty(): bool; } diff --git a/src/Contracts/Toolkit/Iterables/ListIterator.php b/src/Contracts/Toolkit/Iterables/ListIterator.php index 1003666e..bd4f2d0c 100644 --- a/src/Contracts/Toolkit/Iterables/ListIterator.php +++ b/src/Contracts/Toolkit/Iterables/ListIterator.php @@ -31,14 +31,12 @@ public function all(): array; /** * Is the list empty? * - * @return bool */ public function isEmpty(): bool; /** * Is the list not empty? * - * @return bool */ public function isNotEmpty(): bool; } diff --git a/src/Contracts/Toolkit/Loggable/Contextual.php b/src/Contracts/Toolkit/Loggable/Contextual.php index 6933af6c..67693368 100644 --- a/src/Contracts/Toolkit/Loggable/Contextual.php +++ b/src/Contracts/Toolkit/Loggable/Contextual.php @@ -17,7 +17,6 @@ interface Contextual /** * Get the value to use when adding the value to log context. * - * @return mixed */ public function context(): mixed; } diff --git a/src/Contracts/Toolkit/Messages/IntegrationEvent.php b/src/Contracts/Toolkit/Messages/IntegrationEvent.php index 92bff995..d0d683bd 100644 --- a/src/Contracts/Toolkit/Messages/IntegrationEvent.php +++ b/src/Contracts/Toolkit/Messages/IntegrationEvent.php @@ -17,13 +17,7 @@ interface IntegrationEvent extends Message { - /** - * @return Uuid - */ public function getUuid(): Uuid; - /** - * @return DateTimeImmutable - */ public function getOccurredAt(): DateTimeImmutable; } diff --git a/src/Contracts/Toolkit/Pipeline/PipeContainer.php b/src/Contracts/Toolkit/Pipeline/PipeContainer.php index 7c6117ee..85befe5f 100644 --- a/src/Contracts/Toolkit/Pipeline/PipeContainer.php +++ b/src/Contracts/Toolkit/Pipeline/PipeContainer.php @@ -17,8 +17,6 @@ interface PipeContainer /** * Get a pipe by its name. * - * @param string $pipeName - * @return callable */ public function get(string $pipeName): callable; } diff --git a/src/Contracts/Toolkit/Pipeline/Pipeline.php b/src/Contracts/Toolkit/Pipeline/Pipeline.php index 4526aa4e..2da02f9f 100644 --- a/src/Contracts/Toolkit/Pipeline/Pipeline.php +++ b/src/Contracts/Toolkit/Pipeline/Pipeline.php @@ -17,24 +17,18 @@ interface Pipeline /** * Process the payload. * - * @param mixed $payload - * @return mixed */ public function __invoke(mixed $payload): mixed; /** * Create a new pipeline with the appended stage. * - * @param callable $stage - * @return Pipeline */ public function pipe(callable $stage): self; /** * Process the payload through the pipeline. * - * @param mixed $payload - * @return mixed */ public function process(mixed $payload): mixed; } diff --git a/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php b/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php index 324fa0f8..dc11da07 100644 --- a/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php +++ b/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php @@ -17,7 +17,6 @@ interface PipelineBuilder /** * Add the provided stage. * - * @param callable|string $stage * @return $this */ public function add(callable|string $stage): static; @@ -25,7 +24,7 @@ public function add(callable|string $stage): static; /** * Add the provided stages. * - * @param iterable $stages + * @param iterable $stages * @return $this */ public function through(iterable $stages): static; @@ -33,8 +32,6 @@ public function through(iterable $stages): static; /** * Build a new pipeline. * - * @param Processor|null $processor - * @return Pipeline */ public function build(?Processor $processor = null): Pipeline; } diff --git a/src/Contracts/Toolkit/Pipeline/Processor.php b/src/Contracts/Toolkit/Pipeline/Processor.php index feeaa0a4..43c797d5 100644 --- a/src/Contracts/Toolkit/Pipeline/Processor.php +++ b/src/Contracts/Toolkit/Pipeline/Processor.php @@ -17,9 +17,6 @@ interface Processor /** * Process the payload through the provided stages. * - * @param mixed $payload - * @param callable ...$stages - * @return mixed */ public function process(mixed $payload, callable ...$stages): mixed; } diff --git a/src/Contracts/Toolkit/Result/Error.php b/src/Contracts/Toolkit/Result/Error.php index 9b3239e7..d9064ab3 100644 --- a/src/Contracts/Toolkit/Result/Error.php +++ b/src/Contracts/Toolkit/Result/Error.php @@ -19,29 +19,24 @@ interface Error /** * Get the error key. * - * @return UnitEnum|string|null */ - public function key(): UnitEnum|string|null; + public function key(): string|UnitEnum|null; /** * Get the error detail. * - * @return string */ public function message(): string; /** * Get the error code. * - * @return UnitEnum|null */ public function code(): ?UnitEnum; /** * Is the error the specified error code? * - * @param UnitEnum $code - * @return bool */ public function is(UnitEnum $code): bool; } diff --git a/src/Contracts/Toolkit/Result/ListOfErrors.php b/src/Contracts/Toolkit/Result/ListOfErrors.php index 26d35f2d..bc0a7e2b 100644 --- a/src/Contracts/Toolkit/Result/ListOfErrors.php +++ b/src/Contracts/Toolkit/Result/ListOfErrors.php @@ -25,7 +25,6 @@ interface ListOfErrors extends ListIterator * Get the first error in the list, or the first matching error. * * @param Closure(Error): bool|UnitEnum|null $matcher - * @return Error|null */ public function first(Closure|UnitEnum|null $matcher = null): ?Error; @@ -33,7 +32,6 @@ public function first(Closure|UnitEnum|null $matcher = null): ?Error; * Does the list contain a matching error? * * @param Closure(Error): bool|UnitEnum $matcher - * @return bool */ public function contains(Closure|UnitEnum $matcher): bool; @@ -47,14 +45,12 @@ public function codes(): array; /** * Get the first error code in the list. * - * @return UnitEnum|null */ public function code(): ?UnitEnum; /** * Return a new instance with the provided error pushed on to the end of the list. * - * @param Error $error * @return static */ public function push(Error $error): self; @@ -62,7 +58,6 @@ public function push(Error $error): self; /** * Return a new instance with the provided errors merged in. * - * @param ListOfErrors $other * @return static */ public function merge(ListOfErrors $other): self; diff --git a/src/Contracts/Toolkit/Result/Result.php b/src/Contracts/Toolkit/Result/Result.php index b37cf6e7..ba7132f3 100644 --- a/src/Contracts/Toolkit/Result/Result.php +++ b/src/Contracts/Toolkit/Result/Result.php @@ -21,20 +21,13 @@ */ interface Result { - /** - * @return bool - */ public function didSucceed(): bool; - /** - * @return bool - */ public function didFail(): bool; /** * Abort execution if the result failed. * - * @return void * @throws FailedResultException if the result is not a success. */ public function abort(): void; @@ -57,29 +50,26 @@ public function safe(): mixed; /** * Get the errors. * - * @return IListOfErrors */ public function errors(): IListOfErrors; /** * Get an error message string. * - * @return string|null */ public function error(): ?string; /** * Get the result meta. * - * @return Meta */ public function meta(): Meta; /** * Return a new instance with the provided meta. * - * @param Meta|array $meta + * @param array|Meta $meta * @return Result */ - public function withMeta(Meta|array $meta): self; + public function withMeta(array|Meta $meta): self; } diff --git a/src/Domain/IdentifierOrEntity.php b/src/Domain/IdentifierOrEntity.php index 3672c036..46253d93 100644 --- a/src/Domain/IdentifierOrEntity.php +++ b/src/Domain/IdentifierOrEntity.php @@ -18,21 +18,11 @@ final readonly class IdentifierOrEntity { - /** - * @var Identifier|null - */ public ?Identifier $id; - /** - * @var Entity|null - */ public ?Entity $entity; - /** - * @param Identifier|Entity $idOrEntity - * @return self - */ - public static function make(Identifier|Entity $idOrEntity): self + public static function make(Entity|Identifier $idOrEntity): self { return new self($idOrEntity); } @@ -40,17 +30,13 @@ public static function make(Identifier|Entity $idOrEntity): self /** * IdentifierOrEntity constructor. * - * @param Identifier|Entity $idOrEntity */ - public function __construct(Identifier|Entity $idOrEntity) + public function __construct(Entity|Identifier $idOrEntity) { $this->id = ($idOrEntity instanceof Identifier) ? $idOrEntity : null; $this->entity = ($idOrEntity instanceof Entity) ? $idOrEntity : null; } - /** - * @return Identifier|null - */ public function id(): ?Identifier { if ($this->entity) { @@ -60,9 +46,6 @@ public function id(): ?Identifier return $this->id; } - /** - * @return Identifier - */ public function idOrFail(): Identifier { if ($id = $this->id()) { diff --git a/src/Domain/IsEntity.php b/src/Domain/IsEntity.php index c84f7df5..8392f064 100644 --- a/src/Domain/IsEntity.php +++ b/src/Domain/IsEntity.php @@ -17,30 +17,18 @@ trait IsEntity { - /** - * @var Identifier - */ private readonly Identifier $id; - /** - * @inheritDoc - */ public function getId(): Identifier { return $this->id; } - /** - * @inheritDoc - */ public function getIdOrFail(): Identifier { return $this->id; } - /** - * @inheritDoc - */ public function is(?Entity $other): bool { if ($other instanceof $this) { @@ -52,9 +40,6 @@ public function is(?Entity $other): bool return false; } - /** - * @inheritDoc - */ public function isNot(?Entity $other): bool { return !$this->is($other); diff --git a/src/Domain/IsEntityWithNullableId.php b/src/Domain/IsEntityWithNullableId.php index a77ad492..3b27cce8 100644 --- a/src/Domain/IsEntityWithNullableId.php +++ b/src/Domain/IsEntityWithNullableId.php @@ -18,22 +18,13 @@ trait IsEntityWithNullableId { - /** - * @var Identifier|null - */ private ?Identifier $id = null; - /** - * @inheritDoc - */ public function getId(): ?Identifier { return $this->id; } - /** - * @return Identifier - */ public function getIdOrFail(): Identifier { assert($this->id instanceof Identifier, 'Entity does not have an identifier.'); @@ -41,16 +32,12 @@ public function getIdOrFail(): Identifier return $this->id; } - /** - * @return bool - */ public function hasId(): bool { return $this->id instanceof Identifier; } /** - * @param Identifier $id * @return $this */ public function setId(Identifier $id): static @@ -62,9 +49,6 @@ public function setId(Identifier $id): static return $this; } - /** - * @inheritDoc - */ public function is(?Entity $other): bool { if ($other instanceof $this && $this->id) { @@ -76,9 +60,6 @@ public function is(?Entity $other): bool return false; } - /** - * @inheritDoc - */ public function isNot(?Entity $other): bool { return !$this->is($other); diff --git a/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php b/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php index 81f91a6c..3ccfc3d1 100644 --- a/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php +++ b/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php @@ -22,15 +22,11 @@ /** * PsrLogExceptionReporter constructor. * - * @param LoggerInterface $logger */ public function __construct(private LoggerInterface $logger) { } - /** - * @inheritDoc - */ public function report(Throwable $ex): void { $this->logger->error( @@ -40,7 +36,6 @@ public function report(Throwable $ex): void } /** - * @param Throwable $ex * @return array */ private function context(Throwable $ex): array diff --git a/src/Infrastructure/OutboundEventBus/ClosurePublisher.php b/src/Infrastructure/OutboundEventBus/ClosurePublisher.php index 14993628..a6dfceac 100644 --- a/src/Infrastructure/OutboundEventBus/ClosurePublisher.php +++ b/src/Infrastructure/OutboundEventBus/ClosurePublisher.php @@ -27,14 +27,13 @@ class ClosurePublisher implements OutboundEventPublisher private array $bindings = []; /** - * @var list + * @var list */ private array $pipes = []; /** * ClosurePublisher constructor. * - * @param Closure $fn */ public function __construct( private readonly Closure $fn, @@ -46,8 +45,6 @@ public function __construct( * Bind a publisher for the specified event. * * @param class-string $event - * @param Closure $fn - * @return void */ public function bind(string $event, Closure $fn): void { @@ -57,17 +54,13 @@ public function bind(string $event, Closure $fn): void /** * Publish events through the provided pipes. * - * @param list $pipes - * @return void + * @param list $pipes */ public function through(array $pipes): void { $this->pipes = array_values($pipes); } - /** - * @inheritDoc - */ public function publish(IntegrationEvent $event): void { $publisher = $this->bindings[$event::class] ?? $this->fn; diff --git a/src/Infrastructure/OutboundEventBus/ComponentPublisher.php b/src/Infrastructure/OutboundEventBus/ComponentPublisher.php index 7a09afdb..cf1b1170 100644 --- a/src/Infrastructure/OutboundEventBus/ComponentPublisher.php +++ b/src/Infrastructure/OutboundEventBus/ComponentPublisher.php @@ -22,15 +22,13 @@ class ComponentPublisher implements OutboundEventPublisher { /** - * @var array + * @var array */ private array $pipes = []; /** * ComponentPublisher constructor. * - * @param PublisherHandlerContainer $handlers - * @param PipeContainer|null $middleware */ public function __construct( private readonly PublisherHandlerContainer $handlers, @@ -41,8 +39,7 @@ public function __construct( /** * Publish events through the provided pipes. * - * @param list $pipes - * @return void + * @param list $pipes */ public function through(array $pipes): void { @@ -51,9 +48,6 @@ public function through(array $pipes): void $this->pipes = $pipes; } - /** - * @inheritDoc - */ public function publish(IntegrationEvent $event): void { $pipeline = PipelineBuilder::make($this->middleware) diff --git a/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php b/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php index 12adff99..09c9c96b 100644 --- a/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php +++ b/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php @@ -26,10 +26,6 @@ /** * LogOutboundEvent constructor. * - * @param LoggerInterface $log - * @param string $publishLevel - * @param string $publishedLevel - * @param ContextFactory $context */ public function __construct( private LoggerInterface $log, @@ -39,9 +35,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event, Closure $next): void { $name = ModuleBasename::tryFrom($event)?->toString() ?? $event::class; diff --git a/src/Infrastructure/OutboundEventBus/PublisherHandler.php b/src/Infrastructure/OutboundEventBus/PublisherHandler.php index 1ab3508e..bfe6a881 100644 --- a/src/Infrastructure/OutboundEventBus/PublisherHandler.php +++ b/src/Infrastructure/OutboundEventBus/PublisherHandler.php @@ -20,15 +20,11 @@ /** * PublisherHandler constructor. * - * @param object $handler */ public function __construct(private object $handler) { } - /** - * @inheritDoc - */ public function __invoke(IntegrationEvent $event): void { assert(method_exists($this->handler, 'publish'), sprintf( diff --git a/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php b/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php index 9f32091b..69b3cf4d 100644 --- a/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php +++ b/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php @@ -28,7 +28,6 @@ final class PublisherHandlerContainer implements IPublisherHandlerContainer /** * PublisherHandlerContainer constructor. * - * @param Closure|null $default */ public function __construct(private readonly ?Closure $default = null) { @@ -38,17 +37,12 @@ public function __construct(private readonly ?Closure $default = null) * Bind a handler factory into the container. * * @param class-string $eventName - * @param Closure $binding - * @return void */ public function bind(string $eventName, Closure $binding): void { $this->bindings[$eventName] = $binding; } - /** - * @inheritDoc - */ public function get(string $eventName): PublisherHandler { $factory = $this->bindings[$eventName] ?? $this->default; diff --git a/src/Infrastructure/Queue/ClosureQueue.php b/src/Infrastructure/Queue/ClosureQueue.php index 2ad7950b..ab5b272b 100644 --- a/src/Infrastructure/Queue/ClosureQueue.php +++ b/src/Infrastructure/Queue/ClosureQueue.php @@ -27,14 +27,13 @@ class ClosureQueue implements Queue private array $bindings = []; /** - * @var list + * @var list */ private array $pipes = []; /** * ClosureQueue constructor. * - * @param Closure $fn */ public function __construct( private readonly Closure $fn, @@ -46,8 +45,6 @@ public function __construct( * Bind an enqueuer for the specified command. * * @param class-string $command - * @param Closure $fn - * @return void */ public function bind(string $command, Closure $fn): void { @@ -57,17 +54,13 @@ public function bind(string $command, Closure $fn): void /** * Queue commands through the provided pipes. * - * @param list $pipes - * @return void + * @param list $pipes */ public function through(array $pipes): void { $this->pipes = array_values($pipes); } - /** - * @inheritDoc - */ public function push(Command $command): void { $enqueuer = $this->bindings[$command::class] ?? $this->fn; diff --git a/src/Infrastructure/Queue/ComponentQueue.php b/src/Infrastructure/Queue/ComponentQueue.php index d19c343b..2c812bdf 100644 --- a/src/Infrastructure/Queue/ComponentQueue.php +++ b/src/Infrastructure/Queue/ComponentQueue.php @@ -22,15 +22,13 @@ class ComponentQueue implements Queue { /** - * @var list + * @var list */ private array $pipes = []; /** * ComponentQueue constructor. * - * @param EnqueuerContainer $enqueuers - * @param PipeContainer|null $middleware */ public function __construct( private readonly EnqueuerContainer $enqueuers, @@ -41,17 +39,13 @@ public function __construct( /** * Dispatch messages through the provided pipes. * - * @param list $pipes - * @return void + * @param list $pipes */ public function through(array $pipes): void { $this->pipes = array_values($pipes); } - /** - * @inheritDoc - */ public function push(Command $command): void { $pipeline = PipelineBuilder::make($this->middleware) diff --git a/src/Infrastructure/Queue/Enqueuer.php b/src/Infrastructure/Queue/Enqueuer.php index b1de2f0e..abaf0fa9 100644 --- a/src/Infrastructure/Queue/Enqueuer.php +++ b/src/Infrastructure/Queue/Enqueuer.php @@ -20,15 +20,11 @@ /** * Enqueuer constructor. * - * @param object $enqueuer */ public function __construct(private object $enqueuer) { } - /** - * @inheritDoc - */ public function __invoke(Command $command): void { assert(method_exists($this->enqueuer, 'push'), sprintf( diff --git a/src/Infrastructure/Queue/EnqueuerContainer.php b/src/Infrastructure/Queue/EnqueuerContainer.php index 1db6dd53..1f0a756d 100644 --- a/src/Infrastructure/Queue/EnqueuerContainer.php +++ b/src/Infrastructure/Queue/EnqueuerContainer.php @@ -34,18 +34,12 @@ public function __construct(private readonly Closure $default) /** * Bind an enqueuer factory into the container. * - * @param string $queueableName - * @param Closure $binding - * @return void */ public function bind(string $queueableName, Closure $binding): void { $this->bindings[$queueableName] = $binding; } - /** - * @inheritDoc - */ public function get(string $command): Enqueuer { $factory = $this->bindings[$command] ?? $this->default; diff --git a/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php b/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php index 3b77918b..55c8f488 100644 --- a/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php +++ b/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php @@ -26,10 +26,6 @@ /** * LogPushedToQueue constructor. * - * @param LoggerInterface $log - * @param string $queueLevel - * @param string $queuedLevel - * @param ContextFactory $context */ public function __construct( private LoggerInterface $log, @@ -39,9 +35,6 @@ public function __construct( ) { } - /** - * @inheritDoc - */ public function __invoke(Command $command, Closure $next): void { $name = ModuleBasename::tryFrom($command)?->toString() ?? $command::class; diff --git a/src/Testing/FakeDomainEventDispatcher.php b/src/Testing/FakeDomainEventDispatcher.php index 2278da67..a5532998 100644 --- a/src/Testing/FakeDomainEventDispatcher.php +++ b/src/Testing/FakeDomainEventDispatcher.php @@ -24,17 +24,11 @@ class FakeDomainEventDispatcher implements DomainEventDispatcher, Countable */ public array $events = []; - /** - * @inheritDoc - */ public function dispatch(DomainEvent $event): void { $this->events[] = $event; } - /** - * @inheritDoc - */ public function count(): int { return count($this->events); @@ -43,7 +37,6 @@ public function count(): int /** * Expect a single event to be dispatched and return it. * - * @return DomainEvent */ public function sole(): DomainEvent { diff --git a/src/Testing/FakeExceptionReporter.php b/src/Testing/FakeExceptionReporter.php index 0cfa0565..1478aedb 100644 --- a/src/Testing/FakeExceptionReporter.php +++ b/src/Testing/FakeExceptionReporter.php @@ -24,17 +24,11 @@ final class FakeExceptionReporter implements ExceptionReporter, Countable */ public array $reported = []; - /** - * @inheritDoc - */ public function report(Throwable $ex): void { $this->reported[] = $ex; } - /** - * @inheritDoc - */ public function count(): int { return count($this->reported); @@ -43,7 +37,6 @@ public function count(): int /** * Expect a single exception to be reported and return it. * - * @return Throwable */ public function sole(): Throwable { diff --git a/src/Testing/FakeOutboundEventPublisher.php b/src/Testing/FakeOutboundEventPublisher.php index 793b0c95..f82017ff 100644 --- a/src/Testing/FakeOutboundEventPublisher.php +++ b/src/Testing/FakeOutboundEventPublisher.php @@ -24,17 +24,11 @@ class FakeOutboundEventPublisher implements OutboundEventPublisher, Countable */ public array $events = []; - /** - * @inheritDoc - */ public function publish(IntegrationEvent $event): void { $this->events[] = $event; } - /** - * @inheritDoc - */ public function count(): int { return count($this->events); @@ -43,7 +37,6 @@ public function count(): int /** * Expect a single event to be published and return it. * - * @return IntegrationEvent */ public function sole(): IntegrationEvent { diff --git a/src/Testing/FakeQueue.php b/src/Testing/FakeQueue.php index 875b67ea..bb10f87f 100644 --- a/src/Testing/FakeQueue.php +++ b/src/Testing/FakeQueue.php @@ -24,17 +24,11 @@ class FakeQueue implements Queue, Countable */ public array $commands = []; - /** - * @inheritDoc - */ public function push(Command $command): void { $this->commands[] = $command; } - /** - * @inheritDoc - */ public function count(): int { return count($this->commands); @@ -43,7 +37,6 @@ public function count(): int /** * Expect a single command to be queued and return it. * - * @return Command */ public function sole(): Command { diff --git a/src/Testing/FakeUnitOfWork.php b/src/Testing/FakeUnitOfWork.php index 04ea6842..35b29580 100644 --- a/src/Testing/FakeUnitOfWork.php +++ b/src/Testing/FakeUnitOfWork.php @@ -28,15 +28,11 @@ final class FakeUnitOfWork implements UnitOfWork /** * FakeUnitOfWork constructor. * - * @param FakeExceptionReporter $exceptions */ public function __construct(public FakeExceptionReporter $exceptions = new FakeExceptionReporter()) { } - /** - * @inheritDoc - */ public function execute(Closure $callback, int $attempts = 1): mixed { if ($attempts < 1) { diff --git a/src/Toolkit/Contracts.php b/src/Toolkit/Contracts.php index 18a4871b..0b172ebe 100644 --- a/src/Toolkit/Contracts.php +++ b/src/Toolkit/Contracts.php @@ -19,12 +19,10 @@ final class Contracts /** * Assert that the provided precondition is true. * - * @param bool $precondition - * @param string|Closure(): string $message - * @return void + * @param Closure(): string|string $message * @phpstan-assert true $precondition */ - public static function assert(bool $precondition, string|Closure $message = ''): void + public static function assert(bool $precondition, Closure|string $message = ''): void { if ($precondition === false) { throw new ContractException(is_string($message) ? $message : $message()); diff --git a/src/Toolkit/Identifiers/Guid.php b/src/Toolkit/Identifiers/Guid.php index de1cf348..89333b36 100644 --- a/src/Toolkit/Identifiers/Guid.php +++ b/src/Toolkit/Identifiers/Guid.php @@ -23,10 +23,6 @@ final readonly class Guid implements Identifier { - /** - * @param Identifier $value - * @return self - */ public static function from(Identifier $value): self { if ($value instanceof self) { @@ -39,11 +35,8 @@ public static function from(Identifier $value): self /** * Create a GUID with an integer id. * - * @param UnitEnum|string $type - * @param int $id - * @return self */ - public static function fromInteger(UnitEnum|string $type, int $id): self + public static function fromInteger(string|UnitEnum $type, int $id): self { return new self($type, new IntegerId($id)); } @@ -51,11 +44,8 @@ public static function fromInteger(UnitEnum|string $type, int $id): self /** * Create a GUID with a string id. * - * @param UnitEnum|string $type - * @param string $id - * @return self */ - public static function fromString(UnitEnum|string $type, string $id): self + public static function fromString(string|UnitEnum $type, string $id): self { return new self($type, new StringId($id)); } @@ -63,11 +53,8 @@ public static function fromString(UnitEnum|string $type, string $id): self /** * Create a GUID for a UUID. * - * @param UnitEnum|string $type - * @param Uuid|UuidInterface|string $uuid - * @return self */ - public static function fromUuid(UnitEnum|string $type, Uuid|UuidInterface|string $uuid): self + public static function fromUuid(string|UnitEnum $type, string|Uuid|UuidInterface $uuid): self { return new self($type, Uuid::from($uuid)); } @@ -75,11 +62,8 @@ public static function fromUuid(UnitEnum|string $type, Uuid|UuidInterface|string /** * Create a GUID. * - * @param UnitEnum|string $type - * @param Uuid|UuidInterface|string|int $id - * @return self */ - public static function make(UnitEnum|string $type, Uuid|UuidInterface|string|int $id): self + public static function make(string|UnitEnum $type, int|string|Uuid|UuidInterface $id): self { return match (true) { $id instanceof Uuid, $id instanceof UuidInterface, is_string($id) && RamseyUuid::isValid($id) @@ -92,29 +76,20 @@ public static function make(UnitEnum|string $type, Uuid|UuidInterface|string|int /** * Guid constructor. * - * @param UnitEnum|string $type - * @param StringId|IntegerId|Uuid $id */ public function __construct( - public UnitEnum|string $type, - public StringId|IntegerId|Uuid $id, + public string|UnitEnum $type, + public IntegerId|StringId|Uuid $id, ) { Contracts::assert(!empty($this->type), 'Type must be a non-empty string.'); } - /** - * @return string - */ public function __toString(): string { return $this->toString(); } - /** - * @param UnitEnum|string ...$types - * @return bool - */ - public function isType(UnitEnum|string ...$types): bool + public function isType(string|UnitEnum ...$types): bool { foreach ($types as $type) { if ($this->type === $type) { @@ -125,9 +100,6 @@ public function isType(UnitEnum|string ...$types): bool return false; } - /** - * @inheritDoc - */ public function is(?Identifier $other): bool { if ($this === $other) { @@ -143,10 +115,6 @@ public function is(?Identifier $other): bool return false; } - /** - * @param Guid $other - * @return bool - */ public function equals(self $other): bool { return $this->is($other); @@ -155,8 +123,6 @@ public function equals(self $other): bool /** * Fluent to-string method. * - * @param string $glue - * @return string */ public function toString(string $glue = ':'): string { @@ -165,9 +131,6 @@ public function toString(string $glue = ':'): string return "{$type}{$glue}{$this->id->value}"; } - /** - * @inheritDoc - */ public function key(): string { return $this->toString(); @@ -187,11 +150,9 @@ public function context(): array /** * Assert that this GUID is of the expected type. * - * @param UnitEnum|string $expected - * @param string $message * @return $this */ - public function assertType(UnitEnum|string $expected, string $message = ''): self + public function assertType(string|UnitEnum $expected, string $message = ''): self { Contracts::assert($this->type === $expected, $message ?: fn () => sprintf( 'Expecting type "%s", received "%s".', diff --git a/src/Toolkit/Identifiers/GuidTypeMap.php b/src/Toolkit/Identifiers/GuidTypeMap.php index cc6c9045..a80dec7a 100644 --- a/src/Toolkit/Identifiers/GuidTypeMap.php +++ b/src/Toolkit/Identifiers/GuidTypeMap.php @@ -31,11 +31,8 @@ public function __construct(private array $map = []) /** * Define an alias to type mapping. * - * @param UnitEnum|string $alias - * @param UnitEnum|string $type - * @return void */ - public function define(UnitEnum|string $alias, UnitEnum|string $type): void + public function define(string|UnitEnum $alias, string|UnitEnum $type): void { $alias = enum_string($alias); @@ -45,11 +42,8 @@ public function define(UnitEnum|string $alias, UnitEnum|string $type): void /** * Get the GUID for the specified alias and id. * - * @param UnitEnum|string $alias - * @param Uuid|UuidInterface|string|int $id - * @return Guid */ - public function guidFor(UnitEnum|string $alias, Uuid|UuidInterface|string|int $id): Guid + public function guidFor(string|UnitEnum $alias, int|string|Uuid|UuidInterface $id): Guid { return Guid::make($this->typeFor($alias), $id); } @@ -57,10 +51,8 @@ public function guidFor(UnitEnum|string $alias, Uuid|UuidInterface|string|int $i /** * Get the GUID type for the specified alias. * - * @param UnitEnum|string $alias - * @return UnitEnum|string */ - public function typeFor(UnitEnum|string $alias): UnitEnum|string + public function typeFor(string|UnitEnum $alias): string|UnitEnum { $alias = enum_string($alias); diff --git a/src/Toolkit/Identifiers/IdentifierFactory.php b/src/Toolkit/Identifiers/IdentifierFactory.php index cec6d2f8..d0562e2f 100644 --- a/src/Toolkit/Identifiers/IdentifierFactory.php +++ b/src/Toolkit/Identifiers/IdentifierFactory.php @@ -19,9 +19,6 @@ final class IdentifierFactory implements IIdentifierFactory { - /** - * @inheritDoc - */ public function make(mixed $id): Identifier { return match(true) { diff --git a/src/Toolkit/Identifiers/IntegerId.php b/src/Toolkit/Identifiers/IntegerId.php index 92821750..10538b9c 100644 --- a/src/Toolkit/Identifiers/IntegerId.php +++ b/src/Toolkit/Identifiers/IntegerId.php @@ -19,10 +19,6 @@ final readonly class IntegerId implements Identifier, JsonSerializable { - /** - * @param Identifier|int $value - * @return self - */ public static function from(Identifier|int $value): self { return match(true) { @@ -37,32 +33,22 @@ public static function from(Identifier|int $value): self /** * IntegerId constructor. * - * @param int $value */ public function __construct(public int $value) { Contracts::assert($this->value > 0, 'Identifier value must be greater than zero.'); } - /** - * @inheritDoc - */ public function __toString(): string { return $this->toString(); } - /** - * @inheritDoc - */ public function toString(): string { return (string) $this->value; } - /** - * @inheritDoc - */ public function is(?Identifier $other): bool { if ($other instanceof self) { @@ -72,34 +58,21 @@ public function is(?Identifier $other): bool return false; } - /** - * @param IntegerId $other - * @return bool - */ public function equals(self $other): bool { return $this->value === $other->value; } - /** - * @inheritDoc - */ public function key(): int { return $this->value; } - /** - * @inheritDoc - */ public function context(): int { return $this->value; } - /** - * @inheritDoc - */ public function jsonSerialize(): int { return $this->value; diff --git a/src/Toolkit/Identifiers/PossiblyNumericId.php b/src/Toolkit/Identifiers/PossiblyNumericId.php index bdc73f4a..a7668700 100644 --- a/src/Toolkit/Identifiers/PossiblyNumericId.php +++ b/src/Toolkit/Identifiers/PossiblyNumericId.php @@ -17,16 +17,9 @@ final readonly class PossiblyNumericId implements JsonSerializable, Stringable { - /** - * @var string|int - */ - public string|int $value; + public int|string $value; - /** - * @param string|int $value - * @return self - */ - public static function from(string|int $value): self + public static function from(int|string $value): self { return new self($value); } @@ -34,9 +27,8 @@ public static function from(string|int $value): self /** * PossiblyNumericId constructor * - * @param string|int $value */ - public function __construct(string|int $value) + public function __construct(int|string $value) { if (is_string($value) && 1 === preg_match('/^\d+$/', $value)) { $value = (int) $value; @@ -45,9 +37,6 @@ public function __construct(string|int $value) $this->value = $value; } - /** - * @inheritDoc - */ public function __toString(): string { return $this->toString(); @@ -56,17 +45,13 @@ public function __toString(): string /** * Fluent to-string method. * - * @return string */ public function toString(): string { return (string) $this->value; } - /** - * @return StringId|IntegerId - */ - public function toId(): StringId|IntegerId + public function toId(): IntegerId|StringId { if (is_int($this->value)) { return new IntegerId($this->value); @@ -75,10 +60,7 @@ public function toId(): StringId|IntegerId return new StringId($this->value); } - /** - * @inheritDoc - */ - public function jsonSerialize(): string|int + public function jsonSerialize(): int|string { return $this->value; } diff --git a/src/Toolkit/Identifiers/StringId.php b/src/Toolkit/Identifiers/StringId.php index 21672ed8..78a4b8af 100644 --- a/src/Toolkit/Identifiers/StringId.php +++ b/src/Toolkit/Identifiers/StringId.php @@ -19,10 +19,6 @@ final readonly class StringId implements Identifier, JsonSerializable { - /** - * @param Identifier|string $value - * @return self - */ public static function from(Identifier|string $value): self { return match(true) { @@ -37,7 +33,6 @@ public static function from(Identifier|string $value): self /** * StringId constructor. * - * @param string $value */ public function __construct(public string $value) { @@ -47,25 +42,16 @@ public function __construct(public string $value) ); } - /** - * @inheritDoc - */ public function __toString(): string { return $this->value; } - /** - * @inheritDoc - */ public function toString(): string { return $this->value; } - /** - * @inheritDoc - */ public function is(?Identifier $other): bool { if ($other instanceof self) { @@ -75,34 +61,21 @@ public function is(?Identifier $other): bool return false; } - /** - * @param StringId $other - * @return bool - */ public function equals(self $other): bool { return $this->value === $other->value; } - /** - * @inheritDoc - */ public function key(): string { return $this->value; } - /** - * @inheritDoc - */ public function context(): string { return $this->value; } - /** - * @inheritDoc - */ public function jsonSerialize(): string { return $this->value; diff --git a/src/Toolkit/Identifiers/Uuid.php b/src/Toolkit/Identifiers/Uuid.php index 3e726c3c..7e403442 100644 --- a/src/Toolkit/Identifiers/Uuid.php +++ b/src/Toolkit/Identifiers/Uuid.php @@ -20,23 +20,13 @@ final class Uuid implements Identifier, JsonSerializable { - /** - * @var IUuidFactory|null - */ private static ?IUuidFactory $factory = null; - /** - * @param IUuidFactory|null $factory - * @return void - */ public static function setFactory(?IUuidFactory $factory): void { self::$factory = $factory; } - /** - * @return IUuidFactory - */ public static function getFactory(): IUuidFactory { if (self::$factory) { @@ -46,11 +36,7 @@ public static function getFactory(): IUuidFactory return self::$factory = new UuidFactory(); } - /** - * @param Identifier|IBaseUuid|string $value - * @return self - */ - public static function from(Identifier|IBaseUuid|string $value): self + public static function from(IBaseUuid|Identifier|string $value): self { $factory = self::getFactory(); @@ -60,11 +46,7 @@ public static function from(Identifier|IBaseUuid|string $value): self }; } - /** - * @param Identifier|IBaseUuid|string|null $value - * @return self|null - */ - public static function tryFrom(Identifier|IBaseUuid|string|null $value): ?self + public static function tryFrom(IBaseUuid|Identifier|string|null $value): ?self { $factory = self::getFactory(); @@ -79,7 +61,6 @@ public static function tryFrom(Identifier|IBaseUuid|string|null $value): ?self /** * Generate a random UUID, useful in tests. * - * @return self */ public static function random(): self { @@ -89,7 +70,6 @@ public static function random(): self /** * Create a nil UUID. * - * @return self */ public static function nil(): self { @@ -99,40 +79,27 @@ public static function nil(): self /** * Uuid constructor. * - * @param IBaseUuid $value */ public function __construct(public readonly IBaseUuid $value) { } - /** - * @inheritDoc - */ public function __toString(): string { return $this->toString(); } - /** - * @inheritDoc - */ public function toString(): string { return $this->value->toString(); } - /** - * @return string - */ public function getBytes(): string { return $this->value->getBytes(); } - /** - * @inheritDoc - */ public function is(?Identifier $other): bool { if ($other instanceof self) { @@ -142,34 +109,21 @@ public function is(?Identifier $other): bool return false; } - /** - * @param Uuid $other - * @return bool - */ public function equals(self $other): bool { return $this->value->equals($other->value); } - /** - * @inheritDoc - */ public function key(): string { return $this->value->toString(); } - /** - * @inheritDoc - */ public function context(): string { return $this->value->toString(); } - /** - * @inheritDoc - */ public function jsonSerialize(): string { return $this->value->toString(); diff --git a/src/Toolkit/Identifiers/UuidFactory.php b/src/Toolkit/Identifiers/UuidFactory.php index 4d0b359c..01850f3f 100644 --- a/src/Toolkit/Identifiers/UuidFactory.php +++ b/src/Toolkit/Identifiers/UuidFactory.php @@ -25,24 +25,17 @@ final readonly class UuidFactory implements IUuidFactory { - /** - * @var BaseUuidFactory - */ private BaseUuidFactory $baseFactory; /** * UuidFactory constructor. * - * @param BaseUuidFactory|null $factory */ public function __construct(?BaseUuidFactory $factory = null) { $this->baseFactory = $factory ?? BaseUuid::getFactory(); } - /** - * @inheritDoc - */ public function from(Identifier|UuidInterface $uuid): Uuid { return match(true) { @@ -54,41 +47,26 @@ public function from(Identifier|UuidInterface $uuid): Uuid }; } - /** - * @inheritDoc - */ public function fromBytes(string $bytes): Uuid { return new Uuid($this->baseFactory->fromBytes($bytes)); } - /** - * @inheritDoc - */ public function fromDateTime(DateTimeInterface $dateTime, ?Hexadecimal $node = null, ?int $clockSeq = null): Uuid { return new Uuid($this->baseFactory->fromDateTime($dateTime, $node, $clockSeq)); } - /** - * @inheritDoc - */ public function fromInteger(string $integer): Uuid { return new Uuid($this->baseFactory->fromInteger($integer)); } - /** - * @inheritDoc - */ public function fromString(string $uuid): Uuid { return new Uuid($this->baseFactory->fromString($uuid)); } - /** - * @inheritDoc - */ public function uuid1( Hexadecimal|int|string|null $node = null, ?int $clockSeq = null, @@ -96,9 +74,6 @@ public function uuid1( return new Uuid($this->baseFactory->uuid1($node, $clockSeq)); } - /** - * @inheritDoc - */ public function uuid2( int $localDomain, ?IntegerObject $localIdentifier = null, @@ -108,41 +83,26 @@ public function uuid2( return new Uuid($this->baseFactory->uuid2($localDomain, $localIdentifier, $node, $clockSeq)); } - /** - * @inheritDoc - */ - public function uuid3(UuidInterface|string $ns, string $name): Uuid + public function uuid3(string|UuidInterface $ns, string $name): Uuid { return new Uuid($this->baseFactory->uuid3($ns, $name)); } - /** - * @inheritDoc - */ public function uuid4(): Uuid { return new Uuid($this->baseFactory->uuid4()); } - /** - * @inheritDoc - */ - public function uuid5(UuidInterface|string $ns, string $name): Uuid + public function uuid5(string|UuidInterface $ns, string $name): Uuid { return new Uuid($this->baseFactory->uuid5($ns, $name)); } - /** - * @inheritDoc - */ public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): Uuid { return new Uuid($this->baseFactory->uuid6($node, $clockSeq)); } - /** - * @inheritDoc - */ public function uuid7(?DateTimeInterface $dateTime = null): Uuid { if (method_exists($this->baseFactory, 'uuid7')) { @@ -154,9 +114,6 @@ public function uuid7(?DateTimeInterface $dateTime = null): Uuid throw new RuntimeException('UUID version 7 is not supported by the underlying factory.'); } - /** - * @inheritDoc - */ public function uuid8(string $bytes): Uuid { if (method_exists($this->baseFactory, 'uuid8')) { diff --git a/src/Toolkit/Iterables/IsKeyedSet.php b/src/Toolkit/Iterables/IsKeyedSet.php index 4f7ce8cf..b8beaf3f 100644 --- a/src/Toolkit/Iterables/IsKeyedSet.php +++ b/src/Toolkit/Iterables/IsKeyedSet.php @@ -40,25 +40,16 @@ public function all(): array return $this->stack; } - /** - * @return int - */ public function count(): int { return count($this->stack); } - /** - * @return bool - */ public function isEmpty(): bool { return empty($this->stack); } - /** - * @return bool - */ public function isNotEmpty(): bool { return !empty($this->stack); diff --git a/src/Toolkit/Iterables/IsList.php b/src/Toolkit/Iterables/IsList.php index 063aed26..e7ca8129 100644 --- a/src/Toolkit/Iterables/IsList.php +++ b/src/Toolkit/Iterables/IsList.php @@ -40,25 +40,16 @@ public function all(): array return $this->stack; } - /** - * @return int - */ public function count(): int { return count($this->stack); } - /** - * @return bool - */ public function isEmpty(): bool { return empty($this->stack); } - /** - * @return bool - */ public function isNotEmpty(): bool { return !empty($this->stack); diff --git a/src/Toolkit/Iterables/IsNonEmptyList.php b/src/Toolkit/Iterables/IsNonEmptyList.php index c41e6da0..44214857 100644 --- a/src/Toolkit/Iterables/IsNonEmptyList.php +++ b/src/Toolkit/Iterables/IsNonEmptyList.php @@ -40,9 +40,6 @@ public function all(): array return $this->stack; } - /** - * @return int - */ public function count(): int { return count($this->stack); diff --git a/src/Toolkit/Loggable/ObjectDecorator.php b/src/Toolkit/Loggable/ObjectDecorator.php index 41e52c44..488183aa 100644 --- a/src/Toolkit/Loggable/ObjectDecorator.php +++ b/src/Toolkit/Loggable/ObjectDecorator.php @@ -27,7 +27,6 @@ /** * ObjectDecorator constructor. * - * @param object $source */ public function __construct(private object $source) { @@ -64,9 +63,6 @@ public function all(): array return iterator_to_array($this); } - /** - * @inheritDoc - */ public function context(): array { return $this->all(); diff --git a/src/Toolkit/Loggable/ResultDecorator.php b/src/Toolkit/Loggable/ResultDecorator.php index ea64f0bd..c538522a 100644 --- a/src/Toolkit/Loggable/ResultDecorator.php +++ b/src/Toolkit/Loggable/ResultDecorator.php @@ -30,9 +30,6 @@ public function __construct(private Result $result) { } - /** - * @inheritDoc - */ public function context(): array { if ($this->result instanceof ContextProvider) { @@ -78,7 +75,6 @@ private function errors(): array } /** - * @param Error $error * @return array */ private function error(Error $error): array diff --git a/src/Toolkit/Loggable/SimpleContextFactory.php b/src/Toolkit/Loggable/SimpleContextFactory.php index 00e6a82c..3f1120ad 100644 --- a/src/Toolkit/Loggable/SimpleContextFactory.php +++ b/src/Toolkit/Loggable/SimpleContextFactory.php @@ -19,9 +19,6 @@ final class SimpleContextFactory implements ContextFactory { - /** - * @inheritDoc - */ public function make(Message|Result $object): array { $object = match (true) { diff --git a/src/Toolkit/ModuleBasename.php b/src/Toolkit/ModuleBasename.php index 27726cc4..c4b8fe06 100644 --- a/src/Toolkit/ModuleBasename.php +++ b/src/Toolkit/ModuleBasename.php @@ -25,7 +25,6 @@ /** * Create a message name from a class string. * - * @param object|string $class * @return static */ public static function from(object|string $class): self @@ -40,7 +39,6 @@ public static function from(object|string $class): self /** * Try to create a message name from a class. * - * @param object|string $class * @return static|null */ public static function tryFrom(object|string $class): ?self @@ -63,8 +61,6 @@ public static function tryFrom(object|string $class): ?self /** * ModuleBasename constructor. * - * @param string|null $module - * @param string $name */ private function __construct( public ?string $module, @@ -72,9 +68,6 @@ private function __construct( ) { } - /** - * @return string - */ public function __toString(): string { return $this->toString(); @@ -83,8 +76,6 @@ public function __toString(): string /** * Fluent to-string method. * - * @param string $delimiter - * @return string */ public function toString(string $delimiter = ':'): string { diff --git a/src/Toolkit/Pipeline/AccumulationProcessor.php b/src/Toolkit/Pipeline/AccumulationProcessor.php index 4b79fafa..eab78190 100644 --- a/src/Toolkit/Pipeline/AccumulationProcessor.php +++ b/src/Toolkit/Pipeline/AccumulationProcessor.php @@ -29,8 +29,6 @@ final class AccumulationProcessor implements Processor /** * AccumulationProcessor * - * @param callable $accumulator - * @param mixed|null $initialValue */ public function __construct(callable $accumulator, mixed $initialValue = null) { @@ -38,9 +36,6 @@ public function __construct(callable $accumulator, mixed $initialValue = null) $this->initialValue = $initialValue; } - /** - * @inheritDoc - */ public function process(mixed $payload, callable ...$stages): mixed { $result = $this->initialValue; diff --git a/src/Toolkit/Pipeline/InterruptibleProcessor.php b/src/Toolkit/Pipeline/InterruptibleProcessor.php index 933fd6fe..b597d26d 100644 --- a/src/Toolkit/Pipeline/InterruptibleProcessor.php +++ b/src/Toolkit/Pipeline/InterruptibleProcessor.php @@ -24,16 +24,12 @@ final class InterruptibleProcessor implements Processor /** * InterruptibleProcessor constructor. * - * @param callable $check */ public function __construct(callable $check) { $this->check = $check; } - /** - * @inheritDoc - */ public function process(mixed $payload, callable ...$stages): mixed { foreach ($stages as $stage) { diff --git a/src/Toolkit/Pipeline/LazyPipe.php b/src/Toolkit/Pipeline/LazyPipe.php index f869f0cd..106dbfd8 100644 --- a/src/Toolkit/Pipeline/LazyPipe.php +++ b/src/Toolkit/Pipeline/LazyPipe.php @@ -21,8 +21,6 @@ /** * LazyPipe constructor. * - * @param PipeContainer $container - * @param string $pipeName */ public function __construct( private PipeContainer $container, @@ -30,10 +28,6 @@ public function __construct( ) { } - /** - * @param mixed ...$args - * @return mixed - */ public function __invoke(mixed ...$args): mixed { try { diff --git a/src/Toolkit/Pipeline/MiddlewareProcessor.php b/src/Toolkit/Pipeline/MiddlewareProcessor.php index 3fdc7973..01aef899 100644 --- a/src/Toolkit/Pipeline/MiddlewareProcessor.php +++ b/src/Toolkit/Pipeline/MiddlewareProcessor.php @@ -17,16 +17,11 @@ final readonly class MiddlewareProcessor implements Processor { - /** - * @var Closure - */ private Closure $destination; /** * Return a new middleware processor that calls the destination and returns the result. * - * @param callable $destination - * @return MiddlewareProcessor */ public static function wrap(callable $destination): self { @@ -36,8 +31,6 @@ public static function wrap(callable $destination): self /** * Return a new middleware processor that calls the destination without returning a result. * - * @param callable $destination - * @return MiddlewareProcessor */ public static function call(callable $destination): self { @@ -49,16 +42,12 @@ public static function call(callable $destination): self /** * MiddlewareProcessor constructor. * - * @param Closure|null $destination */ public function __construct(?Closure $destination = null) { $this->destination = $destination ?? static fn ($payload) => $payload; } - /** - * @inheritDoc - */ public function process(mixed $payload, callable ...$stages): mixed { $pipeline = array_reduce( @@ -72,9 +61,6 @@ public function process(mixed $payload, callable ...$stages): mixed return $pipeline($payload); } - /** - * @return Closure - */ private function carry(): Closure { return function ($stack, callable $stage): Closure { diff --git a/src/Toolkit/Pipeline/PipeContainer.php b/src/Toolkit/Pipeline/PipeContainer.php index f915cb78..25312064 100644 --- a/src/Toolkit/Pipeline/PipeContainer.php +++ b/src/Toolkit/Pipeline/PipeContainer.php @@ -26,18 +26,12 @@ final class PipeContainer implements IPipeContainer /** * Bind a pipe into the container. * - * @param string $pipeName - * @param Closure $factory - * @return void */ public function bind(string $pipeName, Closure $factory): void { $this->pipes[$pipeName] = $factory; } - /** - * @inheritDoc - */ public function get(string $pipeName): callable { $factory = $this->pipes[$pipeName] ?? null; diff --git a/src/Toolkit/Pipeline/Pipeline.php b/src/Toolkit/Pipeline/Pipeline.php index 5b5c3e9f..74ec71ae 100644 --- a/src/Toolkit/Pipeline/Pipeline.php +++ b/src/Toolkit/Pipeline/Pipeline.php @@ -17,15 +17,11 @@ final class Pipeline implements IPipeline { - /** - * @var Processor - */ private readonly Processor $processor; /** * Pipeline constructor. * - * @param Processor|null $processor * @param callable[] $stages */ public function __construct( @@ -35,17 +31,11 @@ public function __construct( $this->processor = $processor ?? new SimpleProcessor(); } - /** - * @inheritDoc - */ public function __invoke(mixed $payload): mixed { return $this->process($payload); } - /** - * @inheritDoc - */ public function pipe(callable $stage): Pipeline { $pipeline = clone $this; @@ -54,9 +44,6 @@ public function pipe(callable $stage): Pipeline return $pipeline; } - /** - * @inheritDoc - */ public function process(mixed $payload): mixed { return $this->processor->process($payload, ...$this->stages); diff --git a/src/Toolkit/Pipeline/PipelineBuilder.php b/src/Toolkit/Pipeline/PipelineBuilder.php index 3ec4427e..f2bf2803 100644 --- a/src/Toolkit/Pipeline/PipelineBuilder.php +++ b/src/Toolkit/Pipeline/PipelineBuilder.php @@ -27,8 +27,6 @@ final class PipelineBuilder implements IPipelineBuilder /** * Fluent constructor. * - * @param PipeContainer|null $container - * @return self */ public static function make(?PipeContainer $container = null): self { @@ -38,15 +36,11 @@ public static function make(?PipeContainer $container = null): self /** * PipelineBuilder constructor. * - * @param PipeContainer|null $container */ public function __construct(private readonly ?PipeContainer $container = null) { } - /** - * @inheritDoc - */ public function add(callable|string $stage): static { $this->stages[] = $this->normalize($stage); @@ -54,9 +48,6 @@ public function add(callable|string $stage): static return $this; } - /** - * @inheritDoc - */ public function through(iterable $stages): static { foreach ($stages as $stage) { @@ -66,18 +57,11 @@ public function through(iterable $stages): static return $this; } - /** - * @inheritDoc - */ public function build(?Processor $processor = null): Pipeline { return new Pipeline($processor, $this->stages); } - /** - * @param callable|string $stage - * @return callable - */ private function normalize(callable|string $stage): callable { if (is_callable($stage)) { diff --git a/src/Toolkit/Pipeline/SimpleProcessor.php b/src/Toolkit/Pipeline/SimpleProcessor.php index c1035f23..94c1a5d8 100644 --- a/src/Toolkit/Pipeline/SimpleProcessor.php +++ b/src/Toolkit/Pipeline/SimpleProcessor.php @@ -16,9 +16,6 @@ final class SimpleProcessor implements Processor { - /** - * @inheritDoc - */ public function process(mixed $payload, callable ...$stages): mixed { foreach ($stages as $stage) { diff --git a/src/Toolkit/Result/Error.php b/src/Toolkit/Result/Error.php index 37ad5ac0..a2160d7f 100644 --- a/src/Toolkit/Result/Error.php +++ b/src/Toolkit/Result/Error.php @@ -18,54 +18,36 @@ final readonly class Error implements IError { - /** - * @var UnitEnum|string|null - */ - private UnitEnum|string|null $key; + private string|UnitEnum|null $key; /** * Error constructor. * - * @param UnitEnum|null $code - * @param string $message - * @param UnitEnum|string|null $key */ public function __construct( private ?UnitEnum $code = null, private string $message = '', - UnitEnum|string|null $key = null, + string|UnitEnum|null $key = null, ) { Contracts::assert(!empty($message) || $code !== null, 'Error must have a message or a code.'); $this->key = $key ?: null; } - /** - * @inheritDoc - */ - public function key(): UnitEnum|string|null + public function key(): string|UnitEnum|null { return $this->key; } - /** - * @inheritDoc - */ public function message(): string { return $this->message; } - /** - * @inheritDoc - */ public function code(): ?UnitEnum { return $this->code; } - /** - * @inheritDoc - */ public function is(UnitEnum $code): bool { return $this->code === $code; diff --git a/src/Toolkit/Result/KeyedSetOfErrors.php b/src/Toolkit/Result/KeyedSetOfErrors.php index bf77695a..4933bdc1 100644 --- a/src/Toolkit/Result/KeyedSetOfErrors.php +++ b/src/Toolkit/Result/KeyedSetOfErrors.php @@ -33,11 +33,7 @@ final class KeyedSetOfErrors implements KeyedSet */ public const DEFAULT_KEY = '_base'; - /** - * @param KeyedSetOfErrors|IListOfErrors|IError $value - * @return self - */ - public static function from(self|IListOfErrors|IError $value): self + public static function from(IError|IListOfErrors|self $value): self { return match(true) { $value instanceof self => $value, @@ -49,7 +45,6 @@ public static function from(self|IListOfErrors|IError $value): self /** * KeyedSetOfErrors constructor. * - * @param IError ...$errors */ public function __construct(IError ...$errors) { @@ -64,8 +59,6 @@ public function __construct(IError ...$errors) /** * Return a new instance with the provided error added to the set of errors. * - * @param IError $error - * @return KeyedSetOfErrors */ public function put(IError $error): self { @@ -80,10 +73,6 @@ public function put(IError $error): self return $copy; } - /** - * @param IListOfErrors|self $other - * @return self - */ public function merge(IListOfErrors|self $other): self { $copy = clone $this; @@ -108,19 +97,14 @@ public function keys(): array /** * Get errors by key. * - * @param UnitEnum|string $key - * @return IListOfErrors */ - public function get(UnitEnum|string $key): IListOfErrors + public function get(string|UnitEnum $key): IListOfErrors { $key = enum_string($key); return $this->stack[$key] ?? new ListOfErrors(); } - /** - * @return IListOfErrors - */ public function toList(): IListOfErrors { return array_reduce( @@ -130,30 +114,24 @@ public function toList(): IListOfErrors ); } - /** - * @inheritDoc - */ public function all(): array { return $this->stack; } - /** - * @return int - */ public function count(): int { - return array_reduce( + $count = array_reduce( $this->stack, static fn (int $carry, IListOfErrors $errors) => $carry + $errors->count(), 0, ); + + assert($count >= 0, 'Expecting count to be zero or greater.'); + + return $count; } - /** - * @param IError $error - * @return string - */ private function keyFor(IError $error): string { $key = $error->key(); diff --git a/src/Toolkit/Result/ListOfErrors.php b/src/Toolkit/Result/ListOfErrors.php index c4bee207..b75c70bb 100644 --- a/src/Toolkit/Result/ListOfErrors.php +++ b/src/Toolkit/Result/ListOfErrors.php @@ -24,10 +24,9 @@ final class ListOfErrors implements IListOfErrors use IsList; /** - * @param IListOfErrors|IError|UnitEnum|array|string $value - * @return self + * @param array|IError|IListOfErrors|string|UnitEnum $value */ - public static function from(IListOfErrors|IError|UnitEnum|array|string $value): self + public static function from(array|IError|IListOfErrors|string|UnitEnum $value): self { return match(true) { $value instanceof self => $value, @@ -38,17 +37,11 @@ public static function from(IListOfErrors|IError|UnitEnum|array|string $value): }; } - /** - * @param IError ...$errors - */ public function __construct(IError ...$errors) { $this->stack = array_values($errors); } - /** - * @inheritDoc - */ public function first(Closure|UnitEnum|null $matcher = null): ?IError { if ($matcher === null) { @@ -68,9 +61,6 @@ public function first(Closure|UnitEnum|null $matcher = null): ?IError return null; } - /** - * @inheritDoc - */ public function contains(Closure|UnitEnum $matcher): bool { if ($matcher instanceof UnitEnum) { @@ -86,9 +76,6 @@ public function contains(Closure|UnitEnum $matcher): bool return false; } - /** - * @inheritDoc - */ public function codes(): array { $codes = []; @@ -104,9 +91,6 @@ public function codes(): array return $codes; } - /** - * @inheritDoc - */ public function code(): ?UnitEnum { foreach ($this->stack as $error) { @@ -118,9 +102,6 @@ public function code(): ?UnitEnum return null; } - /** - * @inheritDoc - */ public function push(IError $error): self { $copy = clone $this; @@ -129,9 +110,6 @@ public function push(IError $error): self return $copy; } - /** - * @inheritDoc - */ public function merge(IListOfErrors $other): self { $copy = clone $this; @@ -143,9 +121,6 @@ public function merge(IListOfErrors $other): self return $copy; } - /** - * @return KeyedSetOfErrors - */ public function toKeyedSet(): KeyedSetOfErrors { return new KeyedSetOfErrors(...$this->stack); diff --git a/src/Toolkit/Result/Meta.php b/src/Toolkit/Result/Meta.php index 0c0486ba..fb431c16 100644 --- a/src/Toolkit/Result/Meta.php +++ b/src/Toolkit/Result/Meta.php @@ -29,10 +29,9 @@ final class Meta implements ArrayAccess, KeyedSet /** * Cast a value to meta. * - * @param Meta|array $values - * @return Meta + * @param array|Meta $values */ - public static function cast(self|array $values): self + public static function cast(array|self $values): self { if ($values instanceof self) { return $values; @@ -53,43 +52,26 @@ public function __construct(array $values = []) $this->stack = $values; } - /** - * @inheritDoc - */ public function offsetExists(mixed $offset): bool { return $this->exists($offset); } - /** - * @inheritDoc - */ public function offsetGet(mixed $offset): mixed { return $this->get($offset); } - /** - * @inheritDoc - */ public function offsetSet(mixed $offset, mixed $value): never { throw new LogicException('Result meta is immutable.'); } - /** - * @inheritDoc - */ public function offsetUnset(mixed $offset): never { throw new LogicException('Result meta is immutable.'); } - /** - * @param string $key - * @param mixed $default - * @return mixed - */ public function get(string $key, mixed $default = null): mixed { if ($this->exists($key)) { @@ -102,8 +84,6 @@ public function get(string $key, mixed $default = null): mixed /** * Does a value for the provided key exist? * - * @param string $key - * @return bool */ public function exists(string $key): bool { @@ -113,8 +93,6 @@ public function exists(string $key): bool /** * Put a value into the meta. * - * @param string $key - * @param mixed $value * @return $this */ public function put(string $key, mixed $value): self @@ -128,10 +106,10 @@ public function put(string $key, mixed $value): self /** * Merge values into the meta. * - * @param self|array $values + * @param array|self $values * @return $this */ - public function merge(self|array $values): self + public function merge(array|self $values): self { if ($values instanceof self) { $values = $values->stack; @@ -143,9 +121,6 @@ public function merge(self|array $values): self return $copy; } - /** - * @inheritDoc - */ public function all(): array { return $this->stack; diff --git a/src/Toolkit/Result/Result.php b/src/Toolkit/Result/Result.php index be121083..9ecd4e4a 100644 --- a/src/Toolkit/Result/Result.php +++ b/src/Toolkit/Result/Result.php @@ -38,10 +38,10 @@ public static function ok(mixed $value = null): self /** * Return a failed result. * - * @param IListOfErrors|IError|UnitEnum|array|string $errorOrErrors + * @param array|IError|IListOfErrors|string|UnitEnum $errorOrErrors * @return Result */ - public static function failed(IListOfErrors|IError|UnitEnum|array|string $errorOrErrors): self + public static function failed(array|IError|IListOfErrors|string|UnitEnum $errorOrErrors): self { $errors = match(true) { $errorOrErrors instanceof IListOfErrors => $errorOrErrors, @@ -58,10 +58,10 @@ public static function failed(IListOfErrors|IError|UnitEnum|array|string $errorO * * This is an alias for the `failed` method. * - * @param IListOfErrors|IError|UnitEnum|array|string $errorOrErrors + * @param array|IError|IListOfErrors|string|UnitEnum $errorOrErrors * @return Result */ - public static function fail(IListOfErrors|IError|UnitEnum|array|string $errorOrErrors): self + public static function fail(array|IError|IListOfErrors|string|UnitEnum $errorOrErrors): self { return self::failed($errorOrErrors); } @@ -69,9 +69,7 @@ public static function fail(IListOfErrors|IError|UnitEnum|array|string $errorOrE /** * Result constructor. * - * @param bool $success * @param TValue $value - * @param IListOfErrors $errors */ private function __construct( private bool $success, @@ -81,25 +79,16 @@ private function __construct( ) { } - /** - * @inheritDoc - */ public function didSucceed(): bool { return $this->success === true; } - /** - * @inheritDoc - */ public function didFail(): bool { return $this->success === false; } - /** - * @inheritDoc - */ public function abort(): void { if ($this->success === false) { @@ -107,9 +96,6 @@ public function abort(): void } } - /** - * @inheritDoc - */ public function value(): mixed { if ($this->success === true) { @@ -119,25 +105,16 @@ public function value(): mixed throw new FailedResultException($this); } - /** - * @inheritDoc - */ public function safe(): mixed { return $this->success ? $this->value : null; } - /** - * @inheritDoc - */ public function errors(): IListOfErrors { return $this->errors; } - /** - * @inheritDoc - */ public function error(): ?string { foreach ($this->errors as $error) { @@ -149,19 +126,16 @@ public function error(): ?string return null; } - /** - * @inheritDoc - */ public function meta(): Meta { return $this->meta; } /** - * @param Meta|array $meta + * @param array|Meta $meta * @return Result */ - public function withMeta(Meta|array $meta): self + public function withMeta(array|Meta $meta): self { return new self( success: $this->success, diff --git a/src/Toolkit/functions.php b/src/Toolkit/functions.php index 2fee7ec7..b0869e5f 100644 --- a/src/Toolkit/functions.php +++ b/src/Toolkit/functions.php @@ -19,10 +19,8 @@ /** * Return a scalar value for an enum. * - * @param UnitEnum|string|int $value - * @return string|int */ - function enum_value(UnitEnum|string|int $value): string|int + function enum_value(int|string|UnitEnum $value): int|string { return match (true) { $value instanceof BackedEnum => $value->value, @@ -36,10 +34,8 @@ function enum_value(UnitEnum|string|int $value): string|int /** * Return a string value for an enum. * - * @param UnitEnum|string $value - * @return string */ - function enum_string(UnitEnum|string $value): string + function enum_string(string|UnitEnum $value): string { return match (true) { $value instanceof BackedEnum && is_string($value->value) => $value->value, diff --git a/tests/Unit/Application/Bus/CommandDispatcherTest.php b/tests/Unit/Application/Bus/CommandDispatcherTest.php index fb0175a7..cf4be7a8 100644 --- a/tests/Unit/Application/Bus/CommandDispatcherTest.php +++ b/tests/Unit/Application/Bus/CommandDispatcherTest.php @@ -23,19 +23,10 @@ class CommandDispatcherTest extends TestCase { - /** - * @var CommandHandlerContainer&MockObject - */ private CommandHandlerContainer&MockObject $handlers; - /** - * @var PipeContainer&MockObject - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var CommandDispatcher - */ private CommandDispatcher $dispatcher; /** @@ -43,9 +34,6 @@ class CommandDispatcherTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -56,18 +44,12 @@ protected function setUp(): void ); } - /** - * @return void - */ protected function tearDown(): void { unset($this->handlers, $this->middleware, $this->dispatcher, $this->sequence); parent::tearDown(); } - /** - * @return void - */ public function test(): void { $command = $this->createMock(Command::class); @@ -89,9 +71,6 @@ public function test(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testWithMiddleware(): void { $command1 = new TestCommand(); diff --git a/tests/Unit/Application/Bus/CommandHandlerContainerTest.php b/tests/Unit/Application/Bus/CommandHandlerContainerTest.php index 2b3b4bc0..ceaf7457 100644 --- a/tests/Unit/Application/Bus/CommandHandlerContainerTest.php +++ b/tests/Unit/Application/Bus/CommandHandlerContainerTest.php @@ -18,9 +18,6 @@ class CommandHandlerContainerTest extends TestCase { - /** - * @return void - */ public function test(): void { $a = new TestCommandHandler(); diff --git a/tests/Unit/Application/Bus/CommandHandlerTest.php b/tests/Unit/Application/Bus/CommandHandlerTest.php index 0eba27f6..9783f8fe 100644 --- a/tests/Unit/Application/Bus/CommandHandlerTest.php +++ b/tests/Unit/Application/Bus/CommandHandlerTest.php @@ -18,9 +18,6 @@ class CommandHandlerTest extends TestCase { - /** - * @return void - */ public function test(): void { $command = new TestCommand(); @@ -43,9 +40,6 @@ public function test(): void $this->assertSame($middleware, $handler->middleware()); } - /** - * @return void - */ public function testItDoesNotHaveExecuteMethod(): void { $handler = new CommandHandler(new \DateTime()); diff --git a/tests/Unit/Application/Bus/CommandQueuerTest.php b/tests/Unit/Application/Bus/CommandQueuerTest.php index 1fef43ed..ee5a4525 100644 --- a/tests/Unit/Application/Bus/CommandQueuerTest.php +++ b/tests/Unit/Application/Bus/CommandQueuerTest.php @@ -19,19 +19,10 @@ class CommandQueuerTest extends TestCase { - /** - * @var MockObject&Queue - */ - private Queue&MockObject $queue; + private MockObject&Queue $queue; - /** - * @var CommandQueuer - */ private CommandQueuer $queuer; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -41,18 +32,12 @@ protected function setUp(): void ); } - /** - * @return void - */ protected function tearDown(): void { unset($this->queue, $this->queuer); parent::tearDown(); } - /** - * @return void - */ public function test(): void { $this->queue diff --git a/tests/Unit/Application/Bus/Middleware/ExecuteInUnitOfWorkTest.php b/tests/Unit/Application/Bus/Middleware/ExecuteInUnitOfWorkTest.php index 71db599b..d2590845 100644 --- a/tests/Unit/Application/Bus/Middleware/ExecuteInUnitOfWorkTest.php +++ b/tests/Unit/Application/Bus/Middleware/ExecuteInUnitOfWorkTest.php @@ -26,9 +26,6 @@ class ExecuteInUnitOfWorkTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ public function testItCommitsUnitOfWorkOnSuccess(): void { $command = $this->createMock(Command::class); @@ -60,9 +57,6 @@ public function testItCommitsUnitOfWorkOnSuccess(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItDoesNotCommitUnitOfWorkOnFailure(): void { $command = $this->createMock(Command::class); @@ -94,9 +88,6 @@ public function testItDoesNotCommitUnitOfWorkOnFailure(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItDoesNotCatchExceptions(): void { $command = $this->createMock(Command::class); diff --git a/tests/Unit/Application/Bus/Middleware/FlushDeferredEventsTest.php b/tests/Unit/Application/Bus/Middleware/FlushDeferredEventsTest.php index 67911937..ad18b46c 100644 --- a/tests/Unit/Application/Bus/Middleware/FlushDeferredEventsTest.php +++ b/tests/Unit/Application/Bus/Middleware/FlushDeferredEventsTest.php @@ -21,14 +21,8 @@ class FlushDeferredEventsTest extends TestCase { - /** - * @var MockObject&DeferredDispatcher - */ private DeferredDispatcher&MockObject $dispatcher; - /** - * @var FlushDeferredEvents - */ private FlushDeferredEvents $middleware; /** @@ -36,9 +30,6 @@ class FlushDeferredEventsTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -48,9 +39,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testItFlushesDeferredEvents(): void { $command = $this->createMock(Command::class); @@ -77,9 +65,6 @@ public function testItFlushesDeferredEvents(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItForgetsDeferredEventsOnFailedResult(): void { $command = $this->createMock(Command::class); @@ -106,9 +91,6 @@ public function testItForgetsDeferredEventsOnFailedResult(): void } - /** - * @return void - */ public function testItForgetsDeferredEventsOnException(): void { $command = $this->createMock(Command::class); diff --git a/tests/Unit/Application/Bus/Middleware/LogMessageDispatchTest.php b/tests/Unit/Application/Bus/Middleware/LogMessageDispatchTest.php index 61de593c..31e0d860 100644 --- a/tests/Unit/Application/Bus/Middleware/LogMessageDispatchTest.php +++ b/tests/Unit/Application/Bus/Middleware/LogMessageDispatchTest.php @@ -26,24 +26,12 @@ class LogMessageDispatchTest extends TestCase { - /** - * @var LoggerInterface&MockObject - */ private LoggerInterface&MockObject $logger; - /** - * @var MockObject&ContextFactory - */ private ContextFactory&MockObject $context; - /** - * @var Command - */ private Command $message; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -53,18 +41,12 @@ protected function setUp(): void $this->message = new class () implements Command {}; } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); unset($this->logger, $this->context, $this->message); } - /** - * @return void - */ public function testWithDefaultLevels(): void { $expected = Result::ok()->withMeta(['foobar' => 'bazbat']); @@ -104,9 +86,6 @@ public function testWithDefaultLevels(): void ], $logs); } - /** - * @return void - */ public function testWithCustomLevels(): void { $expected = Result::failed('Something went wrong.'); @@ -147,9 +126,6 @@ public function testWithCustomLevels(): void ], $logs); } - /** - * @return void - */ public function testItLogsAfterTheNextClosureIsInvoked(): void { $expected = new LogicException(); diff --git a/tests/Unit/Application/Bus/Middleware/SetupBeforeDispatchTest.php b/tests/Unit/Application/Bus/Middleware/SetupBeforeDispatchTest.php index ff1161d3..f8362633 100644 --- a/tests/Unit/Application/Bus/Middleware/SetupBeforeDispatchTest.php +++ b/tests/Unit/Application/Bus/Middleware/SetupBeforeDispatchTest.php @@ -27,9 +27,6 @@ class SetupBeforeDispatchTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ public function testItSetsUpAndSucceedsWithoutTeardown(): void { $message = $this->createMock(Command::class); @@ -50,9 +47,6 @@ public function testItSetsUpAndSucceedsWithoutTeardown(): void $this->assertSame(['setup', 'next'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndSucceedsWithTeardown(): void { $message = $this->createMock(Query::class); @@ -75,9 +69,6 @@ public function testItSetsUpAndSucceedsWithTeardown(): void $this->assertSame(['setup', 'next', 'teardown'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndFailsWithoutTeardown(): void { $message = $this->createMock(Command::class); @@ -98,9 +89,6 @@ public function testItSetsUpAndFailsWithoutTeardown(): void $this->assertSame(['setup', 'next'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndFailsWithTeardown(): void { $message = $this->createMock(Command::class); @@ -123,9 +111,6 @@ public function testItSetsUpAndFailsWithTeardown(): void $this->assertSame(['setup', 'next', 'teardown'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndThrowsExceptionWithoutTeardown(): void { $message = $this->createMock(Command::class); @@ -152,9 +137,6 @@ public function testItSetsUpAndThrowsExceptionWithoutTeardown(): void $this->assertSame(['setup', 'next'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndThrowsExceptionWithTeardown(): void { $message = $this->createMock(Query::class); diff --git a/tests/Unit/Application/Bus/Middleware/TearDownAfterDispatchTest.php b/tests/Unit/Application/Bus/Middleware/TearDownAfterDispatchTest.php index 9ccc539e..32126bd0 100644 --- a/tests/Unit/Application/Bus/Middleware/TearDownAfterDispatchTest.php +++ b/tests/Unit/Application/Bus/Middleware/TearDownAfterDispatchTest.php @@ -21,9 +21,6 @@ class TearDownAfterDispatchTest extends TestCase { - /** - * @return void - */ public function testItInvokesCallbackAfterSuccess(): void { $message = $this->createMock(Command::class); @@ -44,9 +41,6 @@ public function testItInvokesCallbackAfterSuccess(): void $this->assertSame(['next', 'teardown'], $sequence); } - /** - * @return void - */ public function testItInvokesCallbackAfterFailure(): void { $message = $this->createMock(Query::class); @@ -67,9 +61,6 @@ public function testItInvokesCallbackAfterFailure(): void $this->assertSame(['next', 'teardown'], $sequence); } - /** - * @return void - */ public function testItInvokesCallbackAfterException(): void { $message = $this->createMock(Command::class); diff --git a/tests/Unit/Application/Bus/Middleware/ValidateCommandTest.php b/tests/Unit/Application/Bus/Middleware/ValidateCommandTest.php index b2776d2c..1d090b36 100644 --- a/tests/Unit/Application/Bus/Middleware/ValidateCommandTest.php +++ b/tests/Unit/Application/Bus/Middleware/ValidateCommandTest.php @@ -24,18 +24,12 @@ class ValidateCommandTest extends TestCase { /** - * @var Validator&MockObject + * @var MockObject&Validator */ private Validator $validator; - /** - * @var ValidateCommand - */ private ValidateCommand $middleware; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -53,9 +47,6 @@ protected function rules(): iterable }; } - /** - * @return void - */ public function testItSucceeds(): void { $rules = []; @@ -91,9 +82,6 @@ public function testItSucceeds(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItFails(): void { $this->validator diff --git a/tests/Unit/Application/Bus/Middleware/ValidateQueryTest.php b/tests/Unit/Application/Bus/Middleware/ValidateQueryTest.php index a0180af8..f929a95c 100644 --- a/tests/Unit/Application/Bus/Middleware/ValidateQueryTest.php +++ b/tests/Unit/Application/Bus/Middleware/ValidateQueryTest.php @@ -24,18 +24,12 @@ class ValidateQueryTest extends TestCase { /** - * @var Validator&MockObject + * @var MockObject&Validator */ private Validator $validator; - /** - * @var ValidateQuery - */ private ValidateQuery $middleware; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -53,9 +47,6 @@ protected function rules(): iterable }; } - /** - * @return void - */ public function testItSucceeds(): void { $rules = []; @@ -91,9 +82,6 @@ public function testItSucceeds(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItFails(): void { $this->validator diff --git a/tests/Unit/Application/Bus/QueryDispatcherTest.php b/tests/Unit/Application/Bus/QueryDispatcherTest.php index 4b90ddd8..94553ea7 100644 --- a/tests/Unit/Application/Bus/QueryDispatcherTest.php +++ b/tests/Unit/Application/Bus/QueryDispatcherTest.php @@ -24,18 +24,15 @@ class QueryDispatcherTest extends TestCase { /** - * @var QueryHandlerContainer&MockObject + * @var MockObject&QueryHandlerContainer */ private QueryHandlerContainer $handlers; /** - * @var PipeContainer&MockObject + * @var MockObject&PipeContainer */ private PipeContainer $middleware; - /** - * @var QueryDispatcher - */ private QueryDispatcher $dispatcher; /** @@ -43,9 +40,6 @@ class QueryDispatcherTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -56,18 +50,12 @@ protected function setUp(): void ); } - /** - * @return void - */ protected function tearDown(): void { unset($this->handlers, $this->middleware, $this->dispatcher, $this->sequence); parent::tearDown(); } - /** - * @return void - */ public function test(): void { $query = $this->createMock(Query::class); @@ -89,9 +77,6 @@ public function test(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testWithMiddleware(): void { $query1 = new TestQuery(); diff --git a/tests/Unit/Application/Bus/QueryHandlerContainerTest.php b/tests/Unit/Application/Bus/QueryHandlerContainerTest.php index 0d76bb32..4888828f 100644 --- a/tests/Unit/Application/Bus/QueryHandlerContainerTest.php +++ b/tests/Unit/Application/Bus/QueryHandlerContainerTest.php @@ -18,9 +18,6 @@ class QueryHandlerContainerTest extends TestCase { - /** - * @return void - */ public function test(): void { $a = new TestQueryHandler(); diff --git a/tests/Unit/Application/Bus/QueryHandlerTest.php b/tests/Unit/Application/Bus/QueryHandlerTest.php index ef57330e..ba5adafa 100644 --- a/tests/Unit/Application/Bus/QueryHandlerTest.php +++ b/tests/Unit/Application/Bus/QueryHandlerTest.php @@ -18,9 +18,6 @@ class QueryHandlerTest extends TestCase { - /** - * @return void - */ public function test(): void { $query = new TestQuery(); @@ -43,9 +40,6 @@ public function test(): void $this->assertSame($middleware, $handler->middleware()); } - /** - * @return void - */ public function testItDoesNotHaveExecuteMethod(): void { $handler = new QueryHandler(new \DateTime()); diff --git a/tests/Unit/Application/Bus/TestCommandHandler.php b/tests/Unit/Application/Bus/TestCommandHandler.php index 913b20b7..a7d9189c 100644 --- a/tests/Unit/Application/Bus/TestCommandHandler.php +++ b/tests/Unit/Application/Bus/TestCommandHandler.php @@ -22,7 +22,6 @@ class TestCommandHandler implements DispatchThroughMiddleware /** * Execute the command. * - * @param TestCommand $command * @return Result */ public function execute(TestCommand $command): Result @@ -34,9 +33,6 @@ public function execute(TestCommand $command): Result return Result::ok(Uuid::random()); } - /** - * @inheritDoc - */ public function middleware(): array { return []; diff --git a/tests/Unit/Application/Bus/TestQueryHandler.php b/tests/Unit/Application/Bus/TestQueryHandler.php index 43fdfd40..0120a037 100644 --- a/tests/Unit/Application/Bus/TestQueryHandler.php +++ b/tests/Unit/Application/Bus/TestQueryHandler.php @@ -20,7 +20,6 @@ class TestQueryHandler implements DispatchThroughMiddleware /** * Execute the query. * - * @param TestQuery $query * @return Result */ public function execute(TestQuery $query): Result @@ -28,9 +27,6 @@ public function execute(TestQuery $query): Result return Result::ok(99); } - /** - * @inheritDoc - */ public function middleware(): array { return []; diff --git a/tests/Unit/Application/Bus/ValidatorTest.php b/tests/Unit/Application/Bus/ValidatorTest.php index 6b8c0b0b..3b125f2b 100644 --- a/tests/Unit/Application/Bus/ValidatorTest.php +++ b/tests/Unit/Application/Bus/ValidatorTest.php @@ -37,12 +37,11 @@ public static function messageProvider(): array /** * @param class-string $message - * @return void */ #[DataProvider('messageProvider')] public function test(string $message): void { - /** @var (Command&MockObject)|(Query&MockObject) $query */ + /** @var (Command&MockObject)|(MockObject&Query) $query */ $query = $this->createMock($message); $error1 = new Error(null, 'Message 1'); $error2 = new Error(null, 'Message 2'); @@ -82,9 +81,6 @@ public function test(string $message): void $this->assertSame([$error1, $error2, $error3], $actual->all()); } - /** - * @return void - */ public function testNoRules(): void { $query = $this->createMock(Query::class); diff --git a/tests/Unit/Application/DomainEventDispatching/DeferredDispatcherTest.php b/tests/Unit/Application/DomainEventDispatching/DeferredDispatcherTest.php index 01887f18..f1c3615f 100644 --- a/tests/Unit/Application/DomainEventDispatching/DeferredDispatcherTest.php +++ b/tests/Unit/Application/DomainEventDispatching/DeferredDispatcherTest.php @@ -23,24 +23,15 @@ class DeferredDispatcherTest extends TestCase { - /** - * @var ListenerContainer&MockObject - */ private ListenerContainer&MockObject $listeners; /** - * @var MockObject&PipeContainer&MockObject + * @var MockObject&MockObject&PipeContainer */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var DeferredDispatcher - */ private DeferredDispatcher $dispatcher; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -51,9 +42,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testItDispatchesImmediately(): void { $sequence = []; @@ -117,9 +105,6 @@ public function testItDispatchesImmediately(): void $this->assertSame($sequence, ['Listener1', 'Listener2', 'Listener3']); } - /** - * @return void - */ public function testItFlushesDeferredEvents(): void { $sequence = []; @@ -191,9 +176,6 @@ public function testItFlushesDeferredEvents(): void $this->assertSame($sequence, ['Listener1', 'Listener2', 'Listener3', 'Listener4']); } - /** - * @return void - */ public function testItFlushesDeferredEventsIncludingEventsDispatchedByListeners(): void { $sequence = []; @@ -250,9 +232,6 @@ public function testItFlushesDeferredEventsIncludingEventsDispatchedByListeners( $this->assertSame($sequence, ['Listener1', 'Listener2', 'Listener3']); } - /** - * @return void - */ public function testItForgetsDeferredEvents(): void { $sequence = []; @@ -314,9 +293,6 @@ public function testItForgetsDeferredEvents(): void $this->assertSame($step3, ['Listener1', 'Listener2']); } - /** - * @return void - */ public function testItForgetsDeferredEventsAfterException(): void { $sequence = []; @@ -379,9 +355,6 @@ public function testItForgetsDeferredEventsAfterException(): void $this->dispatcher->flush(); // flush again, not expecting any events to be triggered. } - /** - * @return void - */ public function testNoListeners(): void { $event = $this->createMock(DomainEvent::class); @@ -389,9 +362,6 @@ public function testNoListeners(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testItDispatchesThroughMiddleware(): void { $event1 = new TestImmediateDomainEvent(); @@ -434,9 +404,6 @@ public function testItDispatchesThroughMiddleware(): void $this->dispatcher->dispatch($event1); } - /** - * @return void - */ public function testListenerDoesNotHaveHandleMethod(): void { $event = new TestImmediateDomainEvent(); diff --git a/tests/Unit/Application/DomainEventDispatching/DispatcherTest.php b/tests/Unit/Application/DomainEventDispatching/DispatcherTest.php index 7fac6753..fb414d12 100644 --- a/tests/Unit/Application/DomainEventDispatching/DispatcherTest.php +++ b/tests/Unit/Application/DomainEventDispatching/DispatcherTest.php @@ -23,24 +23,12 @@ class DispatcherTest extends TestCase { - /** - * @var ListenerContainer&MockObject - */ private ListenerContainer&MockObject $listeners; - /** - * @var MockObject&PipeContainer - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var Dispatcher - */ private Dispatcher $dispatcher; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -51,9 +39,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testItDispatchesImmediately(): void { $sequence = []; @@ -116,9 +101,6 @@ public function testItDispatchesImmediately(): void $this->assertSame($sequence, ['Listener1', 'Listener2', 'Listener3']); } - /** - * @return void - */ public function testNoListeners(): void { $event = $this->createMock(DomainEvent::class); @@ -126,9 +108,6 @@ public function testNoListeners(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testItDispatchesThroughMiddleware(): void { $event1 = new TestDomainEvent(); @@ -171,9 +150,6 @@ public function testItDispatchesThroughMiddleware(): void $this->dispatcher->dispatch($event1); } - /** - * @return void - */ public function testListenerDoesNotHaveHandleMethod(): void { $event = new TestImmediateDomainEvent(); diff --git a/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php b/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php index cec694fb..8a7beae0 100644 --- a/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php +++ b/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php @@ -17,9 +17,6 @@ class ListenerContainerTest extends TestCase { - /** - * @return void - */ public function testItCreatesListener(): void { $container = new ListenerContainer(); @@ -31,9 +28,6 @@ public function testItCreatesListener(): void $this->assertSame($listener, $container->get('foo')); } - /** - * @return void - */ public function testItDoesNotRecogniseListenerName(): void { $container = new ListenerContainer(); @@ -41,9 +35,6 @@ public function testItDoesNotRecogniseListenerName(): void $container->get('foo'); } - /** - * @return void - */ public function testItHandlesBindingNotReturningAnObject(): void { $container = new ListenerContainer(); diff --git a/tests/Unit/Application/DomainEventDispatching/Middleware/LogDomainEventDispatchTest.php b/tests/Unit/Application/DomainEventDispatching/Middleware/LogDomainEventDispatchTest.php index 66bca468..176ec4f7 100644 --- a/tests/Unit/Application/DomainEventDispatching/Middleware/LogDomainEventDispatchTest.php +++ b/tests/Unit/Application/DomainEventDispatching/Middleware/LogDomainEventDispatchTest.php @@ -28,14 +28,8 @@ class LogDomainEventDispatchTest extends TestCase */ private LoggerInterface $logger; - /** - * @var DomainEvent - */ private DomainEvent $event; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -60,9 +54,6 @@ public function getOccurredAt(): DateTimeImmutable }; } - /** - * @return void - */ public function testWithDefaultLevels(): void { $eventName = $this->event::class; @@ -87,9 +78,6 @@ public function testWithDefaultLevels(): void ], $logs); } - /** - * @return void - */ public function testWithCustomLevels(): void { $eventName = $this->event::class; @@ -114,9 +102,6 @@ public function testWithCustomLevels(): void ], $logs); } - /** - * @return void - */ public function testItLogsAfterTheNextClosureIsInvoked(): void { $expected = new LogicException(); diff --git a/tests/Unit/Application/DomainEventDispatching/TestDomainEvent.php b/tests/Unit/Application/DomainEventDispatching/TestDomainEvent.php index e81a18d6..76817633 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestDomainEvent.php +++ b/tests/Unit/Application/DomainEventDispatching/TestDomainEvent.php @@ -17,9 +17,6 @@ class TestDomainEvent implements DomainEvent { - /** - * @inheritDoc - */ public function getOccurredAt(): DateTimeImmutable { return new DateTimeImmutable(); diff --git a/tests/Unit/Application/DomainEventDispatching/TestImmediateDomainEvent.php b/tests/Unit/Application/DomainEventDispatching/TestImmediateDomainEvent.php index 895a6aad..09f8df55 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestImmediateDomainEvent.php +++ b/tests/Unit/Application/DomainEventDispatching/TestImmediateDomainEvent.php @@ -18,9 +18,6 @@ class TestImmediateDomainEvent implements DomainEvent, OccursImmediately { - /** - * @inheritDoc - */ public function getOccurredAt(): DateTimeImmutable { return new DateTimeImmutable(); diff --git a/tests/Unit/Application/DomainEventDispatching/TestListener.php b/tests/Unit/Application/DomainEventDispatching/TestListener.php index be206df6..f38a4153 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestListener.php +++ b/tests/Unit/Application/DomainEventDispatching/TestListener.php @@ -19,8 +19,6 @@ class TestListener /** * Handle the event. * - * @param DomainEvent $event - * @return void */ public function handle(DomainEvent $event): void { diff --git a/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php b/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php index 51d215ac..aa119d9b 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php +++ b/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php @@ -20,8 +20,6 @@ class TestListenerAfterCommit implements DispatchAfterCommit /** * Handle the event. * - * @param DomainEvent $event - * @return void */ public function handle(DomainEvent $event): void { diff --git a/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php b/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php index ca05222a..471d30a0 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php +++ b/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php @@ -20,8 +20,6 @@ class TestListenerBeforeCommit implements DispatchBeforeCommit /** * Handle the event. * - * @param DomainEvent $event - * @return void */ public function handle(DomainEvent $event): void { diff --git a/tests/Unit/Application/DomainEventDispatching/UnitOfWorkAwareDispatcherTest.php b/tests/Unit/Application/DomainEventDispatching/UnitOfWorkAwareDispatcherTest.php index f7d838d7..eb7567a8 100644 --- a/tests/Unit/Application/DomainEventDispatching/UnitOfWorkAwareDispatcherTest.php +++ b/tests/Unit/Application/DomainEventDispatching/UnitOfWorkAwareDispatcherTest.php @@ -27,29 +27,17 @@ class UnitOfWorkAwareDispatcherTest extends TestCase { - /** - * @var ListenerContainer&MockObject - */ private ListenerContainer&MockObject $listeners; /** - * @var UnitOfWorkManager&MockObject + * @var MockObject&UnitOfWorkManager */ private UnitOfWorkManager $unitOfWorkManager; - /** - * @var MockObject&PipeContainer - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var UnitOfWorkAwareDispatcher - */ private UnitOfWorkAwareDispatcher $dispatcher; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -61,9 +49,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testItDispatchesImmediately(): void { $sequence = []; @@ -156,9 +141,6 @@ public function testItDispatchesImmediately(): void $this->assertSame($sequence, ['Listener1', 'Listener2', 'Listener3']); } - /** - * @return void - */ public function testItDoesNotDispatchImmediately(): void { $event = $this->createMock(DomainEvent::class); @@ -237,9 +219,6 @@ public function testItDispatchesEventInBeforeCommitCallback(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testBeforeCommitListener(): void { $event = new TestImmediateDomainEvent(); @@ -271,9 +250,6 @@ public function testBeforeCommitListener(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testAfterCommitListener(): void { $event = new TestImmediateDomainEvent(); @@ -305,9 +281,6 @@ public function testAfterCommitListener(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testNoListeners(): void { $event = $this->createMock(DomainEvent::class); @@ -315,9 +288,6 @@ public function testNoListeners(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testItDispatchesThroughMiddleware(): void { $event1 = new TestImmediateDomainEvent(); @@ -360,9 +330,6 @@ public function testItDispatchesThroughMiddleware(): void $this->dispatcher->dispatch($event1); } - /** - * @return void - */ public function testListenerDoesNotHaveHandleMethod(): void { $event = new TestImmediateDomainEvent(); @@ -380,9 +347,6 @@ public function testListenerDoesNotHaveHandleMethod(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testListenerCannotImplementBothBeforeAndAfterCommit(): void { $listener = new class () implements DispatchBeforeCommit, DispatchAfterCommit { diff --git a/tests/Unit/Application/InboundEventBus/EventHandlerContainerTest.php b/tests/Unit/Application/InboundEventBus/EventHandlerContainerTest.php index 91810c8a..335520e9 100644 --- a/tests/Unit/Application/InboundEventBus/EventHandlerContainerTest.php +++ b/tests/Unit/Application/InboundEventBus/EventHandlerContainerTest.php @@ -19,9 +19,6 @@ class EventHandlerContainerTest extends TestCase { - /** - * @return void - */ public function testItHasHandlers(): void { $a = new TestEventHandler(); @@ -35,9 +32,6 @@ public function testItHasHandlers(): void $this->assertEquals(new EventHandler($b), $container->get(TestOutboundEvent::class)); } - /** - * @return void - */ public function testItHasDefaultHandler(): void { $a = new TestEventHandler(); @@ -51,9 +45,6 @@ public function testItHasDefaultHandler(): void } - /** - * @return void - */ public function testItDoesNotHaveHandler(): void { $container = new EventHandlerContainer(); diff --git a/tests/Unit/Application/InboundEventBus/EventHandlerTest.php b/tests/Unit/Application/InboundEventBus/EventHandlerTest.php index 95d26227..8c9656c7 100644 --- a/tests/Unit/Application/InboundEventBus/EventHandlerTest.php +++ b/tests/Unit/Application/InboundEventBus/EventHandlerTest.php @@ -17,9 +17,6 @@ class EventHandlerTest extends TestCase { - /** - * @return void - */ public function test(): void { $event = new TestInboundEvent(); @@ -41,9 +38,6 @@ public function test(): void $this->assertSame($middleware, $handler->middleware()); } - /** - * @return void - */ public function testItDoesNotHaveExecuteMethod(): void { $handler = new EventHandler(new \DateTime()); diff --git a/tests/Unit/Application/InboundEventBus/InboundEventDispatcherTest.php b/tests/Unit/Application/InboundEventBus/InboundEventDispatcherTest.php index 3120ccea..8d6d92c8 100644 --- a/tests/Unit/Application/InboundEventBus/InboundEventDispatcherTest.php +++ b/tests/Unit/Application/InboundEventBus/InboundEventDispatcherTest.php @@ -22,19 +22,10 @@ class InboundEventDispatcherTest extends TestCase { - /** - * @var EventHandlerContainer&MockObject - */ private EventHandlerContainer&MockObject $handlers; - /** - * @var PipeContainer&MockObject - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var InboundEventDispatcher - */ private InboundEventDispatcher $dispatcher; /** @@ -42,9 +33,6 @@ class InboundEventDispatcherTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -55,18 +43,12 @@ protected function setUp(): void ); } - /** - * @return void - */ protected function tearDown(): void { unset($this->handlers, $this->middleware, $this->dispatcher, $this->sequence); parent::tearDown(); } - /** - * @return void - */ public function test(): void { $event = $this->createMock(IntegrationEvent::class); @@ -85,9 +67,6 @@ public function test(): void $this->dispatcher->dispatch($event); } - /** - * @return void - */ public function testWithMiddleware(): void { $event1 = new TestInboundEvent(); diff --git a/tests/Unit/Application/InboundEventBus/Middleware/FlushDeferredEventsTest.php b/tests/Unit/Application/InboundEventBus/Middleware/FlushDeferredEventsTest.php index 4137ed07..00db98ee 100644 --- a/tests/Unit/Application/InboundEventBus/Middleware/FlushDeferredEventsTest.php +++ b/tests/Unit/Application/InboundEventBus/Middleware/FlushDeferredEventsTest.php @@ -20,14 +20,8 @@ class FlushDeferredEventsTest extends TestCase { - /** - * @var MockObject&DeferredDispatcher - */ private DeferredDispatcher&MockObject $dispatcher; - /** - * @var FlushDeferredEvents - */ private FlushDeferredEvents $middleware; /** @@ -35,9 +29,6 @@ class FlushDeferredEventsTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -47,9 +38,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testItFlushesDeferredEvents(): void { $event = $this->createMock(IntegrationEvent::class); @@ -74,9 +62,6 @@ public function testItFlushesDeferredEvents(): void } - /** - * @return void - */ public function testItForgetsDeferredEventsOnException(): void { $event = $this->createMock(IntegrationEvent::class); diff --git a/tests/Unit/Application/InboundEventBus/Middleware/HandleInUnitOfWorkTest.php b/tests/Unit/Application/InboundEventBus/Middleware/HandleInUnitOfWorkTest.php index 937a3680..90f61f94 100644 --- a/tests/Unit/Application/InboundEventBus/Middleware/HandleInUnitOfWorkTest.php +++ b/tests/Unit/Application/InboundEventBus/Middleware/HandleInUnitOfWorkTest.php @@ -25,9 +25,6 @@ class HandleInUnitOfWorkTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ public function testItCommitsUnitOfWork(): void { $event = $this->createMock(IntegrationEvent::class); @@ -56,9 +53,6 @@ public function testItCommitsUnitOfWork(): void $this->assertSame(['begin', 'handler', 'commit'], $this->sequence); } - /** - * @return void - */ public function testItDoesNotCatchExceptions(): void { $event = $this->createMock(IntegrationEvent::class); diff --git a/tests/Unit/Application/InboundEventBus/Middleware/LogInboundEventTest.php b/tests/Unit/Application/InboundEventBus/Middleware/LogInboundEventTest.php index 6760cd15..8b899a5d 100644 --- a/tests/Unit/Application/InboundEventBus/Middleware/LogInboundEventTest.php +++ b/tests/Unit/Application/InboundEventBus/Middleware/LogInboundEventTest.php @@ -29,14 +29,8 @@ class LogInboundEventTest extends TestCase */ private LoggerInterface $logger; - /** - * @var TestOutboundEvent - */ private TestOutboundEvent $event; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -45,9 +39,6 @@ protected function setUp(): void $this->event = new TestOutboundEvent(); } - /** - * @return void - */ public function test(): void { $eventName = ModuleBasename::from($this->event); @@ -76,9 +67,6 @@ public function test(): void ], $logs); } - /** - * @return void - */ public function testWithCustomLevels(): void { $eventName = ModuleBasename::from($this->event); @@ -108,9 +96,6 @@ public function testWithCustomLevels(): void ], $logs); } - /** - * @return void - */ public function testItLogsAfterTheNextClosureIsInvoked(): void { $expected = new LogicException(); diff --git a/tests/Unit/Application/InboundEventBus/Middleware/SetupBeforeEventTest.php b/tests/Unit/Application/InboundEventBus/Middleware/SetupBeforeEventTest.php index d97e4a6e..1507cb3b 100644 --- a/tests/Unit/Application/InboundEventBus/Middleware/SetupBeforeEventTest.php +++ b/tests/Unit/Application/InboundEventBus/Middleware/SetupBeforeEventTest.php @@ -26,9 +26,6 @@ class SetupBeforeEventTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ public function testItSetsUpAndSucceedsWithoutTeardown(): void { $event = $this->createMock(IntegrationEvent::class); @@ -46,9 +43,6 @@ public function testItSetsUpAndSucceedsWithoutTeardown(): void $this->assertSame(['setup', 'next'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndSucceedsWithTeardown(): void { $event = $this->createMock(IntegrationEvent::class); @@ -68,9 +62,6 @@ public function testItSetsUpAndSucceedsWithTeardown(): void $this->assertSame(['setup', 'next', 'teardown'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndThrowsExceptionWithoutTeardown(): void { $event = $this->createMock(IntegrationEvent::class); @@ -97,9 +88,6 @@ public function testItSetsUpAndThrowsExceptionWithoutTeardown(): void $this->assertSame(['setup', 'next'], $this->sequence); } - /** - * @return void - */ public function testItSetsUpAndThrowsExceptionWithTeardown(): void { $event = $this->createMock(IntegrationEvent::class); diff --git a/tests/Unit/Application/InboundEventBus/Middleware/TearDownAfterEventTest.php b/tests/Unit/Application/InboundEventBus/Middleware/TearDownAfterEventTest.php index 6f980a66..4e0371b5 100644 --- a/tests/Unit/Application/InboundEventBus/Middleware/TearDownAfterEventTest.php +++ b/tests/Unit/Application/InboundEventBus/Middleware/TearDownAfterEventTest.php @@ -19,9 +19,6 @@ class TearDownAfterEventTest extends TestCase { - /** - * @return void - */ public function testItInvokesCallbackAfterSuccess(): void { $event = $this->createMock(IntegrationEvent::class); @@ -39,9 +36,6 @@ public function testItInvokesCallbackAfterSuccess(): void $this->assertSame(['next', 'teardown'], $sequence); } - /** - * @return void - */ public function testItInvokesCallbackAfterException(): void { $event = $this->createMock(IntegrationEvent::class); diff --git a/tests/Unit/Application/InboundEventBus/SwallowInboundEventTest.php b/tests/Unit/Application/InboundEventBus/SwallowInboundEventTest.php index f972426b..63f3c345 100644 --- a/tests/Unit/Application/InboundEventBus/SwallowInboundEventTest.php +++ b/tests/Unit/Application/InboundEventBus/SwallowInboundEventTest.php @@ -20,9 +20,6 @@ class SwallowInboundEventTest extends TestCase { - /** - * @return void - */ public function testItDoesNothing(): void { $handler = new SwallowInboundEvent(); @@ -31,9 +28,6 @@ public function testItDoesNothing(): void $this->assertTrue(true); } - /** - * @return void - */ public function testItLogsThatItDoesNothing(): void { $event = new TestInboundEvent(); @@ -52,9 +46,6 @@ public function testItLogsThatItDoesNothing(): void $handler->handle($event); } - /** - * @return void - */ public function testItLogsThatItDoesNothingWithSpecifiedLogLevel(): void { $event = new TestInboundEvent(); diff --git a/tests/Unit/Application/InboundEventBus/TestEventHandler.php b/tests/Unit/Application/InboundEventBus/TestEventHandler.php index 48baf5a1..50dfb955 100644 --- a/tests/Unit/Application/InboundEventBus/TestEventHandler.php +++ b/tests/Unit/Application/InboundEventBus/TestEventHandler.php @@ -16,18 +16,11 @@ class TestEventHandler implements DispatchThroughMiddleware { - /** - * @param TestInboundEvent $command - * @return void - */ public function handle(TestInboundEvent $command): void { // no-op } - /** - * @inheritDoc - */ public function middleware(): array { return []; diff --git a/tests/Unit/Application/InboundEventBus/TestInboundEvent.php b/tests/Unit/Application/InboundEventBus/TestInboundEvent.php index e8aee9c2..1e50e4cf 100644 --- a/tests/Unit/Application/InboundEventBus/TestInboundEvent.php +++ b/tests/Unit/Application/InboundEventBus/TestInboundEvent.php @@ -18,17 +18,11 @@ class TestInboundEvent implements IntegrationEvent { - /** - * @return Uuid - */ public function getUuid(): Uuid { return Uuid::random(); } - /** - * @return DateTimeImmutable - */ public function getOccurredAt(): DateTimeImmutable { return new DateTimeImmutable(); diff --git a/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php b/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php index 93b92ec7..f799a97f 100644 --- a/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php +++ b/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php @@ -23,24 +23,12 @@ class UnitOfWorkManagerTest extends TestCase { - /** - * @var UnitOfWork&MockObject - */ - private UnitOfWork&MockObject $unitOfWork; + private MockObject&UnitOfWork $unitOfWork; - /** - * @var MockObject&ExceptionReporter - */ private ExceptionReporter&MockObject $reporter; - /** - * @var UnitOfWorkManager - */ private UnitOfWorkManager $manager; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -51,9 +39,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testItExecutesCallbacks(): void { $sequence = []; @@ -103,9 +88,6 @@ public function testItExecutesCallbacks(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItExecutesCallbackWhenTransactionFailsToCommit(): void { $expected = new \RuntimeException('Boom'); @@ -152,7 +134,6 @@ public function testItExecutesCallbackWhenTransactionFailsToCommit(): void /** * If any callbacks get registered by other callbacks, they are executed. * - * @return void */ public function testItExecutesAdditionalCommitCallbacks(): void { @@ -231,9 +212,6 @@ function () use (&$sequence): void { $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItFlushesCallbacksOnSuccessfulTransaction(): void { $this->unitOfWork @@ -253,9 +231,6 @@ public function testItFlushesCallbacksOnSuccessfulTransaction(): void $this->assertSame(2, $result2); } - /** - * @return void - */ public function testItFlushesCallbacksOnUnsuccessfulTransaction(): void { $ex = new LogicException('Boom'); @@ -305,7 +280,6 @@ public function testItFlushesCallbacksOnUnsuccessfulTransaction(): void * is thrown should be forgotten. Otherwise, if the callback is retried, the before * callbacks will be executed twice. * - * @return void */ public function testItHandlesCallbackExecutingMultipleTimes(): void { @@ -396,7 +370,6 @@ function () use (&$sequence): void { * because any that are registered on one of the failed attempts should havbe been * forgotten. * - * @return void */ public function testItHandlesUnitOfWorkFailingMultipleTimes(): void { @@ -469,9 +442,6 @@ function () use (&$sequence): void { ], $sequence); } - /** - * @return void - */ public function testItFailsIfBeforeCallbacksAreQueuedBeforeTransaction(): void { $this->unitOfWork @@ -484,9 +454,6 @@ public function testItFailsIfBeforeCallbacksAreQueuedBeforeTransaction(): void $this->manager->beforeCommit(fn () => null); } - /** - * @return void - */ public function testItFailsIfAfterCallbacksAreQueuedBeforeTransaction(): void { $this->expectException(RuntimeException::class); @@ -495,9 +462,6 @@ public function testItFailsIfAfterCallbacksAreQueuedBeforeTransaction(): void $this->manager->afterCommit(fn () => null); } - /** - * @return void - */ public function testItCannotStartTransactionWithinAnExistingOne(): void { $this->unitOfWork @@ -515,9 +479,6 @@ public function testItCannotStartTransactionWithinAnExistingOne(): void }); } - /** - * @return void - */ public function testItFailsIfAfterCommitCallbackRegistersBeforeCommitCallback(): void { $this->unitOfWork @@ -534,9 +495,6 @@ public function testItFailsIfAfterCommitCallbackRegistersBeforeCommitCallback(): }); } - /** - * @return void - */ public function testAttemptsMustBeGreaterThanZero(): void { $this->expectException(RuntimeException::class); diff --git a/tests/Unit/Domain/EntityTest.php b/tests/Unit/Domain/EntityTest.php index 02a94787..6d2f6dbb 100644 --- a/tests/Unit/Domain/EntityTest.php +++ b/tests/Unit/Domain/EntityTest.php @@ -21,9 +21,6 @@ class EntityTest extends TestCase { - /** - * @return void - */ public function test(): void { $entity = new TestEntity($guid = Guid::fromInteger('SomeType', 1)); @@ -34,9 +31,6 @@ public function test(): void $this->assertTrue($entity->isNot(null)); } - /** - * @return void - */ public function testItIsTheSame(): void { $a = new TestEntity( @@ -57,9 +51,6 @@ public function testItIsTheSame(): void $this->assertFalse($a->isNot($b)); } - /** - * @return void - */ public function testItIsNotTheSame(): void { $a = new TestEntity( @@ -80,9 +71,6 @@ public function testItIsNotTheSame(): void $this->assertTrue($a->isNot($b)); } - /** - * @return void - */ public function testItIsDifferentClass(): void { $a = new TestEntity( diff --git a/tests/Unit/Domain/EntityWithNullableGuidTest.php b/tests/Unit/Domain/EntityWithNullableGuidTest.php index 9be1bd23..ef14746f 100644 --- a/tests/Unit/Domain/EntityWithNullableGuidTest.php +++ b/tests/Unit/Domain/EntityWithNullableGuidTest.php @@ -34,9 +34,6 @@ public function test(): void $this->assertTrue($entity->hasId()); } - /** - * @return TestEntityWithNullableId - */ public function testWithNullId(): TestEntityWithNullableId { $entity = new TestEntityWithNullableId(); @@ -49,10 +46,6 @@ public function testWithNullId(): TestEntityWithNullableId return $entity; } - /** - * @param TestEntityWithNullableId $entity - * @return void - */ #[Depends('testWithNullId')] public function testGetIdOrFailWithoutId(TestEntityWithNullableId $entity): void { @@ -79,9 +72,6 @@ public function testSetIdWhenEntityHasGuid(): void $entity->setId(Guid::fromInteger('SomeType', 2)); } - /** - * @return void - */ public function testItIsTheSame(): void { $a = new TestEntityWithNullableId( @@ -102,9 +92,6 @@ public function testItIsTheSame(): void $this->assertFalse($a->isNot($b)); } - /** - * @return void - */ public function testItIsNotTheSameWithNullId(): void { $a = new TestEntityWithNullableId(); @@ -121,9 +108,6 @@ public function testItIsNotTheSameWithNullId(): void $this->assertTrue($a->isNot($b)); } - /** - * @return void - */ public function testItIsTheSameWhenOtherHasNullId(): void { $a = new TestEntityWithNullableId( @@ -142,9 +126,6 @@ public function testItIsTheSameWhenOtherHasNullId(): void $this->assertTrue($a->isNot($b)); } - /** - * @return void - */ public function testItIsNotTheSame(): void { $a = new TestEntityWithNullableId( @@ -165,9 +146,6 @@ public function testItIsNotTheSame(): void $this->assertTrue($a->isNot($b)); } - /** - * @return void - */ public function testItIsDifferentClass(): void { $a = new TestEntityWithNullableId( diff --git a/tests/Unit/Domain/IdentifierOrEntityTest.php b/tests/Unit/Domain/IdentifierOrEntityTest.php index 10127422..edd68404 100644 --- a/tests/Unit/Domain/IdentifierOrEntityTest.php +++ b/tests/Unit/Domain/IdentifierOrEntityTest.php @@ -19,9 +19,6 @@ class IdentifierOrEntityTest extends TestCase { - /** - * @return void - */ public function testItIsAGuid(): void { $guidOrEntity = IdentifierOrEntity::make($guid = Guid::fromInteger('SomeType', 1)); @@ -31,9 +28,6 @@ public function testItIsAGuid(): void $this->assertNull($guidOrEntity->entity); } - /** - * @return void - */ public function testItIsAnEntityWithGuid(): void { $entity = $this->createMock(Entity::class); @@ -46,9 +40,6 @@ public function testItIsAnEntityWithGuid(): void $this->assertSame($entity, $guidOrEntity->entity); } - /** - * @return void - */ public function testItIsAnEntityWithoutGuid(): void { $entity = $this->createMock(Entity::class); diff --git a/tests/Unit/Domain/TestEntity.php b/tests/Unit/Domain/TestEntity.php index e461ab13..31c35f17 100644 --- a/tests/Unit/Domain/TestEntity.php +++ b/tests/Unit/Domain/TestEntity.php @@ -23,8 +23,6 @@ /** * TestEntity constructor * - * @param Identifier $id - * @param string $name */ public function __construct(Identifier $id, private string $name = 'John Doe') { @@ -34,7 +32,6 @@ public function __construct(Identifier $id, private string $name = 'John Doe') /** * Get the entity's name. * - * @return string */ public function getName(): string { diff --git a/tests/Unit/Domain/TestEntityWithNullableId.php b/tests/Unit/Domain/TestEntityWithNullableId.php index e4a464a5..c27f80b5 100644 --- a/tests/Unit/Domain/TestEntityWithNullableId.php +++ b/tests/Unit/Domain/TestEntityWithNullableId.php @@ -23,7 +23,6 @@ class TestEntityWithNullableId implements Entity /** * TestEntityWithNullableGuid constructor. * - * @param Identifier|null $id */ public function __construct(?Identifier $id = null) { diff --git a/tests/Unit/Infrastructure/ExceptionReporter/PsrLogExceptionReporterTest.php b/tests/Unit/Infrastructure/ExceptionReporter/PsrLogExceptionReporterTest.php index be931226..9fc71089 100644 --- a/tests/Unit/Infrastructure/ExceptionReporter/PsrLogExceptionReporterTest.php +++ b/tests/Unit/Infrastructure/ExceptionReporter/PsrLogExceptionReporterTest.php @@ -22,19 +22,10 @@ class PsrLogExceptionReporterTest extends TestCase { - /** - * @var LoggerInterface&MockObject - */ private LoggerInterface&MockObject $logger; - /** - * @var PsrLogExceptionReporter - */ private PsrLogExceptionReporter $reporter; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -42,9 +33,6 @@ protected function setUp(): void $this->reporter = new PsrLogExceptionReporter($this->logger); } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); diff --git a/tests/Unit/Infrastructure/OutboundEventBus/ClosurePublisherTest.php b/tests/Unit/Infrastructure/OutboundEventBus/ClosurePublisherTest.php index ba524d3b..338d7998 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/ClosurePublisherTest.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/ClosurePublisherTest.php @@ -20,24 +20,15 @@ class ClosurePublisherTest extends TestCase { - /** - * @var MockObject&PipeContainer - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; /** * @var array */ private array $actual = []; - /** - * @var ClosurePublisher - */ private ClosurePublisher $publisher; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -50,18 +41,12 @@ function (IntegrationEvent $event): void { ); } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); unset($this->publisher, $this->middleware, $this->actual); } - /** - * @return void - */ public function test(): void { $event = $this->createMock(IntegrationEvent::class); @@ -71,9 +56,6 @@ public function test(): void $this->assertSame([$event], $this->actual); } - /** - * @return void - */ public function testWithMiddleware(): void { $event1 = $this->createMock(IntegrationEvent::class); @@ -114,9 +96,6 @@ public function testWithMiddleware(): void } - /** - * @return void - */ public function testWithAlternativeHandlers(): void { $expected = new TestOutboundEvent(); diff --git a/tests/Unit/Infrastructure/OutboundEventBus/ComponentPublisherTest.php b/tests/Unit/Infrastructure/OutboundEventBus/ComponentPublisherTest.php index 6b65b9e4..0fcca73b 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/ComponentPublisherTest.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/ComponentPublisherTest.php @@ -23,18 +23,12 @@ class ComponentPublisherTest extends TestCase { /** - * @var PublisherHandlerContainer&MockObject + * @var MockObject&PublisherHandlerContainer */ private PublisherHandlerContainer $handlers; - /** - * @var MockObject&PipeContainer - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var ComponentPublisher - */ private ComponentPublisher $publisher; /** @@ -42,9 +36,6 @@ class ComponentPublisherTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -55,18 +46,12 @@ protected function setUp(): void ); } - /** - * @return void - */ protected function tearDown(): void { unset($this->publisher, $this->handlers, $this->middleware); parent::tearDown(); } - /** - * @return void - */ public function testPublish(): void { $event = new TestOutboundEvent(); @@ -85,9 +70,6 @@ public function testPublish(): void $this->publisher->publish($event); } - /** - * @return void - */ public function testPublishWithMiddleware(): void { $event1 = new TestOutboundEvent(); diff --git a/tests/Unit/Infrastructure/OutboundEventBus/Middleware/LogOutboundEventTest.php b/tests/Unit/Infrastructure/OutboundEventBus/Middleware/LogOutboundEventTest.php index 9f100f38..fb270fa2 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/Middleware/LogOutboundEventTest.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/Middleware/LogOutboundEventTest.php @@ -29,14 +29,8 @@ class LogOutboundEventTest extends TestCase */ private LoggerInterface $logger; - /** - * @var TestOutboundEvent - */ private TestOutboundEvent $event; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -45,9 +39,6 @@ protected function setUp(): void $this->event = new TestOutboundEvent(); } - /** - * @return void - */ public function test(): void { $eventName = ModuleBasename::from($this->event); @@ -76,9 +67,6 @@ public function test(): void ], $logs); } - /** - * @return void - */ public function testWithCustomLevels(): void { $eventName = ModuleBasename::from($this->event); @@ -108,9 +96,6 @@ public function testWithCustomLevels(): void ], $logs); } - /** - * @return void - */ public function testItLogsAfterTheNextClosureIsInvoked(): void { $expected = new LogicException(); diff --git a/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerContainerTest.php b/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerContainerTest.php index 1d55b6ec..009bc0d6 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerContainerTest.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerContainerTest.php @@ -19,9 +19,6 @@ class PublisherHandlerContainerTest extends TestCase { - /** - * @return void - */ public function testItDoesNotHaveDefaultHandler(): void { $a = new TestPublisher(); @@ -44,9 +41,6 @@ public function testItDoesNotHaveDefaultHandler(): void $container->get($event3::class); } - /** - * @return void - */ public function testItHasDefaultHandler(): void { $a = new TestPublisher(); diff --git a/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerTest.php b/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerTest.php index e5ee59c4..f911bc79 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerTest.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/PublisherHandlerTest.php @@ -18,9 +18,6 @@ class PublisherHandlerTest extends TestCase { - /** - * @return void - */ public function test(): void { $event = new TestOutboundEvent(); diff --git a/tests/Unit/Infrastructure/OutboundEventBus/TestOutboundEvent.php b/tests/Unit/Infrastructure/OutboundEventBus/TestOutboundEvent.php index 43825c60..dc6dbb8d 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/TestOutboundEvent.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/TestOutboundEvent.php @@ -18,14 +18,8 @@ class TestOutboundEvent implements IntegrationEvent { - /** - * @var Uuid - */ public readonly Uuid $uuid; - /** - * @var DateTimeImmutable - */ public readonly DateTimeImmutable $occurredAt; /** @@ -37,17 +31,11 @@ public function __construct() $this->occurredAt = new DateTimeImmutable(); } - /** - * @inheritDoc - */ public function getUuid(): Uuid { return $this->uuid; } - /** - * @inheritDoc - */ public function getOccurredAt(): DateTimeImmutable { return $this->occurredAt; diff --git a/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php b/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php index f900d87a..cfd55152 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php @@ -17,8 +17,6 @@ class TestPublisher /** * Publish the integration event. * - * @param TestOutboundEvent $event - * @return void */ public function publish(TestOutboundEvent $event): void { diff --git a/tests/Unit/Infrastructure/Queue/ClosureQueueTest.php b/tests/Unit/Infrastructure/Queue/ClosureQueueTest.php index 5796c840..26b3ec62 100644 --- a/tests/Unit/Infrastructure/Queue/ClosureQueueTest.php +++ b/tests/Unit/Infrastructure/Queue/ClosureQueueTest.php @@ -21,24 +21,15 @@ class ClosureQueueTest extends TestCase { - /** - * @var MockObject&PipeContainer - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; /** * @var array */ private array $actual = []; - /** - * @var ClosureQueue - */ private ClosureQueue $queue; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -51,18 +42,12 @@ function (Command $command): void { ); } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); unset($this->queue, $this->middleware, $this->actual); } - /** - * @return void - */ public function test(): void { $command = $this->createMock(Command::class); @@ -72,9 +57,6 @@ public function test(): void $this->assertSame([$command], $this->actual); } - /** - * @return void - */ public function testWithMiddleware(): void { $command1 = $this->createMock(Command::class); @@ -115,9 +97,6 @@ public function testWithMiddleware(): void } - /** - * @return void - */ public function testWithAlternativeHandlers(): void { $expected = new TestCommand(); diff --git a/tests/Unit/Infrastructure/Queue/ComponentQueueTest.php b/tests/Unit/Infrastructure/Queue/ComponentQueueTest.php index c6b15432..ccdb40e8 100644 --- a/tests/Unit/Infrastructure/Queue/ComponentQueueTest.php +++ b/tests/Unit/Infrastructure/Queue/ComponentQueueTest.php @@ -22,19 +22,10 @@ class ComponentQueueTest extends TestCase { - /** - * @var EnqueuerContainer&MockObject - */ private EnqueuerContainer&MockObject $enqueuers; - /** - * @var MockObject&PipeContainer - */ - private PipeContainer&MockObject $middleware; + private MockObject&PipeContainer $middleware; - /** - * @var ComponentQueue - */ private ComponentQueue $queue; /** @@ -42,9 +33,6 @@ class ComponentQueueTest extends TestCase */ private array $sequence = []; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -55,18 +43,12 @@ protected function setUp(): void ); } - /** - * @return void - */ protected function tearDown(): void { unset($this->queue, $this->enqueuers, $this->middleware, $this->sequence); parent::tearDown(); } - /** - * @return void - */ public function test(): void { $command = $this->createMock(Command::class); @@ -85,9 +67,6 @@ public function test(): void $this->queue->push($command); } - /** - * @return void - */ public function testItQueuesThroughMiddleware(): void { $command1 = $this->createMock(Command::class); diff --git a/tests/Unit/Infrastructure/Queue/EnqueuerContainerTest.php b/tests/Unit/Infrastructure/Queue/EnqueuerContainerTest.php index c9bca870..6226e787 100644 --- a/tests/Unit/Infrastructure/Queue/EnqueuerContainerTest.php +++ b/tests/Unit/Infrastructure/Queue/EnqueuerContainerTest.php @@ -20,9 +20,6 @@ class EnqueuerContainerTest extends TestCase { - /** - * @return void - */ public function test(): void { $command1 = new class () implements Command {}; diff --git a/tests/Unit/Infrastructure/Queue/EnqueuerTest.php b/tests/Unit/Infrastructure/Queue/EnqueuerTest.php index d74f4c97..9b130886 100644 --- a/tests/Unit/Infrastructure/Queue/EnqueuerTest.php +++ b/tests/Unit/Infrastructure/Queue/EnqueuerTest.php @@ -18,9 +18,6 @@ class EnqueuerTest extends TestCase { - /** - * @return void - */ public function test(): void { $command = $this->createMock(Command::class); diff --git a/tests/Unit/Infrastructure/Queue/Middleware/LogPushedToQueueTest.php b/tests/Unit/Infrastructure/Queue/Middleware/LogPushedToQueueTest.php index 19e548bd..bfd0915d 100644 --- a/tests/Unit/Infrastructure/Queue/Middleware/LogPushedToQueueTest.php +++ b/tests/Unit/Infrastructure/Queue/Middleware/LogPushedToQueueTest.php @@ -33,9 +33,6 @@ class LogPushedToQueueTest extends TestCase */ private ContextFactory $context; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -43,18 +40,12 @@ protected function setUp(): void $this->context = $this->createMock(ContextFactory::class); } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); unset($this->logger, $this->context); } - /** - * @return void - */ public function testWithDefaultLevels(): void { $command = new class () implements Command { @@ -88,9 +79,6 @@ function (Command $received) use ($command): void { ], $logs); } - /** - * @return void - */ public function testWithCustomLevels(): void { $command = new class () implements Command { @@ -121,9 +109,6 @@ public function testWithCustomLevels(): void ], $logs); } - /** - * @return void - */ public function testItLogsAfterTheNextClosureIsInvoked(): void { $command = new class () implements Command { @@ -153,7 +138,6 @@ public function testItLogsAfterTheNextClosureIsInvoked(): void } /** - * @param object $expected * @return array */ private function withContext(object $expected): array diff --git a/tests/Unit/Infrastructure/Queue/TestEnqueuer.php b/tests/Unit/Infrastructure/Queue/TestEnqueuer.php index e46135d5..2a5babdb 100644 --- a/tests/Unit/Infrastructure/Queue/TestEnqueuer.php +++ b/tests/Unit/Infrastructure/Queue/TestEnqueuer.php @@ -16,10 +16,6 @@ class TestEnqueuer { - /** - * @param Command $command - * @return void - */ public function push(Command $command): void { // no-op diff --git a/tests/Unit/Toolkit/ContractsTest.php b/tests/Unit/Toolkit/ContractsTest.php index 06eab657..7f905656 100644 --- a/tests/Unit/Toolkit/ContractsTest.php +++ b/tests/Unit/Toolkit/ContractsTest.php @@ -18,9 +18,6 @@ class ContractsTest extends TestCase { - /** - * @return void - */ public function testItDoesNotThrowWhenPreconditionIsTrue(): void { /** @phpstan-ignore-next-line */ @@ -30,9 +27,6 @@ public function testItDoesNotThrowWhenPreconditionIsTrue(): void $this->assertTrue(true); } - /** - * @return void - */ public function testItDoesNotThrowWhenPreconditionIsTrueWithLazyMessage(): void { /** @phpstan-ignore-next-line */ @@ -42,9 +36,6 @@ public function testItDoesNotThrowWhenPreconditionIsTrueWithLazyMessage(): void $this->assertTrue(true); } - /** - * @return void - */ public function testItThrowsWhenPreconditionIsFalse(): void { $this->expectException(ContractException::class); @@ -54,9 +45,6 @@ public function testItThrowsWhenPreconditionIsFalse(): void Contracts::assert(false, $expected); } - /** - * @return void - */ public function testItThrowsWhenPreconditionIsFalseWithLazyMessage(): void { $this->expectException(ContractException::class); diff --git a/tests/Unit/Toolkit/EnumStringTest.php b/tests/Unit/Toolkit/EnumStringTest.php index 85c8e2e8..e595dcf8 100644 --- a/tests/Unit/Toolkit/EnumStringTest.php +++ b/tests/Unit/Toolkit/EnumStringTest.php @@ -24,7 +24,7 @@ class EnumStringTest extends TestCase { /** - * @return array + * @return array */ public static function valueProvider(): array { @@ -49,7 +49,7 @@ public static function valueProvider(): array } #[DataProvider('valueProvider')] - public function testItReturnsScalarValue(UnitEnum|string $value, string $expected): void + public function testItReturnsScalarValue(string|UnitEnum $value, string $expected): void { $this->assertSame($expected, enum_string($value)); } diff --git a/tests/Unit/Toolkit/EnumValueTest.php b/tests/Unit/Toolkit/EnumValueTest.php index b6ad9162..0b705f39 100644 --- a/tests/Unit/Toolkit/EnumValueTest.php +++ b/tests/Unit/Toolkit/EnumValueTest.php @@ -24,7 +24,7 @@ class EnumValueTest extends TestCase { /** - * @return array + * @return array */ public static function valueProvider(): array { @@ -53,7 +53,7 @@ public static function valueProvider(): array } #[DataProvider('valueProvider')] - public function testItReturnsScalarValue(UnitEnum|string|int $value, string|int $expected): void + public function testItReturnsScalarValue(int|string|UnitEnum $value, int|string $expected): void { $this->assertSame($expected, enum_value($value)); } diff --git a/tests/Unit/Toolkit/Identifiers/GuidTest.php b/tests/Unit/Toolkit/Identifiers/GuidTest.php index ce70059a..5cf35801 100644 --- a/tests/Unit/Toolkit/Identifiers/GuidTest.php +++ b/tests/Unit/Toolkit/Identifiers/GuidTest.php @@ -51,13 +51,11 @@ public static function typeProvider(): array } /** - * @param TestUnitEnum|string $type - * @param string $value - * @param TestUnitEnum|string $other - * @return void + * @param string|TestUnitEnum $type + * @param string|TestUnitEnum $other */ #[DataProvider('typeProvider')] - public function testStringId(UnitEnum|string $type, string $value, UnitEnum|string $other): void + public function testStringId(string|UnitEnum $type, string $value, string|UnitEnum $other): void { $guid = Guid::fromString($type, '123'); @@ -79,14 +77,8 @@ public function testStringId(UnitEnum|string $type, string $value, UnitEnum|stri $this->assertFalse($guid->equals(Guid::fromInteger($type, 123))); } - /** - * @param UnitEnum|string $type - * @param string $value - * @param UnitEnum|string $other - * @return void - */ #[DataProvider('typeProvider')] - public function testIntegerId(UnitEnum|string $type, string $value, UnitEnum|string $other): void + public function testIntegerId(string|UnitEnum $type, string $value, string|UnitEnum $other): void { $guid = Guid::fromInteger($type, 123); @@ -107,14 +99,8 @@ public function testIntegerId(UnitEnum|string $type, string $value, UnitEnum|str $this->assertFalse($guid->equals(Guid::fromString($type, '123'))); } - /** - * @param UnitEnum|string $type - * @param string $value - * @param UnitEnum|string $other - * @return void - */ #[DataProvider('typeProvider')] - public function testUuid(UnitEnum|string $type, string $value, UnitEnum|string $other): void + public function testUuid(string|UnitEnum $type, string $value, string|UnitEnum $other): void { $uuid = Uuid::random(); $guid = Guid::fromUuid($type, $uuid->value); @@ -137,7 +123,7 @@ public function testUuid(UnitEnum|string $type, string $value, UnitEnum|string $ } /** - * @return array + * @return array */ public static function makeProvider(): array { @@ -153,65 +139,44 @@ public static function makeProvider(): array } #[DataProvider('makeProvider')] - public function testItMakesGuid(Uuid|UuidInterface|string|int $value, Identifier $expected): void + public function testItMakesGuid(int|string|Uuid|UuidInterface $value, Identifier $expected): void { $guid = Guid::make('SomeType', $value); $this->assertObjectEquals($expected, $guid->id); } - /** - * @return void - */ public function testEmptyType(): void { $this->expectException(ContractException::class); Guid::fromString('', '123'); } - /** - * @return void - */ public function testEmptyStringId(): void { $this->expectException(ContractException::class); Guid::fromString('SomeType', ''); } - /** - * @return void - */ public function testNegativeIntegerId(): void { $this->expectException(ContractException::class); Guid::fromInteger('SomeType', -1); } - /** - * @return void - */ public function testFromInteger(): void { $guid = Guid::fromInteger('SomeType', 1); $this->assertObjectEquals(new IntegerId(1), $guid->id); } - /** - * @return void - */ public function testFromString(): void { $guid = Guid::fromString('SomeType', '1'); $this->assertObjectEquals(new StringId('1'), $guid->id); } - /** - * @param UnitEnum|string $type - * @param string $value - * @param UnitEnum|string $other - * @return void - */ #[DataProvider('typeProvider')] - public function testIsTypeWithMultipleTypes(UnitEnum|string $type, string $value, UnitEnum|string $other): void + public function testIsTypeWithMultipleTypes(string|UnitEnum $type, string $value, string|UnitEnum $other): void { $guid = Guid::fromInteger($type, 1); @@ -220,12 +185,8 @@ public function testIsTypeWithMultipleTypes(UnitEnum|string $type, string $value $this->assertFalse($guid->isType()); } - /** - * @param UnitEnum|string $type - * @return void - */ #[DataProvider('typeProvider')] - public function testAssertTypeDoesNotThrowForExpectedType(UnitEnum|string $type): void + public function testAssertTypeDoesNotThrowForExpectedType(string|UnitEnum $type): void { $guid = Guid::fromInteger($type, 1); @@ -233,18 +194,11 @@ public function testAssertTypeDoesNotThrowForExpectedType(UnitEnum|string $type) $this->assertSame($guid, $actual); } - /** - * @param UnitEnum|string $type - * @param string $value - * @param UnitEnum|string $other - * @param string $otherValue - * @return void - */ #[DataProvider('typeProvider')] public function testAssertTypeDoesThrowForUnexpectedType( - UnitEnum|string $type, + string|UnitEnum $type, string $value, - UnitEnum|string $other, + string|UnitEnum $other, string $otherValue, ): void { $this->expectException(ContractException::class); diff --git a/tests/Unit/Toolkit/Identifiers/IntegerIdTest.php b/tests/Unit/Toolkit/Identifiers/IntegerIdTest.php index 1b71d263..a42a7c84 100644 --- a/tests/Unit/Toolkit/Identifiers/IntegerIdTest.php +++ b/tests/Unit/Toolkit/Identifiers/IntegerIdTest.php @@ -23,9 +23,6 @@ class IntegerIdTest extends TestCase { - /** - * @return void - */ public function test(): void { $id = new IntegerId(99); @@ -41,9 +38,6 @@ public function test(): void ); } - /** - * @return void - */ public function testItMustBeGreaterThanZero(): void { $this->expectException(ContractException::class); @@ -51,9 +45,6 @@ public function testItMustBeGreaterThanZero(): void new IntegerId(0); } - /** - * @return void - */ public function testItIsEquals(): void { $this->assertObjectEquals($id = new IntegerId(99), $other = IntegerId::from(99)); @@ -61,9 +52,6 @@ public function testItIsEquals(): void $this->assertTrue($id->is($other)); } - /** - * @return void - */ public function testItIsNotEqual(): void { $id = new IntegerId(99); @@ -83,10 +71,6 @@ public static function notIntegerIdProvider(): array ]; } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notIntegerIdProvider')] public function testIsWithOtherIdentifiers(Identifier $other): void { @@ -95,9 +79,6 @@ public function testIsWithOtherIdentifiers(Identifier $other): void $this->assertFalse($id->is($other)); } - /** - * @return void - */ public function testIsWithNull(): void { $id = new IntegerId(1); @@ -105,10 +86,6 @@ public function testIsWithNull(): void $this->assertFalse($id->is(null)); } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notIntegerIdProvider')] public function testFromWithOtherIdentifiers(Identifier $other): void { diff --git a/tests/Unit/Toolkit/Identifiers/PossiblyNumericIdTest.php b/tests/Unit/Toolkit/Identifiers/PossiblyNumericIdTest.php index cce959d4..30d0f7a5 100644 --- a/tests/Unit/Toolkit/Identifiers/PossiblyNumericIdTest.php +++ b/tests/Unit/Toolkit/Identifiers/PossiblyNumericIdTest.php @@ -35,13 +35,8 @@ public static function valueProvider(): array ]; } - /** - * @param string|int $value - * @param string|int $expected - * @return void - */ #[DataProvider('valueProvider')] - public function test(string|int $value, string|int $expected): void + public function test(int|string $value, int|string $expected): void { $actual = new PossiblyNumericId($value); $expectedId = is_string($expected) ? new StringId($expected) : new IntegerId($expected); diff --git a/tests/Unit/Toolkit/Identifiers/StringIdTest.php b/tests/Unit/Toolkit/Identifiers/StringIdTest.php index 2b3ec7e8..9564905e 100644 --- a/tests/Unit/Toolkit/Identifiers/StringIdTest.php +++ b/tests/Unit/Toolkit/Identifiers/StringIdTest.php @@ -23,9 +23,6 @@ class StringIdTest extends TestCase { - /** - * @return void - */ public function test(): void { $id = new StringId('99'); @@ -41,18 +38,12 @@ public function test(): void ); } - /** - * @return void - */ public function testItCanBeZero(): void { $id = new StringId('0'); $this->assertSame('0', $id->value); } - /** - * @return void - */ public function testItMustNotBeEmpty(): void { $this->expectException(ContractException::class); @@ -60,9 +51,6 @@ public function testItMustNotBeEmpty(): void new StringId(''); } - /** - * @return void - */ public function testItIsEquals(): void { $this->assertObjectEquals($id = new StringId('99'), $other = StringId::from('99')); @@ -70,9 +58,6 @@ public function testItIsEquals(): void $this->assertTrue($id->is($other)); } - /** - * @return void - */ public function testItIsNotEqual(): void { $id = new StringId('99'); @@ -92,10 +77,6 @@ public static function notStringIdProvider(): array ]; } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notStringIdProvider')] public function testIsWithOtherIdentifiers(Identifier $other): void { @@ -104,9 +85,6 @@ public function testIsWithOtherIdentifiers(Identifier $other): void $this->assertFalse($id->is($other)); } - /** - * @return void - */ public function testIsWithNull(): void { $id = new StringId('1'); @@ -114,10 +92,6 @@ public function testIsWithNull(): void $this->assertFalse($id->is(null)); } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notStringIdProvider')] public function testFromWithOtherIdentifiers(Identifier $other): void { diff --git a/tests/Unit/Toolkit/Identifiers/UuidFactoryTest.php b/tests/Unit/Toolkit/Identifiers/UuidFactoryTest.php index 971c5101..e666b38e 100644 --- a/tests/Unit/Toolkit/Identifiers/UuidFactoryTest.php +++ b/tests/Unit/Toolkit/Identifiers/UuidFactoryTest.php @@ -27,19 +27,10 @@ class UuidFactoryTest extends TestCase { - /** - * @var MockObject&BaseUuidFactory - */ private BaseUuidFactory&MockObject $baseFactory; - /** - * @var UuidFactory - */ private UuidFactory $factory; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); @@ -49,9 +40,6 @@ protected function setUp(): void ); } - /** - * @return void - */ public function testFromWithBaseUuid(): void { $this->baseFactory @@ -64,9 +52,6 @@ public function testFromWithBaseUuid(): void $this->assertSame($base, $uuid->value); } - /** - * @return void - */ public function testFromWithUuid(): void { $this->baseFactory @@ -78,9 +63,6 @@ public function testFromWithUuid(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testFromWithIdentifierInterface(): void { $this->baseFactory @@ -94,9 +76,6 @@ public function testFromWithIdentifierInterface(): void ); } - /** - * @return void - */ public function testFromBytes(): void { $this->baseFactory @@ -111,9 +90,6 @@ public function testFromBytes(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testFromDateTime(): void { $this->baseFactory @@ -132,9 +108,6 @@ public function testFromDateTime(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testFromInteger(): void { $this->baseFactory @@ -149,9 +122,6 @@ public function testFromInteger(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testFromString(): void { $this->baseFactory @@ -166,9 +136,6 @@ public function testFromString(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid1(): void { $this->baseFactory @@ -186,9 +153,6 @@ public function testUuid1(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid2(): void { $this->baseFactory @@ -208,9 +172,6 @@ public function testUuid2(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid3(): void { $this->baseFactory @@ -228,9 +189,6 @@ public function testUuid3(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid4(): void { $this->baseFactory @@ -244,9 +202,6 @@ public function testUuid4(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid5(): void { $this->baseFactory @@ -264,9 +219,6 @@ public function testUuid5(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid6(): void { $this->baseFactory @@ -284,9 +236,6 @@ public function testUuid6(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid7(): void { $date = new \DateTimeImmutable(); @@ -303,9 +252,6 @@ public function testUuid7(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid7NotSupported(): void { $factory = new UuidFactory( @@ -318,9 +264,6 @@ public function testUuid7NotSupported(): void $factory->uuid7(); } - /** - * @return void - */ public function testUuid8(): void { $bytes = 'blah!'; @@ -337,9 +280,6 @@ public function testUuid8(): void $this->assertSame($uuid->value, $base); } - /** - * @return void - */ public function testUuid8NotSupported(): void { $factory = new UuidFactory( diff --git a/tests/Unit/Toolkit/Identifiers/UuidTest.php b/tests/Unit/Toolkit/Identifiers/UuidTest.php index 743a553c..47d13655 100644 --- a/tests/Unit/Toolkit/Identifiers/UuidTest.php +++ b/tests/Unit/Toolkit/Identifiers/UuidTest.php @@ -25,18 +25,12 @@ class UuidTest extends TestCase { - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); Uuid::setFactory(null); } - /** - * @return void - */ public function test(): void { $base = RamseyUuid::uuid4(); @@ -54,9 +48,6 @@ public function test(): void ); } - /** - * @return void - */ public function testItIsEquals(): void { $base = RamseyUuid::uuid4(); @@ -66,9 +57,6 @@ public function testItIsEquals(): void $this->assertTrue($id->is($other)); } - /** - * @return void - */ public function testItIsNotEqual(): void { $id = new Uuid(RamseyUuid::fromString('6dcbad65-ed92-4e60-973b-9ba58a022816')); @@ -90,10 +78,6 @@ public static function notUuidProvider(): array ]; } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notUuidProvider')] public function testIsWithOtherIdentifiers(Identifier $other): void { @@ -102,9 +86,6 @@ public function testIsWithOtherIdentifiers(Identifier $other): void $this->assertFalse($id->is($other)); } - /** - * @return void - */ public function testIsWithNull(): void { $id = new Uuid(RamseyUuid::uuid4()); @@ -112,10 +93,6 @@ public function testIsWithNull(): void $this->assertFalse($id->is(null)); } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notUuidProvider')] public function testFromWithOtherIdentifiers(Identifier $other): void { @@ -124,19 +101,12 @@ public function testFromWithOtherIdentifiers(Identifier $other): void Uuid::from($other); } - /** - * @param Identifier $other - * @return void - */ #[DataProvider('notUuidProvider')] public function testTryFromWithOtherIdentifiers(Identifier $other): void { $this->assertNull(Uuid::tryFrom($other)); } - /** - * @return void - */ public function testFromWithString(): void { Uuid::setFactory($factory = $this->createMock(UuidFactory::class)); @@ -150,9 +120,6 @@ public function testFromWithString(): void $this->assertSame($expected, Uuid::from($str)); } - /** - * @return void - */ public function testTryFromWithString(): void { Uuid::setFactory($factory = $this->createMock(UuidFactory::class)); @@ -167,9 +134,6 @@ public function testTryFromWithString(): void $this->assertNull(Uuid::tryFrom('invalid')); } - /** - * @return void - */ public function testFromAndTryFromWithBaseUuid(): void { Uuid::setFactory($factory = $this->createMock(UuidFactory::class)); @@ -184,9 +148,6 @@ public function testFromAndTryFromWithBaseUuid(): void $this->assertSame($expected, Uuid::tryFrom($base)); } - /** - * @return void - */ public function testTryFromWithNull(): void { Uuid::setFactory($factory = $this->createMock(UuidFactory::class)); @@ -198,9 +159,6 @@ public function testTryFromWithNull(): void $this->assertNull(Uuid::tryFrom(null)); } - /** - * @return void - */ public function testNil(): void { $base = RamseyUuid::fromString(RamseyUuid::NIL); diff --git a/tests/Unit/Toolkit/Iterables/IsLazyListTest.php b/tests/Unit/Toolkit/Iterables/IsLazyListTest.php index 0b3e434c..9a72184b 100644 --- a/tests/Unit/Toolkit/Iterables/IsLazyListTest.php +++ b/tests/Unit/Toolkit/Iterables/IsLazyListTest.php @@ -18,9 +18,6 @@ class IsLazyListTest extends TestCase { - /** - * @return void - */ public function testItIteratesOverList(): void { $expected = ['one', 'two', 'three']; @@ -43,9 +40,6 @@ public function __construct(string ...$values) $this->assertSame($expected, $list->all()); } - /** - * @return void - */ public function testItYieldsListFromKeyedSet(): void { $expected = ['one' => 'foo', 'two' => 'bar', 'three' => 'baz']; diff --git a/tests/Unit/Toolkit/Iterables/IsNonEmptyListTest.php b/tests/Unit/Toolkit/Iterables/IsNonEmptyListTest.php index c24c51c0..3b3eab12 100644 --- a/tests/Unit/Toolkit/Iterables/IsNonEmptyListTest.php +++ b/tests/Unit/Toolkit/Iterables/IsNonEmptyListTest.php @@ -18,9 +18,6 @@ class IsNonEmptyListTest extends TestCase { - /** - * @return void - */ public function test(): void { $expected = ['one', 'two', 'three']; diff --git a/tests/Unit/Toolkit/Loggable/ObjectDecoratorTest.php b/tests/Unit/Toolkit/Loggable/ObjectDecoratorTest.php index 4989b607..316432bf 100644 --- a/tests/Unit/Toolkit/Loggable/ObjectDecoratorTest.php +++ b/tests/Unit/Toolkit/Loggable/ObjectDecoratorTest.php @@ -21,32 +21,20 @@ class ObjectDecoratorTest extends TestCase { - /** - * @var SimpleContextFactory - */ private SimpleContextFactory $factory; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); $this->factory = new SimpleContextFactory(); } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); unset($this->factory); } - /** - * @return void - */ public function testItUsesObjectProperties(): void { $source = new class () implements Message { @@ -72,9 +60,6 @@ public function testItUsesObjectProperties(): void $this->assertSame($expected, $this->factory->make($source)); } - /** - * @return void - */ public function testItExcludesSensitiveProperties(): void { $source = new class ('Hello', 'World') implements Message { diff --git a/tests/Unit/Toolkit/Loggable/ResultDecoratorTest.php b/tests/Unit/Toolkit/Loggable/ResultDecoratorTest.php index d6dfc2bb..cdae5488 100644 --- a/tests/Unit/Toolkit/Loggable/ResultDecoratorTest.php +++ b/tests/Unit/Toolkit/Loggable/ResultDecoratorTest.php @@ -42,32 +42,20 @@ interface ErrorWithContext extends IError, ContextProvider class ResultDecoratorTest extends TestCase { - /** - * @var SimpleContextFactory - */ private SimpleContextFactory $factory; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); $this->factory = new SimpleContextFactory(); } - /** - * @return void - */ protected function tearDown(): void { parent::tearDown(); unset($this->factory); } - /** - * @return void - */ public function testSuccess(): void { $result = Result::ok(); @@ -83,9 +71,6 @@ public function testSuccess(): void $this->assertSame($expected, $this->factory->make($result)); } - /** - * @return void - */ public function testSuccessWithContextProvider(): void { $expected = [ @@ -105,9 +90,6 @@ public function testSuccessWithContextProvider(): void $this->assertSame($expected, $this->factory->make($result)); } - /** - * @return void - */ public function testSuccessWithIdentifier(): void { $expected = [ @@ -138,10 +120,6 @@ public static function scalarProvider(): array ]; } - /** - * @param mixed $value - * @return void - */ #[DataProvider('scalarProvider')] public function testSuccessWithScalarOrNull(mixed $value): void { @@ -156,9 +134,6 @@ public function testSuccessWithScalarOrNull(mixed $value): void $this->assertSame($expected, $this->factory->make($result)); } - /** - * @return void - */ public function testSuccessContextWithMeta(): void { $result = Result::ok()->withMeta(['foo' => 'bar']); @@ -175,7 +150,7 @@ public function testSuccessContextWithMeta(): void } /** - * @return array> + * @return array> */ public static function onlyMessageProvider(): array { @@ -185,12 +160,8 @@ public static function onlyMessageProvider(): array ]; } - /** - * @param string|Error $error - * @return void - */ #[DataProvider('onlyMessageProvider')] - public function testFailureContextWithErrorThatOnlyHasMessage(string|Error $error): void + public function testFailureContextWithErrorThatOnlyHasMessage(Error|string $error): void { $result = Result::failed($error); @@ -204,7 +175,7 @@ public function testFailureContextWithErrorThatOnlyHasMessage(string|Error $erro } /** - * @return array> + * @return array> */ public static function onlyCodeProvider(): array { @@ -216,10 +187,9 @@ public static function onlyCodeProvider(): array /** * @param BackedEnum|Error $error - * @return void */ #[DataProvider('onlyCodeProvider')] - public function testFailureContextWithErrorThatOnlyHasCode(UnitEnum|Error $error): void + public function testFailureContextWithErrorThatOnlyHasCode(Error|UnitEnum $error): void { $result = Result::failed($error); $code = $error instanceof UnitEnum ? $error : $error->code(); @@ -271,7 +241,6 @@ public static function errorsProvider(): array /** * @param array $errors * @param array> $expected - * @return void */ #[DataProvider('errorsProvider')] public function testFailureContextWithMeta(array $errors, array $expected): void @@ -290,9 +259,6 @@ public function testFailureContextWithMeta(array $errors, array $expected): void $this->assertSame($expected, $this->factory->make($result)); } - /** - * @return void - */ public function testItHasLogContext(): void { $mock = $this->createMock(ResultWithContext::class); @@ -302,9 +268,6 @@ public function testItHasLogContext(): void $this->assertSame($expected, $this->factory->make($mock)); } - /** - * @return void - */ public function testItHasErrorWithLogContext(): void { $mock = $this->createMock(ErrorWithContext::class); diff --git a/tests/Unit/Toolkit/ModuleBasenameTest.php b/tests/Unit/Toolkit/ModuleBasenameTest.php index 4ced5c05..5b2a510e 100644 --- a/tests/Unit/Toolkit/ModuleBasenameTest.php +++ b/tests/Unit/Toolkit/ModuleBasenameTest.php @@ -123,12 +123,6 @@ public static function withoutModuleProvider(): array ]; } - /** - * @param string $value - * @param string $context - * @param string $message - * @return void - */ #[DataProvider('moduleProvider')] public function testFromModule(string $value, string $context, string $message): void { @@ -142,11 +136,6 @@ public function testFromModule(string $value, string $context, string $message): $this->assertSame("{$context}:{$message}", (string) $name); } - /** - * @param string $value - * @param string $message - * @return void - */ #[DataProvider('withoutModuleProvider')] public function testFromWithoutModule(string $value, string $message): void { @@ -160,9 +149,6 @@ public function testFromWithoutModule(string $value, string $message): void $this->assertSame($message, (string) $name); } - /** - * @return ModuleBasename - */ public function testToArray(): ModuleBasename { $value = ModuleBasename::from( @@ -188,9 +174,6 @@ public function testJsonSerialize(ModuleBasename $value): void $this->assertJsonStringEqualsJsonString($expected, json_encode($value, JSON_THROW_ON_ERROR)); } - /** - * @return void - */ public function testTryFromWithInvalid(): void { $name = ModuleBasename::tryFrom(ModuleBasename::class); @@ -198,9 +181,6 @@ public function testTryFromWithInvalid(): void $this->assertNull($name); } - /** - * @return void - */ public function testFromWithInvalid(): void { $this->expectException(\UnexpectedValueException::class); diff --git a/tests/Unit/Toolkit/Pipeline/InterruptibleProcessorTest.php b/tests/Unit/Toolkit/Pipeline/InterruptibleProcessorTest.php index eac4f1a0..2272a13d 100644 --- a/tests/Unit/Toolkit/Pipeline/InterruptibleProcessorTest.php +++ b/tests/Unit/Toolkit/Pipeline/InterruptibleProcessorTest.php @@ -20,7 +20,7 @@ class InterruptibleProcessorTest extends TestCase public function test(): void { $processor = new InterruptibleProcessor( - static fn (int|float $value): bool => 0 === (intval($value) % 10), + static fn (float|int $value): bool => 0 === (intval($value) % 10), ); $a = static fn (int $value): int => $value * 10; diff --git a/tests/Unit/Toolkit/Pipeline/LazyPipeTest.php b/tests/Unit/Toolkit/Pipeline/LazyPipeTest.php index e2711844..febcd370 100644 --- a/tests/Unit/Toolkit/Pipeline/LazyPipeTest.php +++ b/tests/Unit/Toolkit/Pipeline/LazyPipeTest.php @@ -21,22 +21,16 @@ class LazyPipeTest extends TestCase { /** - * @var PipeContainer&MockObject + * @var MockObject&PipeContainer */ private PipeContainer $container; - /** - * @return void - */ protected function setUp(): void { parent::setUp(); $this->container = $this->createMock(PipeContainer::class); } - /** - * @return void - */ public function test(): void { $this->container @@ -57,9 +51,6 @@ public function test(): void $this->assertSame($expected, $actual); } - /** - * @return void - */ public function testItRethrowsException(): void { $this->container diff --git a/tests/Unit/Toolkit/Pipeline/MiddlewareProcessorTest.php b/tests/Unit/Toolkit/Pipeline/MiddlewareProcessorTest.php index 0e7f8308..5807c7c0 100644 --- a/tests/Unit/Toolkit/Pipeline/MiddlewareProcessorTest.php +++ b/tests/Unit/Toolkit/Pipeline/MiddlewareProcessorTest.php @@ -71,10 +71,6 @@ public function testNoStagesWithDestination(): void $this->assertSame('FOO', $result); } - /** - * @param string $step - * @return Closure - */ private function createMiddleware(string $step): Closure { return static function (array $values, Closure $next) use ($step) { diff --git a/tests/Unit/Toolkit/Pipeline/PipeContainerTest.php b/tests/Unit/Toolkit/Pipeline/PipeContainerTest.php index 2a7b8698..d2ca32a0 100644 --- a/tests/Unit/Toolkit/Pipeline/PipeContainerTest.php +++ b/tests/Unit/Toolkit/Pipeline/PipeContainerTest.php @@ -17,9 +17,6 @@ class PipeContainerTest extends TestCase { - /** - * @return void - */ public function test(): void { $a = fn () => 1; diff --git a/tests/Unit/Toolkit/Pipeline/PipelineBuilderTest.php b/tests/Unit/Toolkit/Pipeline/PipelineBuilderTest.php index 74828f65..611164b0 100644 --- a/tests/Unit/Toolkit/Pipeline/PipelineBuilderTest.php +++ b/tests/Unit/Toolkit/Pipeline/PipelineBuilderTest.php @@ -21,9 +21,6 @@ class PipelineBuilderTest extends TestCase { - /** - * @return void - */ public function test(): void { $expected = new Pipeline( @@ -39,9 +36,6 @@ public function test(): void $this->assertEquals($expected, $actual); } - /** - * @return void - */ public function testServiceString(): void { $container = $this->createMock(PipeContainer::class); @@ -60,9 +54,6 @@ public function testServiceString(): void $this->assertEquals($expected, $actual); } - /** - * @return void - */ public function testServiceStringWithoutContainer(): void { $processor = $this->createMock(Processor::class); diff --git a/tests/Unit/Toolkit/Result/FailedResultExceptionTest.php b/tests/Unit/Toolkit/Result/FailedResultExceptionTest.php index f1d9cf0c..8a209351 100644 --- a/tests/Unit/Toolkit/Result/FailedResultExceptionTest.php +++ b/tests/Unit/Toolkit/Result/FailedResultExceptionTest.php @@ -20,9 +20,6 @@ class FailedResultExceptionTest extends TestCase { - /** - * @return void - */ public function test(): void { $result = Result::failed('Something went wrong.') @@ -36,9 +33,6 @@ public function test(): void $this->assertSame((new ResultDecorator($result))->context(), $exception->context()); } - /** - * @return void - */ public function testItHasCodeAndPreviousException(): void { $result = Result::failed('Something went wrong.'); diff --git a/tests/Unit/Toolkit/Result/KeyedSetOfErrorsTest.php b/tests/Unit/Toolkit/Result/KeyedSetOfErrorsTest.php index 0d5f8337..332484a6 100644 --- a/tests/Unit/Toolkit/Result/KeyedSetOfErrorsTest.php +++ b/tests/Unit/Toolkit/Result/KeyedSetOfErrorsTest.php @@ -20,9 +20,6 @@ class KeyedSetOfErrorsTest extends TestCase { - /** - * @return void - */ public function test(): void { $errors = new KeyedSetOfErrors( @@ -55,9 +52,6 @@ public function test(): void $this->assertEquals($expected[TestUnitEnum::Baz->name], $errors->get(TestUnitEnum::Baz)); } - /** - * @return void - */ public function testEmpty(): void { $errors = new KeyedSetOfErrors(); @@ -67,9 +61,6 @@ public function testEmpty(): void $this->assertCount(0, $errors); } - /** - * @return void - */ public function testPutNewKey(): void { $original = new KeyedSetOfErrors( @@ -93,9 +84,6 @@ public function testPutNewKey(): void $this->assertSame(['bar', 'baz', 'foo'], $actual->keys()); } - /** - * @return void - */ public function testPutExistingKey(): void { $original = new KeyedSetOfErrors( @@ -118,9 +106,6 @@ public function testPutExistingKey(): void $this->assertSame(['bar', 'foo'], $actual->keys()); } - /** - * @return void - */ public function testPutErrorWithoutKey1(): void { $original = new KeyedSetOfErrors( @@ -144,9 +129,6 @@ public function testPutErrorWithoutKey1(): void $this->assertSame(['_base', 'bar', 'foo'], $actual->keys()); } - /** - * @return void - */ public function testPutErrorWithoutKey2(): void { $original = new KeyedSetOfErrors( @@ -169,9 +151,6 @@ public function testPutErrorWithoutKey2(): void $this->assertSame(['_base', 'foo'], $actual->keys()); } - /** - * @return void - */ public function testMerge(): void { $set1 = new KeyedSetOfErrors( diff --git a/tests/Unit/Toolkit/Result/ListOfErrorsTest.php b/tests/Unit/Toolkit/Result/ListOfErrorsTest.php index b5da8588..b52e8378 100644 --- a/tests/Unit/Toolkit/Result/ListOfErrorsTest.php +++ b/tests/Unit/Toolkit/Result/ListOfErrorsTest.php @@ -23,9 +23,6 @@ class ListOfErrorsTest extends TestCase { - /** - * @return void - */ public function test(): void { $errors = new ListOfErrors( @@ -42,9 +39,6 @@ public function test(): void $this->assertFalse($errors->isEmpty()); } - /** - * @return void - */ public function testEmpty(): void { $errors = new ListOfErrors(); @@ -56,9 +50,6 @@ public function testEmpty(): void $this->assertEmpty($errors->codes()); } - /** - * @return void - */ public function testPush(): void { $original = new ListOfErrors( @@ -73,9 +64,6 @@ public function testPush(): void $this->assertSame([$a, $b, $c], $actual->all()); } - /** - * @return void - */ public function testMerge(): void { $stack1 = new ListOfErrors( @@ -97,9 +85,6 @@ public function testMerge(): void $this->assertSame([$a, $b, $c, $d], $actual->all()); } - /** - * @return void - */ public function testFirst(): void { $errors = new ListOfErrors( @@ -117,9 +102,6 @@ public function testFirst(): void $this->assertNull($errors->first(TestUnitEnum::Baz)); } - /** - * @return void - */ public function testContains(): void { $errors = new ListOfErrors( diff --git a/tests/Unit/Toolkit/Result/MetaTest.php b/tests/Unit/Toolkit/Result/MetaTest.php index 06108d09..65206986 100644 --- a/tests/Unit/Toolkit/Result/MetaTest.php +++ b/tests/Unit/Toolkit/Result/MetaTest.php @@ -17,9 +17,6 @@ class MetaTest extends TestCase { - /** - * @return void - */ public function test(): void { $meta = new Meta($values = [ @@ -40,9 +37,6 @@ public function test(): void $this->assertFalse($meta->isEmpty()); } - /** - * @return void - */ public function testItIsIterable(): void { $meta = new Meta($values = [ @@ -54,9 +48,6 @@ public function testItIsIterable(): void $this->assertSame($values, iterator_to_array($meta)); } - /** - * @return void - */ public function testEmpty(): void { $meta = new Meta(); @@ -66,9 +57,6 @@ public function testEmpty(): void $this->assertFalse($meta->isNotEmpty()); } - /** - * @return void - */ public function testArrayAccess(): void { $meta = new Meta(['foo' => 'bar', 'baz' => 'bat', 'foobar' => null]); @@ -79,9 +67,6 @@ public function testArrayAccess(): void $this->assertFalse(isset($meta['blah'])); } - /** - * @return void - */ public function testOffsetUnset(): void { $meta = new Meta(['foo' => 'bar']); @@ -90,9 +75,6 @@ public function testOffsetUnset(): void unset($meta['foo']); } - /** - * @return void - */ public function testOffsetSet(): void { $meta = new Meta(['foo' => 'bar']); @@ -101,9 +83,6 @@ public function testOffsetSet(): void $meta['foo'] = 'foobar'; } - /** - * @return void - */ public function testPut(): void { $original = new Meta(['foo' => 'bar', 'baz' => 'bat']); @@ -114,9 +93,6 @@ public function testPut(): void $this->assertSame(['foo' => 'foobar', 'baz' => 'bat'], $actual->all()); } - /** - * @return void - */ public function testMergeArray(): void { $original = new Meta(['foo' => 'bar', 'baz' => 'bat']); @@ -127,9 +103,6 @@ public function testMergeArray(): void $this->assertSame(['foo' => null, 'baz' => 'bat', 'foobar' => 'bazbat'], $actual->all()); } - /** - * @return void - */ public function testMergeMeta(): void { $original = new Meta(['foo' => 'bar', 'baz' => 'bat']); diff --git a/tests/Unit/Toolkit/Result/ResultTest.php b/tests/Unit/Toolkit/Result/ResultTest.php index 95e27e74..5e8cb65a 100644 --- a/tests/Unit/Toolkit/Result/ResultTest.php +++ b/tests/Unit/Toolkit/Result/ResultTest.php @@ -26,9 +26,6 @@ class ResultTest extends TestCase { - /** - * @return void - */ public function testOk(): void { $result = Result::ok(); @@ -44,9 +41,6 @@ public function testOk(): void $this->assertNull($result->error()); } - /** - * @return void - */ public function testOkWithValue(): void { $result = Result::ok($value = 99); @@ -81,7 +75,6 @@ public function testFailed(): Result /** * @param Result $result - * @return void */ #[Depends('testFailed')] public function testAbort(Result $result): void @@ -94,9 +87,6 @@ public function testAbort(Result $result): void } } - /** - * @return void - */ public function testErrorWithMultipleErrors(): void { $errors = new ListOfErrors( @@ -113,7 +103,6 @@ public function testErrorWithMultipleErrors(): void /** * @param Result $result - * @return void */ #[Depends('testFailed')] public function testItThrowsWhenGettingValueOnFailedResult(Result $result): void @@ -126,9 +115,6 @@ public function testItThrowsWhenGettingValueOnFailedResult(Result $result): void } } - /** - * @return void - */ public function testFailedWithListOfErrorsInterface(): void { $errors = $this->createMock(IListOfErrors::class); @@ -141,9 +127,6 @@ public function testFailedWithListOfErrorsInterface(): void $this->assertEquals($result, Result::fail($errors)); } - /** - * @return void - */ public function testFailedWithError(): void { $error = new Error(null, 'Something went wrong.'); @@ -153,9 +136,6 @@ public function testFailedWithError(): void $this->assertEquals($result, Result::fail($error)); } - /** - * @return void - */ public function testFailedWithString(): void { $error = new Error(null, 'Something went wrong.'); @@ -165,9 +145,6 @@ public function testFailedWithString(): void $this->assertEquals($result, Result::fail($error->message())); } - /** - * @return void - */ public function testFailedWithArray(): void { $error = new Error(null, 'Something went wrong.'); @@ -177,9 +154,6 @@ public function testFailedWithArray(): void $this->assertEquals($result, Result::fail([$error])); } - /** - * @return void - */ public function testFailedWithBackedEnum(): void { $error = new Error(code: $code = TestBackedEnum::Foo); @@ -189,27 +163,18 @@ public function testFailedWithBackedEnum(): void $this->assertEquals($result, Result::fail($code)); } - /** - * @return void - */ public function testFailedWithoutErrors(): void { $this->expectException(\AssertionError::class); Result::failed(new ListOfErrors()); } - /** - * @return void - */ public function testFailWithoutErrors(): void { $this->expectException(\AssertionError::class); Result::fail(new ListOfErrors()); } - /** - * @return void - */ public function testWithMeta(): void { $meta = new Meta(['foo' => 'bar']); @@ -218,9 +183,6 @@ public function testWithMeta(): void $this->assertEquals($meta, $result->meta()); } - /** - * @return void - */ public function testWithMetaArray(): void { $meta = new Meta(['foo' => 'bar']); @@ -229,9 +191,6 @@ public function testWithMetaArray(): void $this->assertEquals($meta, $result->meta()); } - /** - * @return void - */ public function testWithMetaMergesValues(): void { $result1 = Result::ok() From 9bbe8aed2c0459e3cb3bdb79a27ffac09292992c Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 10 Sep 2025 14:34:31 +0100 Subject: [PATCH 2/4] style: remove constructor docblocks --- src/Application/Bus/CommandDispatcher.php | 4 ---- src/Application/Bus/CommandHandler.php | 4 ---- src/Application/Bus/CommandQueuer.php | 4 ---- src/Application/Bus/Middleware/ExecuteInUnitOfWork.php | 4 ---- src/Application/Bus/Middleware/FlushDeferredEvents.php | 4 ---- src/Application/Bus/Middleware/LogMessageDispatch.php | 4 ---- src/Application/Bus/Middleware/SetupBeforeDispatch.php | 2 -- src/Application/Bus/Middleware/TearDownAfterDispatch.php | 2 -- src/Application/Bus/Middleware/ValidateCommand.php | 4 ---- src/Application/Bus/Middleware/ValidateQuery.php | 4 ---- src/Application/Bus/QueryDispatcher.php | 4 ---- src/Application/Bus/QueryHandler.php | 4 ---- src/Application/Bus/Validator.php | 4 ---- src/Application/DomainEventDispatching/Dispatcher.php | 4 ---- src/Application/DomainEventDispatching/EventHandler.php | 4 ---- .../Middleware/LogDomainEventDispatch.php | 4 ---- .../DomainEventDispatching/UnitOfWorkAwareDispatcher.php | 4 ---- src/Application/InboundEventBus/EventHandler.php | 4 ---- src/Application/InboundEventBus/EventHandlerContainer.php | 2 -- .../InboundEventBus/InboundEventDispatcher.php | 4 ---- .../InboundEventBus/Middleware/FlushDeferredEvents.php | 4 ---- .../InboundEventBus/Middleware/HandleInUnitOfWork.php | 4 ---- .../InboundEventBus/Middleware/LogInboundEvent.php | 4 ---- .../InboundEventBus/Middleware/SetupBeforeEvent.php | 2 -- .../InboundEventBus/Middleware/TearDownAfterEvent.php | 2 -- src/Application/InboundEventBus/SwallowInboundEvent.php | 4 ---- src/Application/UnitOfWork/UnitOfWorkManager.php | 4 ---- src/Domain/IdentifierOrEntity.php | 4 ---- .../ExceptionReporter/PsrLogExceptionReporter.php | 4 ---- src/Infrastructure/OutboundEventBus/ClosurePublisher.php | 4 ---- .../OutboundEventBus/ComponentPublisher.php | 4 ---- .../OutboundEventBus/Middleware/LogOutboundEvent.php | 4 ---- src/Infrastructure/OutboundEventBus/PublisherHandler.php | 4 ---- .../OutboundEventBus/PublisherHandlerContainer.php | 4 ---- src/Infrastructure/Queue/ClosureQueue.php | 4 ---- src/Infrastructure/Queue/ComponentQueue.php | 4 ---- src/Infrastructure/Queue/Enqueuer.php | 4 ---- src/Infrastructure/Queue/EnqueuerContainer.php | 2 -- src/Infrastructure/Queue/Middleware/LogPushedToQueue.php | 4 ---- src/Testing/FakeUnitOfWork.php | 4 ---- src/Toolkit/Contracts.php | 3 --- src/Toolkit/Identifiers/Guid.php | 4 ---- src/Toolkit/Identifiers/GuidTypeMap.php | 2 -- src/Toolkit/Identifiers/IntegerId.php | 4 ---- src/Toolkit/Identifiers/PossiblyNumericId.php | 4 ---- src/Toolkit/Identifiers/StringId.php | 4 ---- src/Toolkit/Identifiers/Uuid.php | 4 ---- src/Toolkit/Identifiers/UuidFactory.php | 4 ---- src/Toolkit/Loggable/ObjectDecorator.php | 4 ---- src/Toolkit/Loggable/ResultDecorator.php | 2 -- src/Toolkit/ModuleBasename.php | 4 ---- src/Toolkit/Pipeline/InterruptibleProcessor.php | 4 ---- src/Toolkit/Pipeline/LazyPipe.php | 4 ---- src/Toolkit/Pipeline/MiddlewareProcessor.php | 4 ---- src/Toolkit/Pipeline/Pipeline.php | 2 -- src/Toolkit/Pipeline/PipelineBuilder.php | 8 -------- src/Toolkit/Result/Error.php | 4 ---- src/Toolkit/Result/FailedResultException.php | 2 -- src/Toolkit/Result/KeyedSetOfErrors.php | 4 ---- src/Toolkit/Result/Meta.php | 2 -- src/Toolkit/Result/Result.php | 2 -- 61 files changed, 223 deletions(-) diff --git a/src/Application/Bus/CommandDispatcher.php b/src/Application/Bus/CommandDispatcher.php index b93bf41e..2a338201 100644 --- a/src/Application/Bus/CommandDispatcher.php +++ b/src/Application/Bus/CommandDispatcher.php @@ -27,10 +27,6 @@ class CommandDispatcher implements ICommandDispatcher */ private array $pipes = []; - /** - * CommandDispatcher constructor. - * - */ public function __construct( private readonly CommandHandlerContainer $handlers, private readonly ?PipeContainer $middleware = null, diff --git a/src/Application/Bus/CommandHandler.php b/src/Application/Bus/CommandHandler.php index ac48a21c..5ce85a62 100644 --- a/src/Application/Bus/CommandHandler.php +++ b/src/Application/Bus/CommandHandler.php @@ -19,10 +19,6 @@ final readonly class CommandHandler implements ICommandHandler { - /** - * CommandHandler constructor. - * - */ public function __construct(private object $handler) { } diff --git a/src/Application/Bus/CommandQueuer.php b/src/Application/Bus/CommandQueuer.php index c036e125..37785639 100644 --- a/src/Application/Bus/CommandQueuer.php +++ b/src/Application/Bus/CommandQueuer.php @@ -18,10 +18,6 @@ class CommandQueuer implements ICommandQueuer { - /** - * CommandQueuer constructor. - * - */ public function __construct(private readonly Queue $queue) { } diff --git a/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php b/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php index f8630976..b02913bd 100644 --- a/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php +++ b/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php @@ -21,10 +21,6 @@ final readonly class ExecuteInUnitOfWork implements CommandMiddleware { - /** - * ExecuteInUnitOfWork constructor. - * - */ public function __construct( private UnitOfWorkManager $unitOfWorkManager, private int $attempts = 1, diff --git a/src/Application/Bus/Middleware/FlushDeferredEvents.php b/src/Application/Bus/Middleware/FlushDeferredEvents.php index 50fd6759..1167581b 100644 --- a/src/Application/Bus/Middleware/FlushDeferredEvents.php +++ b/src/Application/Bus/Middleware/FlushDeferredEvents.php @@ -21,10 +21,6 @@ final readonly class FlushDeferredEvents implements CommandMiddleware { - /** - * FlushDeferredEvents constructor. - * - */ public function __construct(private DeferredDispatcher $dispatcher) { } diff --git a/src/Application/Bus/Middleware/LogMessageDispatch.php b/src/Application/Bus/Middleware/LogMessageDispatch.php index 7c38f20e..2eb80127 100644 --- a/src/Application/Bus/Middleware/LogMessageDispatch.php +++ b/src/Application/Bus/Middleware/LogMessageDispatch.php @@ -25,10 +25,6 @@ final readonly class LogMessageDispatch implements BusMiddleware { - /** - * LogMessageDispatch constructor. - * - */ public function __construct( private LoggerInterface $logger, private string $dispatchLevel = LogLevel::DEBUG, diff --git a/src/Application/Bus/Middleware/SetupBeforeDispatch.php b/src/Application/Bus/Middleware/SetupBeforeDispatch.php index 4c059568..544a1b74 100644 --- a/src/Application/Bus/Middleware/SetupBeforeDispatch.php +++ b/src/Application/Bus/Middleware/SetupBeforeDispatch.php @@ -21,8 +21,6 @@ final readonly class SetupBeforeDispatch implements BusMiddleware { /** - * SetupBeforeDispatch constructor. - * * @param Closure(): ?Closure(): void $callback */ public function __construct(private Closure $callback) diff --git a/src/Application/Bus/Middleware/TearDownAfterDispatch.php b/src/Application/Bus/Middleware/TearDownAfterDispatch.php index b860c68e..2eff109c 100644 --- a/src/Application/Bus/Middleware/TearDownAfterDispatch.php +++ b/src/Application/Bus/Middleware/TearDownAfterDispatch.php @@ -21,8 +21,6 @@ final readonly class TearDownAfterDispatch implements BusMiddleware { /** - * TearDownAfterDispatch constructor. - * * @param Closure(): void $callback */ public function __construct(private Closure $callback) diff --git a/src/Application/Bus/Middleware/ValidateCommand.php b/src/Application/Bus/Middleware/ValidateCommand.php index fe96c7b0..891951ec 100644 --- a/src/Application/Bus/Middleware/ValidateCommand.php +++ b/src/Application/Bus/Middleware/ValidateCommand.php @@ -28,10 +28,6 @@ abstract class ValidateCommand implements CommandMiddleware */ abstract protected function rules(): iterable; - /** - * ValidateCommand constructor. - * - */ public function __construct(private readonly Validator $validator) { } diff --git a/src/Application/Bus/Middleware/ValidateQuery.php b/src/Application/Bus/Middleware/ValidateQuery.php index 78f8185f..b2979868 100644 --- a/src/Application/Bus/Middleware/ValidateQuery.php +++ b/src/Application/Bus/Middleware/ValidateQuery.php @@ -28,10 +28,6 @@ abstract class ValidateQuery implements QueryMiddleware */ abstract protected function rules(): iterable; - /** - * ValidateQuery constructor. - * - */ public function __construct(private readonly Validator $validator) { } diff --git a/src/Application/Bus/QueryDispatcher.php b/src/Application/Bus/QueryDispatcher.php index 862b0912..a19ec4d4 100644 --- a/src/Application/Bus/QueryDispatcher.php +++ b/src/Application/Bus/QueryDispatcher.php @@ -27,10 +27,6 @@ class QueryDispatcher implements IQueryDispatcher */ private array $pipes = []; - /** - * QueryDispatcher constructor. - * - */ public function __construct( private readonly QueryHandlerContainer $handlers, private readonly ?PipeContainer $middleware = null, diff --git a/src/Application/Bus/QueryHandler.php b/src/Application/Bus/QueryHandler.php index 748a3841..8b4470ce 100644 --- a/src/Application/Bus/QueryHandler.php +++ b/src/Application/Bus/QueryHandler.php @@ -19,10 +19,6 @@ final readonly class QueryHandler implements IQueryHandler { - /** - * QueryHandler constructor. - * - */ public function __construct(private object $handler) { } diff --git a/src/Application/Bus/Validator.php b/src/Application/Bus/Validator.php index b37b2f47..07b52b59 100644 --- a/src/Application/Bus/Validator.php +++ b/src/Application/Bus/Validator.php @@ -29,10 +29,6 @@ final class Validator implements IValidator */ private iterable $using = []; - /** - * AbstractValidator constructor - * - */ public function __construct(private readonly ?PipeContainer $rules = null) { } diff --git a/src/Application/DomainEventDispatching/Dispatcher.php b/src/Application/DomainEventDispatching/Dispatcher.php index 86a6c367..82888217 100644 --- a/src/Application/DomainEventDispatching/Dispatcher.php +++ b/src/Application/DomainEventDispatching/Dispatcher.php @@ -34,10 +34,6 @@ class Dispatcher implements DomainEventDispatcher */ private array $pipes = []; - /** - * Dispatcher constructor. - * - */ public function __construct( private readonly IListenerContainer $listeners = new ListenerContainer(), private readonly ?PipeContainer $middleware = null, diff --git a/src/Application/DomainEventDispatching/EventHandler.php b/src/Application/DomainEventDispatching/EventHandler.php index 1786af88..7a2b31db 100644 --- a/src/Application/DomainEventDispatching/EventHandler.php +++ b/src/Application/DomainEventDispatching/EventHandler.php @@ -19,10 +19,6 @@ final readonly class EventHandler { - /** - * EventHandler constructor. - * - */ public function __construct(private object $listener) { assert( diff --git a/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php b/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php index 224fe693..eee29f41 100644 --- a/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php +++ b/src/Application/DomainEventDispatching/Middleware/LogDomainEventDispatch.php @@ -21,10 +21,6 @@ final readonly class LogDomainEventDispatch implements DomainEventMiddleware { - /** - * LogDomainEventDispatch constructor - * - */ public function __construct( private LoggerInterface $logger, private string $dispatchLevel = LogLevel::DEBUG, diff --git a/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php b/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php index 219d3f03..29d10394 100644 --- a/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php +++ b/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php @@ -20,10 +20,6 @@ class UnitOfWorkAwareDispatcher extends Dispatcher { - /** - * UnitOfWorkAwareDispatcher constructor. - * - */ public function __construct( private readonly UnitOfWorkManager $unitOfWorkManager, IListenerContainer $listeners = new ListenerContainer(), diff --git a/src/Application/InboundEventBus/EventHandler.php b/src/Application/InboundEventBus/EventHandler.php index 97acb543..1f86055a 100644 --- a/src/Application/InboundEventBus/EventHandler.php +++ b/src/Application/InboundEventBus/EventHandler.php @@ -18,10 +18,6 @@ final readonly class EventHandler implements IEventHandler { - /** - * EventHandler constructor. - * - */ public function __construct(private object $handler) { } diff --git a/src/Application/InboundEventBus/EventHandlerContainer.php b/src/Application/InboundEventBus/EventHandlerContainer.php index 6308a8a7..79d9d848 100644 --- a/src/Application/InboundEventBus/EventHandlerContainer.php +++ b/src/Application/InboundEventBus/EventHandlerContainer.php @@ -25,8 +25,6 @@ final class EventHandlerContainer implements IEventHandlerContainer private array $bindings = []; /** - * EventHandlerContainer constructor. - * * @param ?Closure(): object $default */ public function __construct(private readonly ?Closure $default = null) diff --git a/src/Application/InboundEventBus/InboundEventDispatcher.php b/src/Application/InboundEventBus/InboundEventDispatcher.php index 63301277..691905c4 100644 --- a/src/Application/InboundEventBus/InboundEventDispatcher.php +++ b/src/Application/InboundEventBus/InboundEventDispatcher.php @@ -26,10 +26,6 @@ class InboundEventDispatcher implements IInboundEventDispatcher */ private array $pipes = []; - /** - * EventDispatcher constructor. - * - */ public function __construct( private readonly EventHandlerContainer $handlers, private readonly ?PipeContainer $middleware = null, diff --git a/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php b/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php index 8f260ad8..58e35a37 100644 --- a/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php +++ b/src/Application/InboundEventBus/Middleware/FlushDeferredEvents.php @@ -20,10 +20,6 @@ final readonly class FlushDeferredEvents implements InboundEventMiddleware { - /** - * FlushDeferredEvents constructor. - * - */ public function __construct(private DeferredDispatcher $dispatcher) { } diff --git a/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php b/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php index 5ecd6c63..87993cba 100644 --- a/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php +++ b/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php @@ -19,10 +19,6 @@ final readonly class HandleInUnitOfWork implements InboundEventMiddleware { - /** - * HandleInUnitOfWork constructor. - * - */ public function __construct( private UnitOfWorkManager $unitOfWorkManager, private int $attempts = 1, diff --git a/src/Application/InboundEventBus/Middleware/LogInboundEvent.php b/src/Application/InboundEventBus/Middleware/LogInboundEvent.php index eb54e848..7123c259 100644 --- a/src/Application/InboundEventBus/Middleware/LogInboundEvent.php +++ b/src/Application/InboundEventBus/Middleware/LogInboundEvent.php @@ -23,10 +23,6 @@ final readonly class LogInboundEvent implements InboundEventMiddleware { - /** - * LogInboundEvent constructor. - * - */ public function __construct( private LoggerInterface $log, private string $publishLevel = LogLevel::DEBUG, diff --git a/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php b/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php index c45f8e93..3c3bb5ed 100644 --- a/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php +++ b/src/Application/InboundEventBus/Middleware/SetupBeforeEvent.php @@ -19,8 +19,6 @@ final readonly class SetupBeforeEvent implements InboundEventMiddleware { /** - * SetupBeforeEvent constructor. - * * @param Closure(): ?Closure(): void $callback */ public function __construct(private Closure $callback) diff --git a/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php b/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php index b14e2875..fd21772c 100644 --- a/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php +++ b/src/Application/InboundEventBus/Middleware/TearDownAfterEvent.php @@ -19,8 +19,6 @@ final readonly class TearDownAfterEvent implements InboundEventMiddleware { /** - * TearDownAfterEvent constructor. - * * @param Closure(): void $callback */ public function __construct(private Closure $callback) diff --git a/src/Application/InboundEventBus/SwallowInboundEvent.php b/src/Application/InboundEventBus/SwallowInboundEvent.php index 5b441b90..46da5c1a 100644 --- a/src/Application/InboundEventBus/SwallowInboundEvent.php +++ b/src/Application/InboundEventBus/SwallowInboundEvent.php @@ -19,10 +19,6 @@ final readonly class SwallowInboundEvent { - /** - * SwallowInboundEvent constructor. - * - */ public function __construct( private ?LoggerInterface $logger = null, private string $level = LogLevel::DEBUG, diff --git a/src/Application/UnitOfWork/UnitOfWorkManager.php b/src/Application/UnitOfWork/UnitOfWorkManager.php index 80e40e54..61f0a7fa 100644 --- a/src/Application/UnitOfWork/UnitOfWorkManager.php +++ b/src/Application/UnitOfWork/UnitOfWorkManager.php @@ -35,10 +35,6 @@ final class UnitOfWorkManager implements IUnitOfWorkManager private bool $committed = false; - /** - * UnitOfWorkManager constructor. - * - */ public function __construct( private readonly UnitOfWork $unitOfWork, private readonly ?ExceptionReporter $reporter = null, diff --git a/src/Domain/IdentifierOrEntity.php b/src/Domain/IdentifierOrEntity.php index 46253d93..21a85591 100644 --- a/src/Domain/IdentifierOrEntity.php +++ b/src/Domain/IdentifierOrEntity.php @@ -27,10 +27,6 @@ public static function make(Entity|Identifier $idOrEntity): self return new self($idOrEntity); } - /** - * IdentifierOrEntity constructor. - * - */ public function __construct(Entity|Identifier $idOrEntity) { $this->id = ($idOrEntity instanceof Identifier) ? $idOrEntity : null; diff --git a/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php b/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php index 3ccfc3d1..a67c051e 100644 --- a/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php +++ b/src/Infrastructure/ExceptionReporter/PsrLogExceptionReporter.php @@ -19,10 +19,6 @@ final readonly class PsrLogExceptionReporter implements ExceptionReporter { - /** - * PsrLogExceptionReporter constructor. - * - */ public function __construct(private LoggerInterface $logger) { } diff --git a/src/Infrastructure/OutboundEventBus/ClosurePublisher.php b/src/Infrastructure/OutboundEventBus/ClosurePublisher.php index a6dfceac..a5412987 100644 --- a/src/Infrastructure/OutboundEventBus/ClosurePublisher.php +++ b/src/Infrastructure/OutboundEventBus/ClosurePublisher.php @@ -31,10 +31,6 @@ class ClosurePublisher implements OutboundEventPublisher */ private array $pipes = []; - /** - * ClosurePublisher constructor. - * - */ public function __construct( private readonly Closure $fn, private readonly ?PipeContainer $middleware = null, diff --git a/src/Infrastructure/OutboundEventBus/ComponentPublisher.php b/src/Infrastructure/OutboundEventBus/ComponentPublisher.php index cf1b1170..d876d2e7 100644 --- a/src/Infrastructure/OutboundEventBus/ComponentPublisher.php +++ b/src/Infrastructure/OutboundEventBus/ComponentPublisher.php @@ -26,10 +26,6 @@ class ComponentPublisher implements OutboundEventPublisher */ private array $pipes = []; - /** - * ComponentPublisher constructor. - * - */ public function __construct( private readonly PublisherHandlerContainer $handlers, private readonly ?PipeContainer $middleware = null, diff --git a/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php b/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php index 09c9c96b..66274072 100644 --- a/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php +++ b/src/Infrastructure/OutboundEventBus/Middleware/LogOutboundEvent.php @@ -23,10 +23,6 @@ final readonly class LogOutboundEvent implements OutboundEventMiddleware { - /** - * LogOutboundEvent constructor. - * - */ public function __construct( private LoggerInterface $log, private string $publishLevel = LogLevel::DEBUG, diff --git a/src/Infrastructure/OutboundEventBus/PublisherHandler.php b/src/Infrastructure/OutboundEventBus/PublisherHandler.php index bfe6a881..21b44e45 100644 --- a/src/Infrastructure/OutboundEventBus/PublisherHandler.php +++ b/src/Infrastructure/OutboundEventBus/PublisherHandler.php @@ -17,10 +17,6 @@ final readonly class PublisherHandler implements IPublisherHandler { - /** - * PublisherHandler constructor. - * - */ public function __construct(private object $handler) { } diff --git a/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php b/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php index 69b3cf4d..f6d9d65c 100644 --- a/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php +++ b/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php @@ -25,10 +25,6 @@ final class PublisherHandlerContainer implements IPublisherHandlerContainer */ private array $bindings = []; - /** - * PublisherHandlerContainer constructor. - * - */ public function __construct(private readonly ?Closure $default = null) { } diff --git a/src/Infrastructure/Queue/ClosureQueue.php b/src/Infrastructure/Queue/ClosureQueue.php index ab5b272b..88a22aa4 100644 --- a/src/Infrastructure/Queue/ClosureQueue.php +++ b/src/Infrastructure/Queue/ClosureQueue.php @@ -31,10 +31,6 @@ class ClosureQueue implements Queue */ private array $pipes = []; - /** - * ClosureQueue constructor. - * - */ public function __construct( private readonly Closure $fn, private readonly ?PipeContainer $middleware = null, diff --git a/src/Infrastructure/Queue/ComponentQueue.php b/src/Infrastructure/Queue/ComponentQueue.php index 2c812bdf..6bc4f184 100644 --- a/src/Infrastructure/Queue/ComponentQueue.php +++ b/src/Infrastructure/Queue/ComponentQueue.php @@ -26,10 +26,6 @@ class ComponentQueue implements Queue */ private array $pipes = []; - /** - * ComponentQueue constructor. - * - */ public function __construct( private readonly EnqueuerContainer $enqueuers, private readonly ?PipeContainer $middleware = null, diff --git a/src/Infrastructure/Queue/Enqueuer.php b/src/Infrastructure/Queue/Enqueuer.php index abaf0fa9..40de861b 100644 --- a/src/Infrastructure/Queue/Enqueuer.php +++ b/src/Infrastructure/Queue/Enqueuer.php @@ -17,10 +17,6 @@ final readonly class Enqueuer implements IEnqueuer { - /** - * Enqueuer constructor. - * - */ public function __construct(private object $enqueuer) { } diff --git a/src/Infrastructure/Queue/EnqueuerContainer.php b/src/Infrastructure/Queue/EnqueuerContainer.php index 1f0a756d..2352c9c7 100644 --- a/src/Infrastructure/Queue/EnqueuerContainer.php +++ b/src/Infrastructure/Queue/EnqueuerContainer.php @@ -23,8 +23,6 @@ final class EnqueuerContainer implements IEnqueuerContainer private array $bindings = []; /** - * EnqueuerContainer constructor. - * * @param Closure(): object $default */ public function __construct(private readonly Closure $default) diff --git a/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php b/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php index 55c8f488..e2d0b4b7 100644 --- a/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php +++ b/src/Infrastructure/Queue/Middleware/LogPushedToQueue.php @@ -23,10 +23,6 @@ final readonly class LogPushedToQueue implements QueueMiddleware { - /** - * LogPushedToQueue constructor. - * - */ public function __construct( private LoggerInterface $log, private string $queueLevel = LogLevel::DEBUG, diff --git a/src/Testing/FakeUnitOfWork.php b/src/Testing/FakeUnitOfWork.php index 35b29580..a3ae33e3 100644 --- a/src/Testing/FakeUnitOfWork.php +++ b/src/Testing/FakeUnitOfWork.php @@ -25,10 +25,6 @@ final class FakeUnitOfWork implements UnitOfWork */ public array $sequence = []; - /** - * FakeUnitOfWork constructor. - * - */ public function __construct(public FakeExceptionReporter $exceptions = new FakeExceptionReporter()) { } diff --git a/src/Toolkit/Contracts.php b/src/Toolkit/Contracts.php index 0b172ebe..4096659b 100644 --- a/src/Toolkit/Contracts.php +++ b/src/Toolkit/Contracts.php @@ -29,9 +29,6 @@ public static function assert(bool $precondition, Closure|string $message = ''): } } - /** - * Contracts constructor. - */ private function __construct() { } diff --git a/src/Toolkit/Identifiers/Guid.php b/src/Toolkit/Identifiers/Guid.php index 89333b36..31ad163a 100644 --- a/src/Toolkit/Identifiers/Guid.php +++ b/src/Toolkit/Identifiers/Guid.php @@ -73,10 +73,6 @@ public static function make(string|UnitEnum $type, int|string|Uuid|UuidInterface }; } - /** - * Guid constructor. - * - */ public function __construct( public string|UnitEnum $type, public IntegerId|StringId|Uuid $id, diff --git a/src/Toolkit/Identifiers/GuidTypeMap.php b/src/Toolkit/Identifiers/GuidTypeMap.php index a80dec7a..5644b400 100644 --- a/src/Toolkit/Identifiers/GuidTypeMap.php +++ b/src/Toolkit/Identifiers/GuidTypeMap.php @@ -20,8 +20,6 @@ final class GuidTypeMap { /** - * GuidTypeMap constructor - * * @param array $map */ public function __construct(private array $map = []) diff --git a/src/Toolkit/Identifiers/IntegerId.php b/src/Toolkit/Identifiers/IntegerId.php index 10538b9c..a2bf94a3 100644 --- a/src/Toolkit/Identifiers/IntegerId.php +++ b/src/Toolkit/Identifiers/IntegerId.php @@ -30,10 +30,6 @@ public static function from(Identifier|int $value): self }; } - /** - * IntegerId constructor. - * - */ public function __construct(public int $value) { Contracts::assert($this->value > 0, 'Identifier value must be greater than zero.'); diff --git a/src/Toolkit/Identifiers/PossiblyNumericId.php b/src/Toolkit/Identifiers/PossiblyNumericId.php index a7668700..d11f307e 100644 --- a/src/Toolkit/Identifiers/PossiblyNumericId.php +++ b/src/Toolkit/Identifiers/PossiblyNumericId.php @@ -24,10 +24,6 @@ public static function from(int|string $value): self return new self($value); } - /** - * PossiblyNumericId constructor - * - */ public function __construct(int|string $value) { if (is_string($value) && 1 === preg_match('/^\d+$/', $value)) { diff --git a/src/Toolkit/Identifiers/StringId.php b/src/Toolkit/Identifiers/StringId.php index 78a4b8af..8d128e81 100644 --- a/src/Toolkit/Identifiers/StringId.php +++ b/src/Toolkit/Identifiers/StringId.php @@ -30,10 +30,6 @@ public static function from(Identifier|string $value): self }; } - /** - * StringId constructor. - * - */ public function __construct(public string $value) { Contracts::assert( diff --git a/src/Toolkit/Identifiers/Uuid.php b/src/Toolkit/Identifiers/Uuid.php index 7e403442..dda9f488 100644 --- a/src/Toolkit/Identifiers/Uuid.php +++ b/src/Toolkit/Identifiers/Uuid.php @@ -76,10 +76,6 @@ public static function nil(): self return self::from(BaseUuid::NIL); } - /** - * Uuid constructor. - * - */ public function __construct(public readonly IBaseUuid $value) { } diff --git a/src/Toolkit/Identifiers/UuidFactory.php b/src/Toolkit/Identifiers/UuidFactory.php index 01850f3f..a89742d9 100644 --- a/src/Toolkit/Identifiers/UuidFactory.php +++ b/src/Toolkit/Identifiers/UuidFactory.php @@ -27,10 +27,6 @@ { private BaseUuidFactory $baseFactory; - /** - * UuidFactory constructor. - * - */ public function __construct(?BaseUuidFactory $factory = null) { $this->baseFactory = $factory ?? BaseUuid::getFactory(); diff --git a/src/Toolkit/Loggable/ObjectDecorator.php b/src/Toolkit/Loggable/ObjectDecorator.php index 488183aa..bfd2d8c7 100644 --- a/src/Toolkit/Loggable/ObjectDecorator.php +++ b/src/Toolkit/Loggable/ObjectDecorator.php @@ -24,10 +24,6 @@ */ final readonly class ObjectDecorator implements IteratorAggregate, ContextProvider { - /** - * ObjectDecorator constructor. - * - */ public function __construct(private object $source) { } diff --git a/src/Toolkit/Loggable/ResultDecorator.php b/src/Toolkit/Loggable/ResultDecorator.php index c538522a..278f5461 100644 --- a/src/Toolkit/Loggable/ResultDecorator.php +++ b/src/Toolkit/Loggable/ResultDecorator.php @@ -22,8 +22,6 @@ final readonly class ResultDecorator implements ContextProvider { /** - * ResultDecorator constructor. - * * @param Result $result */ public function __construct(private Result $result) diff --git a/src/Toolkit/ModuleBasename.php b/src/Toolkit/ModuleBasename.php index c4b8fe06..1e733515 100644 --- a/src/Toolkit/ModuleBasename.php +++ b/src/Toolkit/ModuleBasename.php @@ -58,10 +58,6 @@ public static function tryFrom(object|string $class): ?self return null; } - /** - * ModuleBasename constructor. - * - */ private function __construct( public ?string $module, public string $name, diff --git a/src/Toolkit/Pipeline/InterruptibleProcessor.php b/src/Toolkit/Pipeline/InterruptibleProcessor.php index b597d26d..56f186f9 100644 --- a/src/Toolkit/Pipeline/InterruptibleProcessor.php +++ b/src/Toolkit/Pipeline/InterruptibleProcessor.php @@ -21,10 +21,6 @@ final class InterruptibleProcessor implements Processor */ private $check; - /** - * InterruptibleProcessor constructor. - * - */ public function __construct(callable $check) { $this->check = $check; diff --git a/src/Toolkit/Pipeline/LazyPipe.php b/src/Toolkit/Pipeline/LazyPipe.php index 106dbfd8..e5e000ef 100644 --- a/src/Toolkit/Pipeline/LazyPipe.php +++ b/src/Toolkit/Pipeline/LazyPipe.php @@ -18,10 +18,6 @@ final readonly class LazyPipe { - /** - * LazyPipe constructor. - * - */ public function __construct( private PipeContainer $container, private string $pipeName, diff --git a/src/Toolkit/Pipeline/MiddlewareProcessor.php b/src/Toolkit/Pipeline/MiddlewareProcessor.php index 01aef899..122655eb 100644 --- a/src/Toolkit/Pipeline/MiddlewareProcessor.php +++ b/src/Toolkit/Pipeline/MiddlewareProcessor.php @@ -39,10 +39,6 @@ public static function call(callable $destination): self }); } - /** - * MiddlewareProcessor constructor. - * - */ public function __construct(?Closure $destination = null) { $this->destination = $destination ?? static fn ($payload) => $payload; diff --git a/src/Toolkit/Pipeline/Pipeline.php b/src/Toolkit/Pipeline/Pipeline.php index 74ec71ae..7762f02c 100644 --- a/src/Toolkit/Pipeline/Pipeline.php +++ b/src/Toolkit/Pipeline/Pipeline.php @@ -20,8 +20,6 @@ final class Pipeline implements IPipeline private readonly Processor $processor; /** - * Pipeline constructor. - * * @param callable[] $stages */ public function __construct( diff --git a/src/Toolkit/Pipeline/PipelineBuilder.php b/src/Toolkit/Pipeline/PipelineBuilder.php index f2bf2803..7b901e49 100644 --- a/src/Toolkit/Pipeline/PipelineBuilder.php +++ b/src/Toolkit/Pipeline/PipelineBuilder.php @@ -24,19 +24,11 @@ final class PipelineBuilder implements IPipelineBuilder */ private array $stages = []; - /** - * Fluent constructor. - * - */ public static function make(?PipeContainer $container = null): self { return new self($container); } - /** - * PipelineBuilder constructor. - * - */ public function __construct(private readonly ?PipeContainer $container = null) { } diff --git a/src/Toolkit/Result/Error.php b/src/Toolkit/Result/Error.php index a2160d7f..87f5fe19 100644 --- a/src/Toolkit/Result/Error.php +++ b/src/Toolkit/Result/Error.php @@ -20,10 +20,6 @@ { private string|UnitEnum|null $key; - /** - * Error constructor. - * - */ public function __construct( private ?UnitEnum $code = null, private string $message = '', diff --git a/src/Toolkit/Result/FailedResultException.php b/src/Toolkit/Result/FailedResultException.php index 66655f50..2ac4eef2 100644 --- a/src/Toolkit/Result/FailedResultException.php +++ b/src/Toolkit/Result/FailedResultException.php @@ -21,8 +21,6 @@ class FailedResultException extends RuntimeException implements ContextProvider { /** - * FailedResultException constructor. - * * @param Result $result */ public function __construct( diff --git a/src/Toolkit/Result/KeyedSetOfErrors.php b/src/Toolkit/Result/KeyedSetOfErrors.php index 4933bdc1..c14b8a5b 100644 --- a/src/Toolkit/Result/KeyedSetOfErrors.php +++ b/src/Toolkit/Result/KeyedSetOfErrors.php @@ -42,10 +42,6 @@ public static function from(IError|IListOfErrors|self $value): self }; } - /** - * KeyedSetOfErrors constructor. - * - */ public function __construct(IError ...$errors) { foreach ($errors as $error) { diff --git a/src/Toolkit/Result/Meta.php b/src/Toolkit/Result/Meta.php index fb431c16..6bcce000 100644 --- a/src/Toolkit/Result/Meta.php +++ b/src/Toolkit/Result/Meta.php @@ -41,8 +41,6 @@ public static function cast(array|self $values): self } /** - * ResultMeta constructor. - * * @param array $values */ public function __construct(array $values = []) diff --git a/src/Toolkit/Result/Result.php b/src/Toolkit/Result/Result.php index 9ecd4e4a..2095261b 100644 --- a/src/Toolkit/Result/Result.php +++ b/src/Toolkit/Result/Result.php @@ -67,8 +67,6 @@ public static function fail(array|IError|IListOfErrors|string|UnitEnum $errorOrE } /** - * Result constructor. - * * @param TValue $value */ private function __construct( From fbcaec5eda8db88bca4e0c30a22f9bc014dc3702 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 10 Sep 2025 15:16:11 +0100 Subject: [PATCH 3/4] feat: add more type narrowing to containers --- pint.json | 2 ++ .../Bus/CommandHandlerContainer.php | 9 ++++--- .../Bus/Middleware/ExecuteInUnitOfWork.php | 3 +++ src/Application/Bus/QueryHandlerContainer.php | 9 ++++--- .../ListenerContainer.php | 8 ++++--- .../InboundEventBus/EventHandlerContainer.php | 6 ++--- .../Middleware/HandleInUnitOfWork.php | 3 +++ .../UnitOfWork/UnitOfWorkManager.php | 12 +++++----- .../Bus/CommandHandlerContainer.php | 3 +++ .../Application/Bus/QueryHandlerContainer.php | 3 +++ .../Application/Ports/Driven/UnitOfWork.php | 1 + .../UnitOfWork/UnitOfWorkManager.php | 1 + .../Toolkit/Identifiers/UuidFactory.php | 24 +++++++++---------- .../PublisherHandlerContainer.php | 2 +- .../Queue/EnqueuerContainer.php | 5 +++- .../Pipeline/AccumulationProcessor.php | 7 ------ .../Bus/CommandHandlerContainerTest.php | 20 ++++++++++------ .../Bus/QueryHandlerContainerTest.php | 20 ++++++++++------ .../ListenerContainerTest.php | 1 + .../UnitOfWork/UnitOfWorkManagerTest.php | 1 + tests/Unit/Domain/TestEntity.php | 2 +- 21 files changed, 88 insertions(+), 54 deletions(-) diff --git a/pint.json b/pint.json index 38da0fa1..df155573 100644 --- a/pint.json +++ b/pint.json @@ -22,6 +22,8 @@ "ordered_types": { "null_adjustment": "always_last" }, + "phpdoc_summary": true, + "phpdoc_types": true, "phpdoc_types_order": { "null_adjustment": "always_last" }, diff --git a/src/Application/Bus/CommandHandlerContainer.php b/src/Application/Bus/CommandHandlerContainer.php index 74497f07..5c74c2bc 100644 --- a/src/Application/Bus/CommandHandlerContainer.php +++ b/src/Application/Bus/CommandHandlerContainer.php @@ -13,19 +13,22 @@ namespace CloudCreativity\Modules\Application\Bus; use Closure; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Contracts\Application\Bus\CommandHandlerContainer as ICommandHandlerContainer; -use RuntimeException; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Command; final class CommandHandlerContainer implements ICommandHandlerContainer { /** - * @var array + * @var array, Closure> */ private array $bindings = []; /** * Bind a command handler into the container. * + * @param class-string $commandClass + * @param Closure(): object $binding */ public function bind(string $commandClass, Closure $binding): void { @@ -42,6 +45,6 @@ public function get(string $commandClass): CommandHandler return new CommandHandler($innerHandler); } - throw new RuntimeException('No command handler bound for command class: ' . $commandClass); + throw new ApplicationException('No command handler bound for command class: ' . $commandClass); } } diff --git a/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php b/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php index b02913bd..c896d926 100644 --- a/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php +++ b/src/Application/Bus/Middleware/ExecuteInUnitOfWork.php @@ -21,6 +21,9 @@ final readonly class ExecuteInUnitOfWork implements CommandMiddleware { + /** + * @param int<1, max> $attempts + */ public function __construct( private UnitOfWorkManager $unitOfWorkManager, private int $attempts = 1, diff --git a/src/Application/Bus/QueryHandlerContainer.php b/src/Application/Bus/QueryHandlerContainer.php index aae2a347..4352fe53 100644 --- a/src/Application/Bus/QueryHandlerContainer.php +++ b/src/Application/Bus/QueryHandlerContainer.php @@ -13,19 +13,22 @@ namespace CloudCreativity\Modules\Application\Bus; use Closure; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Contracts\Application\Bus\QueryHandlerContainer as IQueryHandlerContainer; -use RuntimeException; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Query; final class QueryHandlerContainer implements IQueryHandlerContainer { /** - * @var array + * @var array,Closure> */ private array $bindings = []; /** * Bind a query handler into the container. * + * @param class-string $queryClass + * @param Closure(): object $binding */ public function bind(string $queryClass, Closure $binding): void { @@ -42,6 +45,6 @@ public function get(string $queryClass): QueryHandler return new QueryHandler($innerHandler); } - throw new RuntimeException('No query handler bound for query class: ' . $queryClass); + throw new ApplicationException('No query handler bound for query class: ' . $queryClass); } } diff --git a/src/Application/DomainEventDispatching/ListenerContainer.php b/src/Application/DomainEventDispatching/ListenerContainer.php index 88ed7f24..88439865 100644 --- a/src/Application/DomainEventDispatching/ListenerContainer.php +++ b/src/Application/DomainEventDispatching/ListenerContainer.php @@ -13,19 +13,21 @@ namespace CloudCreativity\Modules\Application\DomainEventDispatching; use Closure; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Contracts\Application\DomainEventDispatching\ListenerContainer as IListenerContainer; -use RuntimeException; final class ListenerContainer implements IListenerContainer { /** - * @var array + * @var array */ private array $bindings = []; /** * Bind a listener factory into the container. * + * @param non-empty-string $listenerName + * @param Closure():object $binding */ public function bind(string $listenerName, Closure $binding): void { @@ -42,6 +44,6 @@ public function get(string $listenerName): object return $listener; } - throw new RuntimeException('Unrecognised listener name: ' . $listenerName); + throw new ApplicationException('Unrecognised listener name: ' . $listenerName); } } diff --git a/src/Application/InboundEventBus/EventHandlerContainer.php b/src/Application/InboundEventBus/EventHandlerContainer.php index 79d9d848..5a9cef1e 100644 --- a/src/Application/InboundEventBus/EventHandlerContainer.php +++ b/src/Application/InboundEventBus/EventHandlerContainer.php @@ -13,14 +13,14 @@ namespace CloudCreativity\Modules\Application\InboundEventBus; use Closure; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Contracts\Application\InboundEventBus\EventHandlerContainer as IEventHandlerContainer; use CloudCreativity\Modules\Contracts\Toolkit\Messages\IntegrationEvent; -use RuntimeException; final class EventHandlerContainer implements IEventHandlerContainer { /** - * @var array + * @var array, Closure> */ private array $bindings = []; @@ -52,6 +52,6 @@ public function get(string $eventName): EventHandler return new EventHandler($handler); } - throw new RuntimeException('No handler bound for integration event: ' . $eventName); + throw new ApplicationException('No handler bound for integration event: ' . $eventName); } } diff --git a/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php b/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php index 87993cba..b6ee6aee 100644 --- a/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php +++ b/src/Application/InboundEventBus/Middleware/HandleInUnitOfWork.php @@ -19,6 +19,9 @@ final readonly class HandleInUnitOfWork implements InboundEventMiddleware { + /** + * @param int<1, max> $attempts + */ public function __construct( private UnitOfWorkManager $unitOfWorkManager, private int $attempts = 1, diff --git a/src/Application/UnitOfWork/UnitOfWorkManager.php b/src/Application/UnitOfWork/UnitOfWorkManager.php index 61f0a7fa..38ac8866 100644 --- a/src/Application/UnitOfWork/UnitOfWorkManager.php +++ b/src/Application/UnitOfWork/UnitOfWorkManager.php @@ -13,10 +13,10 @@ namespace CloudCreativity\Modules\Application\UnitOfWork; use Closure; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Contracts\Application\Ports\Driven\ExceptionReporter; use CloudCreativity\Modules\Contracts\Application\Ports\Driven\UnitOfWork; use CloudCreativity\Modules\Contracts\Application\UnitOfWork\UnitOfWorkManager as IUnitOfWorkManager; -use RuntimeException; use Throwable; final class UnitOfWorkManager implements IUnitOfWorkManager @@ -44,13 +44,13 @@ public function __construct( public function execute(Closure $callback, int $attempts = 1): mixed { if ($this->active) { - throw new RuntimeException( + throw new ApplicationException( 'Not expecting unit of work manager to start a unit of work within an existing one.', ); } if ($attempts < 1) { - throw new RuntimeException('Attempts must be greater than zero.'); + throw new ApplicationException('Attempts must be greater than zero.'); } return $this->retry($callback, $attempts); @@ -100,12 +100,12 @@ public function beforeCommit(callable $callback): void } if ($this->committed) { - throw new RuntimeException( + throw new ApplicationException( 'Cannot queue a before commit callback as unit of work has been committed.', ); } - throw new RuntimeException('Cannot queue a before commit callback when not executing a unit of work.'); + throw new ApplicationException('Cannot queue a before commit callback when not executing a unit of work.'); } public function afterCommit(callable $callback): void @@ -115,7 +115,7 @@ public function afterCommit(callable $callback): void return; } - throw new RuntimeException('Cannot queue an after commit callback when not executing a unit of work.'); + throw new ApplicationException('Cannot queue an after commit callback when not executing a unit of work.'); } private function executeBeforeCommit(): void diff --git a/src/Contracts/Application/Bus/CommandHandlerContainer.php b/src/Contracts/Application/Bus/CommandHandlerContainer.php index 910a1c57..e89d0d6b 100644 --- a/src/Contracts/Application/Bus/CommandHandlerContainer.php +++ b/src/Contracts/Application/Bus/CommandHandlerContainer.php @@ -12,11 +12,14 @@ namespace CloudCreativity\Modules\Contracts\Application\Bus; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Command; + interface CommandHandlerContainer { /** * Get a command handler for the provided command name. * + * @param class-string $commandClass */ public function get(string $commandClass): CommandHandler; } diff --git a/src/Contracts/Application/Bus/QueryHandlerContainer.php b/src/Contracts/Application/Bus/QueryHandlerContainer.php index b0f9371f..bcd9293f 100644 --- a/src/Contracts/Application/Bus/QueryHandlerContainer.php +++ b/src/Contracts/Application/Bus/QueryHandlerContainer.php @@ -12,11 +12,14 @@ namespace CloudCreativity\Modules\Contracts\Application\Bus; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Query; + interface QueryHandlerContainer { /** * Get a query handler for the provided query name. * + * @param class-string $queryClass */ public function get(string $queryClass): QueryHandler; } diff --git a/src/Contracts/Application/Ports/Driven/UnitOfWork.php b/src/Contracts/Application/Ports/Driven/UnitOfWork.php index 1ee6c388..226c26a0 100644 --- a/src/Contracts/Application/Ports/Driven/UnitOfWork.php +++ b/src/Contracts/Application/Ports/Driven/UnitOfWork.php @@ -21,6 +21,7 @@ interface UnitOfWork * * @template TReturn * @param Closure(): TReturn $callback + * @param int<1, max> $attempts * @return TReturn */ public function execute(Closure $callback, int $attempts = 1): mixed; diff --git a/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php b/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php index bda8a5b3..dcf66f1a 100644 --- a/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php +++ b/src/Contracts/Application/UnitOfWork/UnitOfWorkManager.php @@ -21,6 +21,7 @@ interface UnitOfWorkManager * * @template TReturn * @param Closure(): TReturn $callback + * @param int<1, max> $attempts * @return TReturn */ public function execute(Closure $callback, int $attempts = 1): mixed; diff --git a/src/Contracts/Toolkit/Identifiers/UuidFactory.php b/src/Contracts/Toolkit/Identifiers/UuidFactory.php index 8f389fda..61f15304 100644 --- a/src/Contracts/Toolkit/Identifiers/UuidFactory.php +++ b/src/Contracts/Toolkit/Identifiers/UuidFactory.php @@ -27,7 +27,7 @@ interface UuidFactory public function from(Identifier|UuidInterface $uuid): Uuid; /** - * Creates a UUID from a byte string + * Creates a UUID from a byte string. * * @param string $bytes A binary string * @return Uuid A UUID instance created from a binary string representation @@ -35,7 +35,7 @@ public function from(Identifier|UuidInterface $uuid): Uuid; public function fromBytes(string $bytes): Uuid; /** - * Creates a UUID from a DateTimeInterface instance + * Creates a UUID from a DateTimeInterface instance. * * @param DateTimeInterface $dateTime The date and time * @param Hexadecimal|null $node A 48-bit number representing the hardware @@ -53,7 +53,7 @@ public function fromDateTime( ): Uuid; /** - * Creates a UUID from a 128-bit integer string + * Creates a UUID from a 128-bit integer string. * * @param string $integer String representation of 128-bit integer * @return Uuid A UUID instance created from the string representation of a @@ -62,7 +62,7 @@ public function fromDateTime( public function fromInteger(string $integer): Uuid; /** - * Creates a UUID from the string standard representation + * Creates a UUID from the string standard representation. * * @param string $uuid A hexadecimal string * @return Uuid A UUID instance created from a hexadecimal string @@ -72,7 +72,7 @@ public function fromString(string $uuid): Uuid; /** * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time + * and the current time. * * @param Hexadecimal|int|string|null $node A 48-bit number representing the * hardware address; this number may be represented as an integer or a @@ -89,7 +89,7 @@ public function uuid1( /** * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time + * identifier, host ID, clock sequence, and the current time. * * @param int $localDomain The local domain to use when generating bytes, * according to DCE Security @@ -113,7 +113,7 @@ public function uuid2( /** * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name + * namespace ID and a name. * * @param string|UuidInterface $ns The namespace (must be a valid UUID) * @param string $name The name to use for creating a UUID @@ -122,7 +122,7 @@ public function uuid2( public function uuid3(string|UuidInterface $ns, string $name): Uuid; /** - * Returns a version 4 (random) UUID + * Returns a version 4 (random) UUID. * * @return Uuid A UUID instance that represents a version 4 UUID */ @@ -130,7 +130,7 @@ public function uuid4(): Uuid; /** * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name + * namespace ID and a name. * * @param string|UuidInterface $ns The namespace (must be a valid UUID) * @param string $name The name to use for creating a UUID @@ -140,7 +140,7 @@ public function uuid5(string|UuidInterface $ns, string $name): Uuid; /** * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time + * and the current time. * * @param Hexadecimal|null $node A 48-bit number representing the hardware * address @@ -152,7 +152,7 @@ public function uuid5(string|UuidInterface $ns, string $name): Uuid; public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): Uuid; /** - * Returns a version 7 (Unix Epoch time) UUID + * Returns a version 7 (Unix Epoch time) UUID. * * @param DateTimeInterface|null $dateTime An optional date/time from which * to create the version 7 UUID. If not provided, the UUID is generated @@ -162,7 +162,7 @@ public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): Uuid; public function uuid7(?DateTimeInterface $dateTime = null): Uuid; /** - * Returns a version 8 (Custom) UUID + * Returns a version 8 (Custom) UUID. * * The bytes provided may contain any value according to your application's * needs. Be aware, however, that other applications may not understand the diff --git a/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php b/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php index f6d9d65c..e50ff6c0 100644 --- a/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php +++ b/src/Infrastructure/OutboundEventBus/PublisherHandlerContainer.php @@ -21,7 +21,7 @@ final class PublisherHandlerContainer implements IPublisherHandlerContainer { /** - * @var array + * @var array, Closure> */ private array $bindings = []; diff --git a/src/Infrastructure/Queue/EnqueuerContainer.php b/src/Infrastructure/Queue/EnqueuerContainer.php index 2352c9c7..cff46588 100644 --- a/src/Infrastructure/Queue/EnqueuerContainer.php +++ b/src/Infrastructure/Queue/EnqueuerContainer.php @@ -14,11 +14,12 @@ use Closure; use CloudCreativity\Modules\Contracts\Infrastructure\Queue\EnqueuerContainer as IEnqueuerContainer; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Command; final class EnqueuerContainer implements IEnqueuerContainer { /** - * @var array + * @var array, Closure> */ private array $bindings = []; @@ -32,6 +33,8 @@ public function __construct(private readonly Closure $default) /** * Bind an enqueuer factory into the container. * + * @param class-string $queueableName + * @param Closure(): object $binding */ public function bind(string $queueableName, Closure $binding): void { diff --git a/src/Toolkit/Pipeline/AccumulationProcessor.php b/src/Toolkit/Pipeline/AccumulationProcessor.php index eab78190..03978f57 100644 --- a/src/Toolkit/Pipeline/AccumulationProcessor.php +++ b/src/Toolkit/Pipeline/AccumulationProcessor.php @@ -21,15 +21,8 @@ final class AccumulationProcessor implements Processor */ private $accumulator; - /** - * @var mixed|null - */ private mixed $initialValue; - /** - * AccumulationProcessor - * - */ public function __construct(callable $accumulator, mixed $initialValue = null) { $this->accumulator = $accumulator; diff --git a/tests/Unit/Application/Bus/CommandHandlerContainerTest.php b/tests/Unit/Application/Bus/CommandHandlerContainerTest.php index ceaf7457..d14d64a4 100644 --- a/tests/Unit/Application/Bus/CommandHandlerContainerTest.php +++ b/tests/Unit/Application/Bus/CommandHandlerContainerTest.php @@ -12,8 +12,10 @@ namespace CloudCreativity\Modules\Tests\Unit\Application\Bus; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Application\Bus\CommandHandler; use CloudCreativity\Modules\Application\Bus\CommandHandlerContainer; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Command; use PHPUnit\Framework\TestCase; class CommandHandlerContainerTest extends TestCase @@ -23,16 +25,20 @@ public function test(): void $a = new TestCommandHandler(); $b = $this->createMock(TestCommandHandler::class); + $command1 = new class () implements Command {}; + $command2 = new class () implements Command {}; + $command3 = new class () implements Command {}; + $container = new CommandHandlerContainer(); - $container->bind('CommandClassA', fn () => $a); - $container->bind('CommandClassB', fn () => $b); + $container->bind($command1::class, fn () => $a); + $container->bind($command2::class, fn () => $b); - $this->assertEquals(new CommandHandler($a), $container->get('CommandClassA')); - $this->assertEquals(new CommandHandler($b), $container->get('CommandClassB')); + $this->assertEquals(new CommandHandler($a), $container->get($command1::class)); + $this->assertEquals(new CommandHandler($b), $container->get($command2::class)); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('No command handler bound for command class: CommandClassC'); + $this->expectException(ApplicationException::class); + $this->expectExceptionMessage('No command handler bound for command class: ' . $command3::class); - $container->get('CommandClassC'); + $container->get($command3::class); } } diff --git a/tests/Unit/Application/Bus/QueryHandlerContainerTest.php b/tests/Unit/Application/Bus/QueryHandlerContainerTest.php index 4888828f..2348927a 100644 --- a/tests/Unit/Application/Bus/QueryHandlerContainerTest.php +++ b/tests/Unit/Application/Bus/QueryHandlerContainerTest.php @@ -12,8 +12,10 @@ namespace CloudCreativity\Modules\Tests\Unit\Application\Bus; +use CloudCreativity\Modules\Application\ApplicationException; use CloudCreativity\Modules\Application\Bus\QueryHandler; use CloudCreativity\Modules\Application\Bus\QueryHandlerContainer; +use CloudCreativity\Modules\Contracts\Toolkit\Messages\Query; use PHPUnit\Framework\TestCase; class QueryHandlerContainerTest extends TestCase @@ -23,16 +25,20 @@ public function test(): void $a = new TestQueryHandler(); $b = $this->createMock(TestQueryHandler::class); + $query1 = new class () implements Query {}; + $query2 = new class () implements Query {}; + $query3 = new class () implements Query {}; + $container = new QueryHandlerContainer(); - $container->bind('QueryClassA', fn () => $a); - $container->bind('QueryClassB', fn () => $b); + $container->bind($query1::class, fn () => $a); + $container->bind($query2::class, fn () => $b); - $this->assertEquals(new QueryHandler($a), $container->get('QueryClassA')); - $this->assertEquals(new QueryHandler($b), $container->get('QueryClassB')); + $this->assertEquals(new QueryHandler($a), $container->get($query1::class)); + $this->assertEquals(new QueryHandler($b), $container->get($query2::class)); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('No query handler bound for query class: QueryClassC'); + $this->expectException(ApplicationException::class); + $this->expectExceptionMessage('No query handler bound for query class: ' . $query3::class); - $container->get('QueryClassC'); + $container->get($query3::class); } } diff --git a/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php b/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php index 8a7beae0..a4ddaf4a 100644 --- a/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php +++ b/tests/Unit/Application/DomainEventDispatching/ListenerContainerTest.php @@ -38,6 +38,7 @@ public function testItDoesNotRecogniseListenerName(): void public function testItHandlesBindingNotReturningAnObject(): void { $container = new ListenerContainer(); + /** @phpstan-ignore-next-line */ $container->bind('foo', fn () => 'bar'); $this->expectExceptionMessage('Listener binding for foo must return an object.'); $container->get('foo'); diff --git a/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php b/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php index f799a97f..a745f968 100644 --- a/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php +++ b/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php @@ -508,6 +508,7 @@ public function testAttemptsMustBeGreaterThanZero(): void ->method('execute') ->willReturnCallback(fn (Closure $callback) => $callback()); + /** @phpstan-ignore-next-line */ $this->manager->execute(fn () => throw new \LogicException('Boom!'), 0); } } diff --git a/tests/Unit/Domain/TestEntity.php b/tests/Unit/Domain/TestEntity.php index 31c35f17..b5c008f4 100644 --- a/tests/Unit/Domain/TestEntity.php +++ b/tests/Unit/Domain/TestEntity.php @@ -21,7 +21,7 @@ use IsEntity; /** - * TestEntity constructor + * TestEntity constructor. * */ public function __construct(Identifier $id, private string $name = 'John Doe') From 57ba651a705db7ad1c18eff3bff8ee17c12026ca Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Wed, 10 Sep 2025 15:20:39 +0100 Subject: [PATCH 4/4] style: trim phpdoc blocks --- pint.json | 1 + src/Application/DomainEventDispatching/Dispatcher.php | 3 --- src/Application/DomainEventDispatching/EventHandler.php | 3 --- .../DomainEventDispatching/UnitOfWorkAwareDispatcher.php | 1 - src/Application/InboundEventBus/SwallowInboundEvent.php | 1 - src/Contracts/Application/Bus/Validator.php | 1 - .../DomainEventDispatching/DeferredDispatcher.php | 2 -- .../Application/DomainEventDispatching/ListenerContainer.php | 1 - src/Contracts/Application/InboundEventBus/EventHandler.php | 1 - src/Contracts/Application/Ports/Driven/ExceptionReporter.php | 1 - .../Application/Ports/Driven/OutboundEventPublisher.php | 1 - src/Contracts/Application/Ports/Driven/Queue.php | 1 - src/Contracts/Application/Ports/Driving/CommandQueuer.php | 1 - .../Application/Ports/Driving/InboundEventDispatcher.php | 1 - src/Contracts/Domain/Entity.php | 4 ---- src/Contracts/Domain/Events/DomainEvent.php | 1 - src/Contracts/Domain/Events/DomainEventDispatcher.php | 1 - .../Infrastructure/OutboundEventBus/PublisherHandler.php | 1 - src/Contracts/Infrastructure/Queue/Enqueuer.php | 1 - src/Contracts/Toolkit/Identifiers/Identifier.php | 2 -- src/Contracts/Toolkit/Identifiers/IdentifierFactory.php | 1 - src/Contracts/Toolkit/Identifiers/UuidFactory.php | 1 - src/Contracts/Toolkit/Iterables/KeyedSet.php | 2 -- src/Contracts/Toolkit/Iterables/ListIterator.php | 2 -- src/Contracts/Toolkit/Loggable/Contextual.php | 1 - src/Contracts/Toolkit/Pipeline/PipeContainer.php | 1 - src/Contracts/Toolkit/Pipeline/Pipeline.php | 3 --- src/Contracts/Toolkit/Pipeline/PipelineBuilder.php | 1 - src/Contracts/Toolkit/Pipeline/Processor.php | 1 - src/Contracts/Toolkit/Result/Error.php | 4 ---- src/Contracts/Toolkit/Result/ListOfErrors.php | 1 - src/Contracts/Toolkit/Result/Result.php | 3 --- src/Testing/FakeDomainEventDispatcher.php | 1 - src/Testing/FakeExceptionReporter.php | 1 - src/Testing/FakeOutboundEventPublisher.php | 1 - src/Testing/FakeQueue.php | 1 - src/Toolkit/Identifiers/Guid.php | 5 ----- src/Toolkit/Identifiers/GuidTypeMap.php | 3 --- src/Toolkit/Identifiers/PossiblyNumericId.php | 1 - src/Toolkit/Identifiers/Uuid.php | 2 -- src/Toolkit/ModuleBasename.php | 1 - src/Toolkit/Pipeline/MiddlewareProcessor.php | 2 -- src/Toolkit/Pipeline/PipeContainer.php | 1 - src/Toolkit/Result/KeyedSetOfErrors.php | 2 -- src/Toolkit/Result/Meta.php | 1 - src/Toolkit/functions.php | 2 -- .../Unit/Application/DomainEventDispatching/TestListener.php | 1 - .../DomainEventDispatching/TestListenerAfterCommit.php | 1 - .../DomainEventDispatching/TestListenerBeforeCommit.php | 1 - tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php | 3 --- tests/Unit/Domain/TestEntity.php | 2 -- tests/Unit/Domain/TestEntityWithNullableId.php | 1 - tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php | 1 - 53 files changed, 1 insertion(+), 83 deletions(-) diff --git a/pint.json b/pint.json index df155573..5f8b5632 100644 --- a/pint.json +++ b/pint.json @@ -23,6 +23,7 @@ "null_adjustment": "always_last" }, "phpdoc_summary": true, + "phpdoc_trim": true, "phpdoc_types": true, "phpdoc_types_order": { "null_adjustment": "always_last" diff --git a/src/Application/DomainEventDispatching/Dispatcher.php b/src/Application/DomainEventDispatching/Dispatcher.php index 82888217..37c4798d 100644 --- a/src/Application/DomainEventDispatching/Dispatcher.php +++ b/src/Application/DomainEventDispatching/Dispatcher.php @@ -78,7 +78,6 @@ public function dispatch(DomainEvent $event): void /** * Dispatch the events immediately. - * */ protected function dispatchNow(DomainEvent $event): void { @@ -119,7 +118,6 @@ protected function cursor(string $eventName): Generator /** * Execute the listener. - * */ protected function execute(DomainEvent $event, EventHandler $listener): void { @@ -128,7 +126,6 @@ protected function execute(DomainEvent $event, EventHandler $listener): void /** * Is the provided listener valid to attach to an event? - * */ private function canAttach(mixed $listener): bool { diff --git a/src/Application/DomainEventDispatching/EventHandler.php b/src/Application/DomainEventDispatching/EventHandler.php index 7a2b31db..a374b5f7 100644 --- a/src/Application/DomainEventDispatching/EventHandler.php +++ b/src/Application/DomainEventDispatching/EventHandler.php @@ -32,7 +32,6 @@ public function __construct(private object $listener) /** * Should the handler be executed before the transaction is committed? - * */ public function beforeCommit(): bool { @@ -41,7 +40,6 @@ public function beforeCommit(): bool /** * Should the handler be executed after the transaction is committed? - * */ public function afterCommit(): bool { @@ -50,7 +48,6 @@ public function afterCommit(): bool /** * Execute the listener. - * */ public function __invoke(DomainEvent $event): void { diff --git a/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php b/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php index 29d10394..90960c48 100644 --- a/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php +++ b/src/Application/DomainEventDispatching/UnitOfWorkAwareDispatcher.php @@ -42,7 +42,6 @@ public function dispatch(DomainEvent $event): void /** * Execute the listener or queue it in the unit of work manager. - * */ protected function execute(DomainEvent $event, EventHandler $listener): void { diff --git a/src/Application/InboundEventBus/SwallowInboundEvent.php b/src/Application/InboundEventBus/SwallowInboundEvent.php index 46da5c1a..d2064a2c 100644 --- a/src/Application/InboundEventBus/SwallowInboundEvent.php +++ b/src/Application/InboundEventBus/SwallowInboundEvent.php @@ -27,7 +27,6 @@ public function __construct( /** * Handle the event. - * */ public function handle(IntegrationEvent $event): void { diff --git a/src/Contracts/Application/Bus/Validator.php b/src/Contracts/Application/Bus/Validator.php index cb031bf1..51427b5c 100644 --- a/src/Contracts/Application/Bus/Validator.php +++ b/src/Contracts/Application/Bus/Validator.php @@ -28,7 +28,6 @@ public function using(iterable $rules): static; /** * Validate the provided message. - * */ public function validate(Command|Query $message): ListOfErrors; } diff --git a/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php b/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php index b6f34329..f4af234b 100644 --- a/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php +++ b/src/Contracts/Application/DomainEventDispatching/DeferredDispatcher.php @@ -18,13 +18,11 @@ interface DeferredDispatcher extends DomainEventDispatcher { /** * Dispatch any deferred events. - * */ public function flush(): void; /** * Clear deferred events without dispatching them. - * */ public function forget(): void; } diff --git a/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php b/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php index 0cc422b7..e5c53806 100644 --- a/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php +++ b/src/Contracts/Application/DomainEventDispatching/ListenerContainer.php @@ -16,7 +16,6 @@ interface ListenerContainer { /** * Get a listener by its name. - * */ public function get(string $listenerName): object; } diff --git a/src/Contracts/Application/InboundEventBus/EventHandler.php b/src/Contracts/Application/InboundEventBus/EventHandler.php index 92660c2f..8b840a1f 100644 --- a/src/Contracts/Application/InboundEventBus/EventHandler.php +++ b/src/Contracts/Application/InboundEventBus/EventHandler.php @@ -19,7 +19,6 @@ interface EventHandler extends DispatchThroughMiddleware { /** * Handle the integration event. - * */ public function __invoke(IntegrationEvent $event): void; } diff --git a/src/Contracts/Application/Ports/Driven/ExceptionReporter.php b/src/Contracts/Application/Ports/Driven/ExceptionReporter.php index 58180ecf..3b300ec2 100644 --- a/src/Contracts/Application/Ports/Driven/ExceptionReporter.php +++ b/src/Contracts/Application/Ports/Driven/ExceptionReporter.php @@ -18,7 +18,6 @@ interface ExceptionReporter { /** * Report the exception. - * */ public function report(Throwable $ex): void; } diff --git a/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php b/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php index f21cd290..de5b093d 100644 --- a/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php +++ b/src/Contracts/Application/Ports/Driven/OutboundEventPublisher.php @@ -18,7 +18,6 @@ interface OutboundEventPublisher { /** * Publish an outbound integration event. - * */ public function publish(IntegrationEvent $event): void; } diff --git a/src/Contracts/Application/Ports/Driven/Queue.php b/src/Contracts/Application/Ports/Driven/Queue.php index 31e427e1..2ad229e4 100644 --- a/src/Contracts/Application/Ports/Driven/Queue.php +++ b/src/Contracts/Application/Ports/Driven/Queue.php @@ -18,7 +18,6 @@ interface Queue { /** * Push a command on to the queue. - * */ public function push(Command $command): void; } diff --git a/src/Contracts/Application/Ports/Driving/CommandQueuer.php b/src/Contracts/Application/Ports/Driving/CommandQueuer.php index e77b65f6..b58ad40c 100644 --- a/src/Contracts/Application/Ports/Driving/CommandQueuer.php +++ b/src/Contracts/Application/Ports/Driving/CommandQueuer.php @@ -18,7 +18,6 @@ interface CommandQueuer { /** * Queue a command for asynchronous dispatching. - * */ public function queue(Command $command): void; } diff --git a/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php b/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php index 75a5900f..54d63abc 100644 --- a/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php +++ b/src/Contracts/Application/Ports/Driving/InboundEventDispatcher.php @@ -18,7 +18,6 @@ interface InboundEventDispatcher { /** * Dispatch an inbound integration event. - * */ public function dispatch(IntegrationEvent $event): void; } diff --git a/src/Contracts/Domain/Entity.php b/src/Contracts/Domain/Entity.php index c8c1e644..613ca1ff 100644 --- a/src/Contracts/Domain/Entity.php +++ b/src/Contracts/Domain/Entity.php @@ -18,25 +18,21 @@ interface Entity { /** * Get the entity's identifier. - * */ public function getId(): ?Identifier; /** * Get the entity's identifier, or fail if one is not set. - * */ public function getIdOrFail(): Identifier; /** * Is this entity the same as the provided entity? - * */ public function is(?Entity $other): bool; /** * Is this entity not the same as the provided entity? - * */ public function isNot(?Entity $other): bool; } diff --git a/src/Contracts/Domain/Events/DomainEvent.php b/src/Contracts/Domain/Events/DomainEvent.php index 19b28576..38319183 100644 --- a/src/Contracts/Domain/Events/DomainEvent.php +++ b/src/Contracts/Domain/Events/DomainEvent.php @@ -18,7 +18,6 @@ interface DomainEvent { /** * The date/time the event occurred. - * */ public function getOccurredAt(): DateTimeImmutable; } diff --git a/src/Contracts/Domain/Events/DomainEventDispatcher.php b/src/Contracts/Domain/Events/DomainEventDispatcher.php index 91b4baeb..3de5fe10 100644 --- a/src/Contracts/Domain/Events/DomainEventDispatcher.php +++ b/src/Contracts/Domain/Events/DomainEventDispatcher.php @@ -16,7 +16,6 @@ interface DomainEventDispatcher { /** * Dispatch a domain event. - * */ public function dispatch(DomainEvent $event): void; } diff --git a/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php b/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php index d31a4e85..899a17b0 100644 --- a/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php +++ b/src/Contracts/Infrastructure/OutboundEventBus/PublisherHandler.php @@ -18,7 +18,6 @@ interface PublisherHandler { /** * Handle the integration event. - * */ public function __invoke(IntegrationEvent $event): void; } diff --git a/src/Contracts/Infrastructure/Queue/Enqueuer.php b/src/Contracts/Infrastructure/Queue/Enqueuer.php index d8a7e4d3..b4856666 100644 --- a/src/Contracts/Infrastructure/Queue/Enqueuer.php +++ b/src/Contracts/Infrastructure/Queue/Enqueuer.php @@ -18,7 +18,6 @@ interface Enqueuer { /** * Put the command on the queue. - * */ public function __invoke(Command $command): void; } diff --git a/src/Contracts/Toolkit/Identifiers/Identifier.php b/src/Contracts/Toolkit/Identifiers/Identifier.php index 8f5e0100..dd7acd5c 100644 --- a/src/Contracts/Toolkit/Identifiers/Identifier.php +++ b/src/Contracts/Toolkit/Identifiers/Identifier.php @@ -19,13 +19,11 @@ interface Identifier extends Stringable, Contextual { /** * Is the identifier the same as the provided identifier? - * */ public function is(?self $other): bool; /** * Fluent to-string method. - * */ public function toString(): string; diff --git a/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php b/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php index 7b3ff6a1..0fafbc7b 100644 --- a/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php +++ b/src/Contracts/Toolkit/Identifiers/IdentifierFactory.php @@ -16,7 +16,6 @@ interface IdentifierFactory { /** * Make an identifier. - * */ public function make(mixed $id): Identifier; } diff --git a/src/Contracts/Toolkit/Identifiers/UuidFactory.php b/src/Contracts/Toolkit/Identifiers/UuidFactory.php index 61f15304..6de5bc13 100644 --- a/src/Contracts/Toolkit/Identifiers/UuidFactory.php +++ b/src/Contracts/Toolkit/Identifiers/UuidFactory.php @@ -22,7 +22,6 @@ interface UuidFactory { /** * Create a UUID identifier from an identifier or a base UUID interface. - * */ public function from(Identifier|UuidInterface $uuid): Uuid; diff --git a/src/Contracts/Toolkit/Iterables/KeyedSet.php b/src/Contracts/Toolkit/Iterables/KeyedSet.php index 411a97e4..54cd9c66 100644 --- a/src/Contracts/Toolkit/Iterables/KeyedSet.php +++ b/src/Contracts/Toolkit/Iterables/KeyedSet.php @@ -30,13 +30,11 @@ public function all(): array; /** * Is the set empty? - * */ public function isEmpty(): bool; /** * Is the set not empty? - * */ public function isNotEmpty(): bool; } diff --git a/src/Contracts/Toolkit/Iterables/ListIterator.php b/src/Contracts/Toolkit/Iterables/ListIterator.php index bd4f2d0c..34c7f63a 100644 --- a/src/Contracts/Toolkit/Iterables/ListIterator.php +++ b/src/Contracts/Toolkit/Iterables/ListIterator.php @@ -30,13 +30,11 @@ public function all(): array; /** * Is the list empty? - * */ public function isEmpty(): bool; /** * Is the list not empty? - * */ public function isNotEmpty(): bool; } diff --git a/src/Contracts/Toolkit/Loggable/Contextual.php b/src/Contracts/Toolkit/Loggable/Contextual.php index 67693368..2325b959 100644 --- a/src/Contracts/Toolkit/Loggable/Contextual.php +++ b/src/Contracts/Toolkit/Loggable/Contextual.php @@ -16,7 +16,6 @@ interface Contextual { /** * Get the value to use when adding the value to log context. - * */ public function context(): mixed; } diff --git a/src/Contracts/Toolkit/Pipeline/PipeContainer.php b/src/Contracts/Toolkit/Pipeline/PipeContainer.php index 85befe5f..1da6e639 100644 --- a/src/Contracts/Toolkit/Pipeline/PipeContainer.php +++ b/src/Contracts/Toolkit/Pipeline/PipeContainer.php @@ -16,7 +16,6 @@ interface PipeContainer { /** * Get a pipe by its name. - * */ public function get(string $pipeName): callable; } diff --git a/src/Contracts/Toolkit/Pipeline/Pipeline.php b/src/Contracts/Toolkit/Pipeline/Pipeline.php index 2da02f9f..e15885f2 100644 --- a/src/Contracts/Toolkit/Pipeline/Pipeline.php +++ b/src/Contracts/Toolkit/Pipeline/Pipeline.php @@ -16,19 +16,16 @@ interface Pipeline { /** * Process the payload. - * */ public function __invoke(mixed $payload): mixed; /** * Create a new pipeline with the appended stage. - * */ public function pipe(callable $stage): self; /** * Process the payload through the pipeline. - * */ public function process(mixed $payload): mixed; } diff --git a/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php b/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php index dc11da07..0137106b 100644 --- a/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php +++ b/src/Contracts/Toolkit/Pipeline/PipelineBuilder.php @@ -31,7 +31,6 @@ public function through(iterable $stages): static; /** * Build a new pipeline. - * */ public function build(?Processor $processor = null): Pipeline; } diff --git a/src/Contracts/Toolkit/Pipeline/Processor.php b/src/Contracts/Toolkit/Pipeline/Processor.php index 43c797d5..7172850b 100644 --- a/src/Contracts/Toolkit/Pipeline/Processor.php +++ b/src/Contracts/Toolkit/Pipeline/Processor.php @@ -16,7 +16,6 @@ interface Processor { /** * Process the payload through the provided stages. - * */ public function process(mixed $payload, callable ...$stages): mixed; } diff --git a/src/Contracts/Toolkit/Result/Error.php b/src/Contracts/Toolkit/Result/Error.php index d9064ab3..ee53affd 100644 --- a/src/Contracts/Toolkit/Result/Error.php +++ b/src/Contracts/Toolkit/Result/Error.php @@ -18,25 +18,21 @@ interface Error { /** * Get the error key. - * */ public function key(): string|UnitEnum|null; /** * Get the error detail. - * */ public function message(): string; /** * Get the error code. - * */ public function code(): ?UnitEnum; /** * Is the error the specified error code? - * */ public function is(UnitEnum $code): bool; } diff --git a/src/Contracts/Toolkit/Result/ListOfErrors.php b/src/Contracts/Toolkit/Result/ListOfErrors.php index bc0a7e2b..f69642c3 100644 --- a/src/Contracts/Toolkit/Result/ListOfErrors.php +++ b/src/Contracts/Toolkit/Result/ListOfErrors.php @@ -44,7 +44,6 @@ public function codes(): array; /** * Get the first error code in the list. - * */ public function code(): ?UnitEnum; diff --git a/src/Contracts/Toolkit/Result/Result.php b/src/Contracts/Toolkit/Result/Result.php index ba7132f3..38424a0a 100644 --- a/src/Contracts/Toolkit/Result/Result.php +++ b/src/Contracts/Toolkit/Result/Result.php @@ -49,19 +49,16 @@ public function safe(): mixed; /** * Get the errors. - * */ public function errors(): IListOfErrors; /** * Get an error message string. - * */ public function error(): ?string; /** * Get the result meta. - * */ public function meta(): Meta; diff --git a/src/Testing/FakeDomainEventDispatcher.php b/src/Testing/FakeDomainEventDispatcher.php index a5532998..4eda5730 100644 --- a/src/Testing/FakeDomainEventDispatcher.php +++ b/src/Testing/FakeDomainEventDispatcher.php @@ -36,7 +36,6 @@ public function count(): int /** * Expect a single event to be dispatched and return it. - * */ public function sole(): DomainEvent { diff --git a/src/Testing/FakeExceptionReporter.php b/src/Testing/FakeExceptionReporter.php index 1478aedb..18f9bfb7 100644 --- a/src/Testing/FakeExceptionReporter.php +++ b/src/Testing/FakeExceptionReporter.php @@ -36,7 +36,6 @@ public function count(): int /** * Expect a single exception to be reported and return it. - * */ public function sole(): Throwable { diff --git a/src/Testing/FakeOutboundEventPublisher.php b/src/Testing/FakeOutboundEventPublisher.php index f82017ff..a340e275 100644 --- a/src/Testing/FakeOutboundEventPublisher.php +++ b/src/Testing/FakeOutboundEventPublisher.php @@ -36,7 +36,6 @@ public function count(): int /** * Expect a single event to be published and return it. - * */ public function sole(): IntegrationEvent { diff --git a/src/Testing/FakeQueue.php b/src/Testing/FakeQueue.php index bb10f87f..8f38576d 100644 --- a/src/Testing/FakeQueue.php +++ b/src/Testing/FakeQueue.php @@ -36,7 +36,6 @@ public function count(): int /** * Expect a single command to be queued and return it. - * */ public function sole(): Command { diff --git a/src/Toolkit/Identifiers/Guid.php b/src/Toolkit/Identifiers/Guid.php index 31ad163a..c3258724 100644 --- a/src/Toolkit/Identifiers/Guid.php +++ b/src/Toolkit/Identifiers/Guid.php @@ -34,7 +34,6 @@ public static function from(Identifier $value): self /** * Create a GUID with an integer id. - * */ public static function fromInteger(string|UnitEnum $type, int $id): self { @@ -43,7 +42,6 @@ public static function fromInteger(string|UnitEnum $type, int $id): self /** * Create a GUID with a string id. - * */ public static function fromString(string|UnitEnum $type, string $id): self { @@ -52,7 +50,6 @@ public static function fromString(string|UnitEnum $type, string $id): self /** * Create a GUID for a UUID. - * */ public static function fromUuid(string|UnitEnum $type, string|Uuid|UuidInterface $uuid): self { @@ -61,7 +58,6 @@ public static function fromUuid(string|UnitEnum $type, string|Uuid|UuidInterface /** * Create a GUID. - * */ public static function make(string|UnitEnum $type, int|string|Uuid|UuidInterface $id): self { @@ -118,7 +114,6 @@ public function equals(self $other): bool /** * Fluent to-string method. - * */ public function toString(string $glue = ':'): string { diff --git a/src/Toolkit/Identifiers/GuidTypeMap.php b/src/Toolkit/Identifiers/GuidTypeMap.php index 5644b400..ed55e138 100644 --- a/src/Toolkit/Identifiers/GuidTypeMap.php +++ b/src/Toolkit/Identifiers/GuidTypeMap.php @@ -28,7 +28,6 @@ public function __construct(private array $map = []) /** * Define an alias to type mapping. - * */ public function define(string|UnitEnum $alias, string|UnitEnum $type): void { @@ -39,7 +38,6 @@ public function define(string|UnitEnum $alias, string|UnitEnum $type): void /** * Get the GUID for the specified alias and id. - * */ public function guidFor(string|UnitEnum $alias, int|string|Uuid|UuidInterface $id): Guid { @@ -48,7 +46,6 @@ public function guidFor(string|UnitEnum $alias, int|string|Uuid|UuidInterface $i /** * Get the GUID type for the specified alias. - * */ public function typeFor(string|UnitEnum $alias): string|UnitEnum { diff --git a/src/Toolkit/Identifiers/PossiblyNumericId.php b/src/Toolkit/Identifiers/PossiblyNumericId.php index d11f307e..64113059 100644 --- a/src/Toolkit/Identifiers/PossiblyNumericId.php +++ b/src/Toolkit/Identifiers/PossiblyNumericId.php @@ -40,7 +40,6 @@ public function __toString(): string /** * Fluent to-string method. - * */ public function toString(): string { diff --git a/src/Toolkit/Identifiers/Uuid.php b/src/Toolkit/Identifiers/Uuid.php index dda9f488..5e40d397 100644 --- a/src/Toolkit/Identifiers/Uuid.php +++ b/src/Toolkit/Identifiers/Uuid.php @@ -60,7 +60,6 @@ public static function tryFrom(IBaseUuid|Identifier|string|null $value): ?self /** * Generate a random UUID, useful in tests. - * */ public static function random(): self { @@ -69,7 +68,6 @@ public static function random(): self /** * Create a nil UUID. - * */ public static function nil(): self { diff --git a/src/Toolkit/ModuleBasename.php b/src/Toolkit/ModuleBasename.php index 1e733515..c2494efa 100644 --- a/src/Toolkit/ModuleBasename.php +++ b/src/Toolkit/ModuleBasename.php @@ -71,7 +71,6 @@ public function __toString(): string /** * Fluent to-string method. - * */ public function toString(string $delimiter = ':'): string { diff --git a/src/Toolkit/Pipeline/MiddlewareProcessor.php b/src/Toolkit/Pipeline/MiddlewareProcessor.php index 122655eb..c339e6c2 100644 --- a/src/Toolkit/Pipeline/MiddlewareProcessor.php +++ b/src/Toolkit/Pipeline/MiddlewareProcessor.php @@ -21,7 +21,6 @@ /** * Return a new middleware processor that calls the destination and returns the result. - * */ public static function wrap(callable $destination): self { @@ -30,7 +29,6 @@ public static function wrap(callable $destination): self /** * Return a new middleware processor that calls the destination without returning a result. - * */ public static function call(callable $destination): self { diff --git a/src/Toolkit/Pipeline/PipeContainer.php b/src/Toolkit/Pipeline/PipeContainer.php index 25312064..eff2526a 100644 --- a/src/Toolkit/Pipeline/PipeContainer.php +++ b/src/Toolkit/Pipeline/PipeContainer.php @@ -25,7 +25,6 @@ final class PipeContainer implements IPipeContainer /** * Bind a pipe into the container. - * */ public function bind(string $pipeName, Closure $factory): void { diff --git a/src/Toolkit/Result/KeyedSetOfErrors.php b/src/Toolkit/Result/KeyedSetOfErrors.php index c14b8a5b..3cdc3e49 100644 --- a/src/Toolkit/Result/KeyedSetOfErrors.php +++ b/src/Toolkit/Result/KeyedSetOfErrors.php @@ -54,7 +54,6 @@ public function __construct(IError ...$errors) /** * Return a new instance with the provided error added to the set of errors. - * */ public function put(IError $error): self { @@ -92,7 +91,6 @@ public function keys(): array /** * Get errors by key. - * */ public function get(string|UnitEnum $key): IListOfErrors { diff --git a/src/Toolkit/Result/Meta.php b/src/Toolkit/Result/Meta.php index 6bcce000..d6e2f73a 100644 --- a/src/Toolkit/Result/Meta.php +++ b/src/Toolkit/Result/Meta.php @@ -81,7 +81,6 @@ public function get(string $key, mixed $default = null): mixed /** * Does a value for the provided key exist? - * */ public function exists(string $key): bool { diff --git a/src/Toolkit/functions.php b/src/Toolkit/functions.php index b0869e5f..c8a568b7 100644 --- a/src/Toolkit/functions.php +++ b/src/Toolkit/functions.php @@ -18,7 +18,6 @@ if (!function_exists(__NAMESPACE__ . '\enum_value')) { /** * Return a scalar value for an enum. - * */ function enum_value(int|string|UnitEnum $value): int|string { @@ -33,7 +32,6 @@ function enum_value(int|string|UnitEnum $value): int|string if (!function_exists(__NAMESPACE__ . '\enum_string')) { /** * Return a string value for an enum. - * */ function enum_string(string|UnitEnum $value): string { diff --git a/tests/Unit/Application/DomainEventDispatching/TestListener.php b/tests/Unit/Application/DomainEventDispatching/TestListener.php index f38a4153..987fd2f7 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestListener.php +++ b/tests/Unit/Application/DomainEventDispatching/TestListener.php @@ -18,7 +18,6 @@ class TestListener { /** * Handle the event. - * */ public function handle(DomainEvent $event): void { diff --git a/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php b/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php index aa119d9b..30c6c8e7 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php +++ b/tests/Unit/Application/DomainEventDispatching/TestListenerAfterCommit.php @@ -19,7 +19,6 @@ class TestListenerAfterCommit implements DispatchAfterCommit { /** * Handle the event. - * */ public function handle(DomainEvent $event): void { diff --git a/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php b/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php index 471d30a0..bc40e727 100644 --- a/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php +++ b/tests/Unit/Application/DomainEventDispatching/TestListenerBeforeCommit.php @@ -19,7 +19,6 @@ class TestListenerBeforeCommit implements DispatchBeforeCommit { /** * Handle the event. - * */ public function handle(DomainEvent $event): void { diff --git a/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php b/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php index a745f968..2c40e8c9 100644 --- a/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php +++ b/tests/Unit/Application/UnitOfWork/UnitOfWorkManagerTest.php @@ -133,7 +133,6 @@ public function testItExecutesCallbackWhenTransactionFailsToCommit(): void /** * If any callbacks get registered by other callbacks, they are executed. - * */ public function testItExecutesAdditionalCommitCallbacks(): void { @@ -279,7 +278,6 @@ public function testItFlushesCallbacksOnUnsuccessfulTransaction(): void * However, in this scenario any callbacks that were registered before the exception * is thrown should be forgotten. Otherwise, if the callback is retried, the before * callbacks will be executed twice. - * */ public function testItHandlesCallbackExecutingMultipleTimes(): void { @@ -369,7 +367,6 @@ function () use (&$sequence): void { * commit of the inner transaction. They should not be executed more than once, * because any that are registered on one of the failed attempts should havbe been * forgotten. - * */ public function testItHandlesUnitOfWorkFailingMultipleTimes(): void { diff --git a/tests/Unit/Domain/TestEntity.php b/tests/Unit/Domain/TestEntity.php index b5c008f4..4541d3b8 100644 --- a/tests/Unit/Domain/TestEntity.php +++ b/tests/Unit/Domain/TestEntity.php @@ -22,7 +22,6 @@ /** * TestEntity constructor. - * */ public function __construct(Identifier $id, private string $name = 'John Doe') { @@ -31,7 +30,6 @@ public function __construct(Identifier $id, private string $name = 'John Doe') /** * Get the entity's name. - * */ public function getName(): string { diff --git a/tests/Unit/Domain/TestEntityWithNullableId.php b/tests/Unit/Domain/TestEntityWithNullableId.php index c27f80b5..bb773598 100644 --- a/tests/Unit/Domain/TestEntityWithNullableId.php +++ b/tests/Unit/Domain/TestEntityWithNullableId.php @@ -22,7 +22,6 @@ class TestEntityWithNullableId implements Entity /** * TestEntityWithNullableGuid constructor. - * */ public function __construct(?Identifier $id = null) { diff --git a/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php b/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php index cfd55152..02c2dec8 100644 --- a/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php +++ b/tests/Unit/Infrastructure/OutboundEventBus/TestPublisher.php @@ -16,7 +16,6 @@ class TestPublisher { /** * Publish the integration event. - * */ public function publish(TestOutboundEvent $event): void {