From 8d82f044ac7fcd9e4055a1202cbb7bb07e1785f0 Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Sun, 4 Aug 2024 05:44:10 -0400 Subject: [PATCH] add cs and update file headers --- .gitignore | 1 + .php-cs-fixer.php | 24 +++++++++++++++++ LICENSE | 2 +- composer.json | 26 ++++++++++--------- .../DoctrineTransactionMiddleware.php | 11 ++++++++ .../MessageHandlersLocatorPass.php | 11 ++++++++ .../PriorityTaggedServiceTrait.php | 8 +++--- .../MessageHandlerConfigurator.php | 14 ++++++++-- src/Envelope/Envelope.php | 11 ++++++++ src/Envelope/Message.php | 13 +++++++++- src/Envelope/Stamp/HandledStamp.php | 11 ++++++++ src/Envelope/Stamp/Stamp.php | 13 +++++++++- src/Envelope/Stamp/Stamps.php | 11 ++++++++ src/Error/MultipleHandlersForMessage.php | 13 +++++++++- src/Error/NoHandlerForMessage.php | 13 +++++++++- src/FlushableMessageBus.php | 11 ++++++++ src/Handler/MessageHandlersCountPolicy.php | 11 ++++++++ src/Handler/MessageHandlersLocator.php | 13 +++++++++- src/LazyMessageMessageBus.php | 11 ++++++++ src/MessageBus.php | 11 ++++++++ src/Middleware/HandlingMiddleware.php | 11 ++++++++ src/Middleware/LoggingMiddleware.php | 11 ++++++++ src/Middleware/Middleware.php | 11 ++++++++ src/Middleware/MiddlewareStack.php | 19 ++++++++++---- src/Middleware/NextMiddleware.php | 11 ++++++++ src/Middleware/NoneMiddleware.php | 11 ++++++++ src/Middleware/SomeMiddleware.php | 14 ++++++++-- src/NativeLazyMessageBus.php | 11 ++++++++ src/NativeMessageBus.php | 11 ++++++++ .../MessageHandlersLocatorPassTest.php | 20 ++++++++++---- tests/Envelope/EnvelopeTest.php | 11 ++++++++ tests/Envelope/Stamp/StampsTest.php | 15 +++++++++-- tests/Fixtures/AsMessageHandler.php | 11 ++++++++ tests/Fixtures/MyMessage.php | 11 ++++++++ tests/Fixtures/MyMessageHandler.php | 11 ++++++++ tests/Middleware/HandlingMiddlewareTest.php | 11 ++++++++ tests/Middleware/LoggingMiddlewareTest.php | 11 ++++++++ tests/Middleware/MiddlewareStackTest.php | 11 ++++++++ tests/NativeLazyMessageBusTest.php | 11 ++++++++ tests/NativeMessageBusTest.php | 13 +++++++++- 40 files changed, 447 insertions(+), 38 deletions(-) create mode 100644 .php-cs-fixer.php diff --git a/.gitignore b/.gitignore index 97d8517..ed25317 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor/ composer.lock /.phpunit.result.cache +/.php-cs-fixer.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..b16b654 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,24 @@ + + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; + +$finder = (new PhpCsFixer\Finder()) + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + 'header_comment' => ['header' => $header], + 'declare_strict_types' => true, + ]) + ->setFinder($finder) +; diff --git a/LICENSE b/LICENSE index fc326ca..0c393ac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023-present Yonel Ceruto Gonzalez +Copyright (c) 2024-present Yonel Ceruto Gonzalez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index 1eeed2f..0d7ea92 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,16 @@ "email": "open@yceruto.dev" } ], + "autoload": { + "psr-4": { + "OpenSolid\\Bus\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "OpenSolid\\Tests\\Bus\\": "tests/" + } + }, "require": { "php": ">=8.2", "psr/container": "^2.0", @@ -20,20 +30,12 @@ "phpunit/phpunit": "^10.0", "psalm/plugin-phpunit": "^0.18", "symfony/dependency-injection": "^7.0", - "doctrine/orm": "^3.1" - }, - "autoload": { - "psr-4": { - "OpenSolid\\Bus\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "OpenSolid\\Tests\\Bus\\": "tests/" - } + "doctrine/orm": "^3.1", + "friendsofphp/php-cs-fixer": "^3.54" }, "scripts": { "test": "vendor/bin/phpunit tests", - "psalm": "vendor/bin/psalm --show-info=true" + "psalm": "vendor/bin/psalm --show-info=true", + "cs": "vendor/bin/php-cs-fixer fix --allow-risky=yes" } } diff --git a/src/Bridge/Doctrine/Middleware/DoctrineTransactionMiddleware.php b/src/Bridge/Doctrine/Middleware/DoctrineTransactionMiddleware.php index 8d07a53..02b36a6 100644 --- a/src/Bridge/Doctrine/Middleware/DoctrineTransactionMiddleware.php +++ b/src/Bridge/Doctrine/Middleware/DoctrineTransactionMiddleware.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Bridge\Doctrine\Middleware; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPass.php b/src/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPass.php index e6f1a54..5897f56 100644 --- a/src/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPass.php +++ b/src/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPass.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Bridge\Symfony\DependencyInjection\CompilerPass; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; diff --git a/src/Bridge/Symfony/DependencyInjection/CompilerPass/PriorityTaggedServiceTrait.php b/src/Bridge/Symfony/DependencyInjection/CompilerPass/PriorityTaggedServiceTrait.php index cfc6282..a9310f8 100644 --- a/src/Bridge/Symfony/DependencyInjection/CompilerPass/PriorityTaggedServiceTrait.php +++ b/src/Bridge/Symfony/DependencyInjection/CompilerPass/PriorityTaggedServiceTrait.php @@ -1,9 +1,11 @@ + * (c) Yonel Ceruto * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -109,7 +111,7 @@ private function findAndSortTaggedServices(string|TaggedIteratorArgument $tagNam if (null === $index) { $refs[] = $reference; } elseif ($allowMultiple) { - /** @psalm-suppress UndefinedMethod */ + /* @psalm-suppress UndefinedMethod */ $refs[$index][] = $reference; } else { $refs[$index] = $reference; diff --git a/src/Bridge/Symfony/DependencyInjection/Configurator/MessageHandlerConfigurator.php b/src/Bridge/Symfony/DependencyInjection/Configurator/MessageHandlerConfigurator.php index b72ccab..3b0cb66 100644 --- a/src/Bridge/Symfony/DependencyInjection/Configurator/MessageHandlerConfigurator.php +++ b/src/Bridge/Symfony/DependencyInjection/Configurator/MessageHandlerConfigurator.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Bridge\Symfony\DependencyInjection\Configurator; -use ReflectionNamedType; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -32,7 +42,7 @@ function (ChildDefinition $definition, object $attribute, \Reflector $reflector) $type = $reflectionMethod->getParameters()[0]->getType(); - if (!$type instanceof ReflectionNamedType || $type->isBuiltin()) { + if (!$type instanceof \ReflectionNamedType || $type->isBuiltin()) { return; } diff --git a/src/Envelope/Envelope.php b/src/Envelope/Envelope.php index d27226a..cabcec6 100644 --- a/src/Envelope/Envelope.php +++ b/src/Envelope/Envelope.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Envelope; use OpenSolid\Bus\Envelope\Stamp\HandledStamp; diff --git a/src/Envelope/Message.php b/src/Envelope/Message.php index 7947b37..e2627ef 100644 --- a/src/Envelope/Message.php +++ b/src/Envelope/Message.php @@ -1,7 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Envelope; -readonly abstract class Message +abstract readonly class Message { } diff --git a/src/Envelope/Stamp/HandledStamp.php b/src/Envelope/Stamp/HandledStamp.php index 800268c..24a4a84 100644 --- a/src/Envelope/Stamp/HandledStamp.php +++ b/src/Envelope/Stamp/HandledStamp.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Envelope\Stamp; final readonly class HandledStamp extends Stamp diff --git a/src/Envelope/Stamp/Stamp.php b/src/Envelope/Stamp/Stamp.php index e8fb73a..9172022 100644 --- a/src/Envelope/Stamp/Stamp.php +++ b/src/Envelope/Stamp/Stamp.php @@ -1,7 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Envelope\Stamp; -readonly abstract class Stamp +abstract readonly class Stamp { } diff --git a/src/Envelope/Stamp/Stamps.php b/src/Envelope/Stamp/Stamps.php index a4419c9..f378b96 100644 --- a/src/Envelope/Stamp/Stamps.php +++ b/src/Envelope/Stamp/Stamps.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Envelope\Stamp; final class Stamps implements \Countable diff --git a/src/Error/MultipleHandlersForMessage.php b/src/Error/MultipleHandlersForMessage.php index bbe1f46..183c75f 100644 --- a/src/Error/MultipleHandlersForMessage.php +++ b/src/Error/MultipleHandlersForMessage.php @@ -1,10 +1,21 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Error; final class MultipleHandlersForMessage extends \LogicException { - public static function from(string $class, \Throwable $previous = null, int $code = 0): self + public static function from(string $class, ?\Throwable $previous = null, int $code = 0): self { return new self(sprintf('Message of type "%s" was handled multiple times. Only one handler is expected.', $class), $code, $previous); } diff --git a/src/Error/NoHandlerForMessage.php b/src/Error/NoHandlerForMessage.php index eecf576..85f148d 100644 --- a/src/Error/NoHandlerForMessage.php +++ b/src/Error/NoHandlerForMessage.php @@ -1,10 +1,21 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Error; final class NoHandlerForMessage extends \LogicException { - public static function from(string $class, \Throwable $previous = null, int $code = 0): self + public static function from(string $class, ?\Throwable $previous = null, int $code = 0): self { return new self(sprintf('No handler for message of type "%s".', $class), $code, $previous); } diff --git a/src/FlushableMessageBus.php b/src/FlushableMessageBus.php index fc6d5d7..e479bd0 100644 --- a/src/FlushableMessageBus.php +++ b/src/FlushableMessageBus.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus; /** diff --git a/src/Handler/MessageHandlersCountPolicy.php b/src/Handler/MessageHandlersCountPolicy.php index 74394c1..0876447 100644 --- a/src/Handler/MessageHandlersCountPolicy.php +++ b/src/Handler/MessageHandlersCountPolicy.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Handler; enum MessageHandlersCountPolicy diff --git a/src/Handler/MessageHandlersLocator.php b/src/Handler/MessageHandlersLocator.php index ef8e047..641b4fc 100644 --- a/src/Handler/MessageHandlersLocator.php +++ b/src/Handler/MessageHandlersLocator.php @@ -1,9 +1,20 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Handler; -use Psr\Container\ContainerInterface; use OpenSolid\Bus\Error\NoHandlerForMessage; +use Psr\Container\ContainerInterface; /** * Maps a message class to a list of handlers. diff --git a/src/LazyMessageMessageBus.php b/src/LazyMessageMessageBus.php index 9a8b049..2a0cd11 100644 --- a/src/LazyMessageMessageBus.php +++ b/src/LazyMessageMessageBus.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus; use OpenSolid\Bus\Envelope\Message; diff --git a/src/MessageBus.php b/src/MessageBus.php index 49ec7d9..4b82495 100644 --- a/src/MessageBus.php +++ b/src/MessageBus.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus; use OpenSolid\Bus\Envelope\Message; diff --git a/src/Middleware/HandlingMiddleware.php b/src/Middleware/HandlingMiddleware.php index eb8c320..2bd469d 100644 --- a/src/Middleware/HandlingMiddleware.php +++ b/src/Middleware/HandlingMiddleware.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/src/Middleware/LoggingMiddleware.php b/src/Middleware/LoggingMiddleware.php index 1853ec5..7463644 100644 --- a/src/Middleware/LoggingMiddleware.php +++ b/src/Middleware/LoggingMiddleware.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/src/Middleware/Middleware.php b/src/Middleware/Middleware.php index d2994fc..12c0dca 100644 --- a/src/Middleware/Middleware.php +++ b/src/Middleware/Middleware.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/src/Middleware/MiddlewareStack.php b/src/Middleware/MiddlewareStack.php index 01805de..2832cd4 100644 --- a/src/Middleware/MiddlewareStack.php +++ b/src/Middleware/MiddlewareStack.php @@ -1,9 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; -use Generator; -use Iterator; use OpenSolid\Bus\Envelope\Envelope; /** @@ -21,8 +30,8 @@ public function __construct( public function handle(Envelope $envelope): void { - /** @var Iterator $iterator */ - $iterator = (fn (): Generator => yield from $this->middlewares)(); + /** @var \Iterator $iterator */ + $iterator = (fn (): \Generator => yield from $this->middlewares)(); if (!$iterator->valid()) { return; @@ -31,7 +40,7 @@ public function handle(Envelope $envelope): void $iterator->current()->handle($envelope, $this->next($iterator)); } - private function next(Iterator $iterator): NextMiddleware + private function next(\Iterator $iterator): NextMiddleware { $iterator->next(); diff --git a/src/Middleware/NextMiddleware.php b/src/Middleware/NextMiddleware.php index b4957f4..1e6de0e 100644 --- a/src/Middleware/NextMiddleware.php +++ b/src/Middleware/NextMiddleware.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/src/Middleware/NoneMiddleware.php b/src/Middleware/NoneMiddleware.php index 53759f7..01a8f8a 100644 --- a/src/Middleware/NoneMiddleware.php +++ b/src/Middleware/NoneMiddleware.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/src/Middleware/SomeMiddleware.php b/src/Middleware/SomeMiddleware.php index 8aa6bae..fb48b44 100644 --- a/src/Middleware/SomeMiddleware.php +++ b/src/Middleware/SomeMiddleware.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus\Middleware; -use Closure; use OpenSolid\Bus\Envelope\Envelope; /** @@ -12,7 +22,7 @@ { public function __construct( private Middleware $middleware, - private Closure $next, + private \Closure $next, ) { } diff --git a/src/NativeLazyMessageBus.php b/src/NativeLazyMessageBus.php index 2e455b5..2c31d05 100644 --- a/src/NativeLazyMessageBus.php +++ b/src/NativeLazyMessageBus.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus; use OpenSolid\Bus\Envelope\Message; diff --git a/src/NativeMessageBus.php b/src/NativeMessageBus.php index 49c68d9..b4ee372 100644 --- a/src/NativeMessageBus.php +++ b/src/NativeMessageBus.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Bus; use OpenSolid\Bus\Envelope\Envelope; diff --git a/tests/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPassTest.php b/tests/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPassTest.php index 5c913c8..07a680a 100644 --- a/tests/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPassTest.php +++ b/tests/Bridge/Symfony/DependencyInjection/CompilerPass/MessageHandlersLocatorPassTest.php @@ -1,12 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Bridge\Symfony\DependencyInjection\CompilerPass; -use PHPUnit\Framework\TestCase; -use Symfony\Component\DependencyInjection\Argument\AbstractArgument; -use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; -use Symfony\Component\DependencyInjection\Compiler\AttributeAutoconfigurationPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; use OpenSolid\Bus\Bridge\Symfony\DependencyInjection\CompilerPass\MessageHandlersLocatorPass; use OpenSolid\Bus\Bridge\Symfony\DependencyInjection\Configurator\MessageHandlerConfigurator; use OpenSolid\Bus\Handler\MessageHandlersCountPolicy; @@ -14,6 +20,10 @@ use OpenSolid\Tests\Bus\Fixtures\AsMessageHandler; use OpenSolid\Tests\Bus\Fixtures\MyMessage; use OpenSolid\Tests\Bus\Fixtures\MyMessageHandler; +use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\Argument\AbstractArgument; +use Symfony\Component\DependencyInjection\Compiler\AttributeAutoconfigurationPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; class MessageHandlersLocatorPassTest extends TestCase { diff --git a/tests/Envelope/EnvelopeTest.php b/tests/Envelope/EnvelopeTest.php index 50ebc89..b6ab61a 100644 --- a/tests/Envelope/EnvelopeTest.php +++ b/tests/Envelope/EnvelopeTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Envelope; use OpenSolid\Bus\Envelope\Envelope; diff --git a/tests/Envelope/Stamp/StampsTest.php b/tests/Envelope/Stamp/StampsTest.php index dc76fec..6f08579 100644 --- a/tests/Envelope/Stamp/StampsTest.php +++ b/tests/Envelope/Stamp/StampsTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Envelope\Stamp; use OpenSolid\Bus\Envelope\Stamp\HandledStamp; @@ -56,7 +67,7 @@ public function testFilter(): void $this->assertCount(2, $stamps); - $fn = fn(HandledStamp $stamp): bool => $stamp->result; + $fn = fn (HandledStamp $stamp): bool => $stamp->result; $stamps = $stamps->filter(HandledStamp::class, $fn); $this->assertCount(1, $stamps); @@ -71,7 +82,7 @@ public function testMap(): void $this->assertCount(2, $stamps); - $fn = fn(HandledStamp $stamp): bool => $stamp->result; + $fn = fn (HandledStamp $stamp): bool => $stamp->result; $results = $stamps->map(HandledStamp::class, $fn); $this->assertSame([true, false], $results); diff --git a/tests/Fixtures/AsMessageHandler.php b/tests/Fixtures/AsMessageHandler.php index 5abb36a..dc8021c 100644 --- a/tests/Fixtures/AsMessageHandler.php +++ b/tests/Fixtures/AsMessageHandler.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Fixtures; #[\Attribute(\Attribute::TARGET_CLASS)] diff --git a/tests/Fixtures/MyMessage.php b/tests/Fixtures/MyMessage.php index 61641e7..7dc0b47 100644 --- a/tests/Fixtures/MyMessage.php +++ b/tests/Fixtures/MyMessage.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Fixtures; use OpenSolid\Bus\Envelope\Message; diff --git a/tests/Fixtures/MyMessageHandler.php b/tests/Fixtures/MyMessageHandler.php index dc7cb43..4971551 100644 --- a/tests/Fixtures/MyMessageHandler.php +++ b/tests/Fixtures/MyMessageHandler.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Fixtures; #[AsMessageHandler] diff --git a/tests/Middleware/HandlingMiddlewareTest.php b/tests/Middleware/HandlingMiddlewareTest.php index 314d74c..de95b8b 100644 --- a/tests/Middleware/HandlingMiddlewareTest.php +++ b/tests/Middleware/HandlingMiddlewareTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/tests/Middleware/LoggingMiddlewareTest.php b/tests/Middleware/LoggingMiddlewareTest.php index 7488a72..5deaf03 100644 --- a/tests/Middleware/LoggingMiddlewareTest.php +++ b/tests/Middleware/LoggingMiddlewareTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/tests/Middleware/MiddlewareStackTest.php b/tests/Middleware/MiddlewareStackTest.php index 45c1919..f10aa77 100644 --- a/tests/Middleware/MiddlewareStackTest.php +++ b/tests/Middleware/MiddlewareStackTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus\Middleware; use OpenSolid\Bus\Envelope\Envelope; diff --git a/tests/NativeLazyMessageBusTest.php b/tests/NativeLazyMessageBusTest.php index e3a980e..bbddd59 100644 --- a/tests/NativeLazyMessageBusTest.php +++ b/tests/NativeLazyMessageBusTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus; use OpenSolid\Bus\Middleware\Middleware; diff --git a/tests/NativeMessageBusTest.php b/tests/NativeMessageBusTest.php index c5feb08..10505b2 100644 --- a/tests/NativeMessageBusTest.php +++ b/tests/NativeMessageBusTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace OpenSolid\Tests\Bus; use OpenSolid\Bus\Handler\MessageHandlersLocator; @@ -12,7 +23,7 @@ class NativeMessageBusTest extends TestCase { public function testDispatch(): void { - $handler = static fn(MyMessage $message): MyMessage => $message; + $handler = static fn (MyMessage $message): MyMessage => $message; $bus = new NativeMessageBus([ new HandlingMiddleware(new MessageHandlersLocator([ MyMessage::class => [$handler],