diff --git a/src/Console/Command/DatabaseCreateCommand.php b/src/Console/Command/DatabaseCreateCommand.php index 681310c55..e3378a482 100644 --- a/src/Console/Command/DatabaseCreateCommand.php +++ b/src/Console/Command/DatabaseCreateCommand.php @@ -17,7 +17,7 @@ use function sprintf; -class DatabaseCreateCommand extends Command +final class DatabaseCreateCommand extends Command { private Store $store; private DoctrineHelper $helper; diff --git a/src/Console/Command/DatabaseDropCommand.php b/src/Console/Command/DatabaseDropCommand.php index 0d22793d6..356287fc4 100644 --- a/src/Console/Command/DatabaseDropCommand.php +++ b/src/Console/Command/DatabaseDropCommand.php @@ -17,7 +17,7 @@ use function sprintf; -class DatabaseDropCommand extends Command +final class DatabaseDropCommand extends Command { private Store $store; private DoctrineHelper $helper; diff --git a/src/Console/Command/ProjectionCreateCommand.php b/src/Console/Command/ProjectionCreateCommand.php index 6567f7012..856bc5c1f 100644 --- a/src/Console/Command/ProjectionCreateCommand.php +++ b/src/Console/Command/ProjectionCreateCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -class ProjectionCreateCommand extends Command +final class ProjectionCreateCommand extends Command { private ProjectionRepository $projectionRepository; diff --git a/src/Console/Command/ProjectionDropCommand.php b/src/Console/Command/ProjectionDropCommand.php index a158aba63..134c78146 100644 --- a/src/Console/Command/ProjectionDropCommand.php +++ b/src/Console/Command/ProjectionDropCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -class ProjectionDropCommand extends Command +final class ProjectionDropCommand extends Command { private ProjectionRepository $projectionRepository; diff --git a/src/Console/Command/ProjectionRebuildCommand.php b/src/Console/Command/ProjectionRebuildCommand.php index 8a6c838d2..7a969d4f8 100644 --- a/src/Console/Command/ProjectionRebuildCommand.php +++ b/src/Console/Command/ProjectionRebuildCommand.php @@ -23,7 +23,7 @@ use function is_string; use function sprintf; -class ProjectionRebuildCommand extends Command +final class ProjectionRebuildCommand extends Command { private Store $store; private ProjectionRepository $projectionRepository; diff --git a/src/Console/Command/SchemaCreateCommand.php b/src/Console/Command/SchemaCreateCommand.php index 6e0cc8e13..f98a148d2 100644 --- a/src/Console/Command/SchemaCreateCommand.php +++ b/src/Console/Command/SchemaCreateCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -class SchemaCreateCommand extends Command +final class SchemaCreateCommand extends Command { private Store $store; private SchemaManager $schemaManager; diff --git a/src/Console/Command/SchemaDropCommand.php b/src/Console/Command/SchemaDropCommand.php index e967b9c03..4a86a82b6 100644 --- a/src/Console/Command/SchemaDropCommand.php +++ b/src/Console/Command/SchemaDropCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -class SchemaDropCommand extends Command +final class SchemaDropCommand extends Command { private Store $store; private SchemaManager $schemaManager; diff --git a/src/Console/Command/SchemaUpdateCommand.php b/src/Console/Command/SchemaUpdateCommand.php index 3716553c7..816f1c42a 100644 --- a/src/Console/Command/SchemaUpdateCommand.php +++ b/src/Console/Command/SchemaUpdateCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -class SchemaUpdateCommand extends Command +final class SchemaUpdateCommand extends Command { private Store $store; private SchemaManager $schemaManager; diff --git a/src/Console/Command/ShowCommand.php b/src/Console/Command/ShowCommand.php index 6eaeb49f3..b327a382d 100644 --- a/src/Console/Command/ShowCommand.php +++ b/src/Console/Command/ShowCommand.php @@ -19,7 +19,7 @@ use function count; use function sprintf; -class ShowCommand extends Command +final class ShowCommand extends Command { private Store $store; diff --git a/src/Console/Command/WatchCommand.php b/src/Console/Command/WatchCommand.php index 980248f51..3ac2d67fb 100644 --- a/src/Console/Command/WatchCommand.php +++ b/src/Console/Command/WatchCommand.php @@ -14,7 +14,7 @@ use function sprintf; -class WatchCommand extends Command +final class WatchCommand extends Command { private WatchServer $server; diff --git a/src/Console/DoctrineHelper.php b/src/Console/DoctrineHelper.php index ce5beca85..d21ebc914 100644 --- a/src/Console/DoctrineHelper.php +++ b/src/Console/DoctrineHelper.php @@ -10,6 +10,9 @@ use function in_array; +/** + * @final + */ class DoctrineHelper { public function databaseName(Connection $connection): string diff --git a/src/Console/EventPrinter.php b/src/Console/EventPrinter.php index 1e238f2c6..8c660c333 100644 --- a/src/Console/EventPrinter.php +++ b/src/Console/EventPrinter.php @@ -14,7 +14,7 @@ use const JSON_PRETTY_PRINT; use const JSON_THROW_ON_ERROR; -class EventPrinter +final class EventPrinter { public function write(SymfonyStyle $console, AggregateChanged $event): void { diff --git a/src/Pipeline/EventBucket.php b/src/Pipeline/EventBucket.php index 22622394c..7a2cdaed2 100644 --- a/src/Pipeline/EventBucket.php +++ b/src/Pipeline/EventBucket.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Aggregate\AggregateChanged; use Patchlevel\EventSourcing\Aggregate\AggregateRoot; -class EventBucket +final class EventBucket { /** @var class-string */ private string $aggregateClass; diff --git a/src/Pipeline/Middleware/ChainMiddleware.php b/src/Pipeline/Middleware/ChainMiddleware.php index 2e5ef3273..788ee232d 100644 --- a/src/Pipeline/Middleware/ChainMiddleware.php +++ b/src/Pipeline/Middleware/ChainMiddleware.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Pipeline\EventBucket; -class ChainMiddleware implements Middleware +final class ChainMiddleware implements Middleware { /** @var list */ private array $middlewares; diff --git a/src/Pipeline/Middleware/ClassRenameMiddleware.php b/src/Pipeline/Middleware/ClassRenameMiddleware.php index 7c44d05f5..fb3d0cff2 100644 --- a/src/Pipeline/Middleware/ClassRenameMiddleware.php +++ b/src/Pipeline/Middleware/ClassRenameMiddleware.php @@ -10,7 +10,7 @@ use function array_key_exists; use function get_class; -class ClassRenameMiddleware implements Middleware +final class ClassRenameMiddleware implements Middleware { /** @var array>>, class-string>>> */ private array $classes; diff --git a/src/Pipeline/Middleware/ExcludeEventMiddleware.php b/src/Pipeline/Middleware/ExcludeEventMiddleware.php index 491676a4f..48aa0215f 100644 --- a/src/Pipeline/Middleware/ExcludeEventMiddleware.php +++ b/src/Pipeline/Middleware/ExcludeEventMiddleware.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Aggregate\AggregateChanged; use Patchlevel\EventSourcing\Pipeline\EventBucket; -class ExcludeEventMiddleware implements Middleware +final class ExcludeEventMiddleware implements Middleware { /** @var list> */ private array $classes; diff --git a/src/Pipeline/Middleware/FilterEventMiddleware.php b/src/Pipeline/Middleware/FilterEventMiddleware.php index 67da8f8a6..71da73bb1 100644 --- a/src/Pipeline/Middleware/FilterEventMiddleware.php +++ b/src/Pipeline/Middleware/FilterEventMiddleware.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Aggregate\AggregateChanged; use Patchlevel\EventSourcing\Pipeline\EventBucket; -class FilterEventMiddleware implements Middleware +final class FilterEventMiddleware implements Middleware { /** @var callable(AggregateChanged $event):bool */ private $callable; diff --git a/src/Pipeline/Middleware/FromIndexEventMiddleware.php b/src/Pipeline/Middleware/FromIndexEventMiddleware.php index fc1259837..d72bcec67 100644 --- a/src/Pipeline/Middleware/FromIndexEventMiddleware.php +++ b/src/Pipeline/Middleware/FromIndexEventMiddleware.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Pipeline\EventBucket; -class FromIndexEventMiddleware implements Middleware +final class FromIndexEventMiddleware implements Middleware { private int $fromIndex; diff --git a/src/Pipeline/Middleware/IncludeEventMiddleware.php b/src/Pipeline/Middleware/IncludeEventMiddleware.php index 20811de1a..6f1cd9775 100644 --- a/src/Pipeline/Middleware/IncludeEventMiddleware.php +++ b/src/Pipeline/Middleware/IncludeEventMiddleware.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Aggregate\AggregateChanged; use Patchlevel\EventSourcing\Pipeline\EventBucket; -class IncludeEventMiddleware implements Middleware +final class IncludeEventMiddleware implements Middleware { /** @var list> */ private array $classes; diff --git a/src/Pipeline/Middleware/RecalculatePlayheadMiddleware.php b/src/Pipeline/Middleware/RecalculatePlayheadMiddleware.php index eedd322e4..1d43e81dd 100644 --- a/src/Pipeline/Middleware/RecalculatePlayheadMiddleware.php +++ b/src/Pipeline/Middleware/RecalculatePlayheadMiddleware.php @@ -12,7 +12,7 @@ use function array_key_exists; -class RecalculatePlayheadMiddleware implements Middleware +final class RecalculatePlayheadMiddleware implements Middleware { /** @var array, array> */ private array $index = []; diff --git a/src/Pipeline/Middleware/ReplaceEventMiddleware.php b/src/Pipeline/Middleware/ReplaceEventMiddleware.php index fd1441395..e53c5f092 100644 --- a/src/Pipeline/Middleware/ReplaceEventMiddleware.php +++ b/src/Pipeline/Middleware/ReplaceEventMiddleware.php @@ -12,7 +12,7 @@ /** * @template T of AggregateChanged */ -class ReplaceEventMiddleware implements Middleware +final class ReplaceEventMiddleware implements Middleware { /** @var class-string */ private string $class; diff --git a/src/Pipeline/Middleware/UntilEventMiddleware.php b/src/Pipeline/Middleware/UntilEventMiddleware.php index 7f5fef15f..64704db70 100644 --- a/src/Pipeline/Middleware/UntilEventMiddleware.php +++ b/src/Pipeline/Middleware/UntilEventMiddleware.php @@ -7,7 +7,7 @@ use DateTimeImmutable; use Patchlevel\EventSourcing\Pipeline\EventBucket; -class UntilEventMiddleware implements Middleware +final class UntilEventMiddleware implements Middleware { private DateTimeImmutable $until; diff --git a/src/Pipeline/Pipeline.php b/src/Pipeline/Pipeline.php index 2ea577509..73710a790 100644 --- a/src/Pipeline/Pipeline.php +++ b/src/Pipeline/Pipeline.php @@ -9,7 +9,7 @@ use Patchlevel\EventSourcing\Pipeline\Source\Source; use Patchlevel\EventSourcing\Pipeline\Target\Target; -class Pipeline +final class Pipeline { private Source $source; private Target $target; diff --git a/src/Pipeline/Source/InMemorySource.php b/src/Pipeline/Source/InMemorySource.php index eb4d8af6e..347398c69 100644 --- a/src/Pipeline/Source/InMemorySource.php +++ b/src/Pipeline/Source/InMemorySource.php @@ -9,7 +9,7 @@ use function count; -class InMemorySource implements Source +final class InMemorySource implements Source { /** @var list */ private array $events; diff --git a/src/Pipeline/Source/StoreSource.php b/src/Pipeline/Source/StoreSource.php index 43fa7ac1f..c53054fb0 100644 --- a/src/Pipeline/Source/StoreSource.php +++ b/src/Pipeline/Source/StoreSource.php @@ -8,7 +8,7 @@ use Patchlevel\EventSourcing\Pipeline\EventBucket; use Patchlevel\EventSourcing\Store\PipelineStore; -class StoreSource implements Source +final class StoreSource implements Source { private PipelineStore $store; private int $fromIndex; diff --git a/src/Pipeline/Target/InMemoryTarget.php b/src/Pipeline/Target/InMemoryTarget.php index f53456684..6ac231489 100644 --- a/src/Pipeline/Target/InMemoryTarget.php +++ b/src/Pipeline/Target/InMemoryTarget.php @@ -6,7 +6,7 @@ use Patchlevel\EventSourcing\Pipeline\EventBucket; -class InMemoryTarget implements Target +final class InMemoryTarget implements Target { /** @var list */ private array $buckets = []; diff --git a/src/Pipeline/Target/ProjectionRepositoryTarget.php b/src/Pipeline/Target/ProjectionRepositoryTarget.php index dc060e6d1..178eee7e2 100644 --- a/src/Pipeline/Target/ProjectionRepositoryTarget.php +++ b/src/Pipeline/Target/ProjectionRepositoryTarget.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Pipeline\EventBucket; use Patchlevel\EventSourcing\Projection\ProjectionRepository; -class ProjectionRepositoryTarget implements Target +final class ProjectionRepositoryTarget implements Target { private ProjectionRepository $projectionRepository; diff --git a/src/Pipeline/Target/ProjectionTarget.php b/src/Pipeline/Target/ProjectionTarget.php index e88949d3d..1705f51ef 100644 --- a/src/Pipeline/Target/ProjectionTarget.php +++ b/src/Pipeline/Target/ProjectionTarget.php @@ -8,7 +8,7 @@ use Patchlevel\EventSourcing\Projection\DefaultProjectionRepository; use Patchlevel\EventSourcing\Projection\Projection; -class ProjectionTarget implements Target +final class ProjectionTarget implements Target { private DefaultProjectionRepository $projectionRepository; diff --git a/src/Pipeline/Target/StoreTarget.php b/src/Pipeline/Target/StoreTarget.php index c5fd6439e..0207b8f0c 100644 --- a/src/Pipeline/Target/StoreTarget.php +++ b/src/Pipeline/Target/StoreTarget.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Pipeline\EventBucket; use Patchlevel\EventSourcing\Store\PipelineStore; -class StoreTarget implements Target +final class StoreTarget implements Target { private PipelineStore $store; diff --git a/src/Schema/DoctrineSchemaManager.php b/src/Schema/DoctrineSchemaManager.php index 7d8829b49..7ea0d9f3f 100644 --- a/src/Schema/DoctrineSchemaManager.php +++ b/src/Schema/DoctrineSchemaManager.php @@ -10,7 +10,7 @@ use function array_values; use function sprintf; -class DoctrineSchemaManager implements DryRunSchemaManager +final class DoctrineSchemaManager implements DryRunSchemaManager { public function create(Store $store): void { diff --git a/src/Snapshot/InMemorySnapshotStore.php b/src/Snapshot/InMemorySnapshotStore.php index c50d6d6ac..94a9273a9 100644 --- a/src/Snapshot/InMemorySnapshotStore.php +++ b/src/Snapshot/InMemorySnapshotStore.php @@ -7,7 +7,7 @@ use function array_key_exists; use function sprintf; -class InMemorySnapshotStore implements SnapshotStore +final class InMemorySnapshotStore implements SnapshotStore { /** @var array */ private array $snapshots = []; diff --git a/src/Snapshot/Psr16SnapshotStore.php b/src/Snapshot/Psr16SnapshotStore.php index 96b058d43..f62c376fb 100644 --- a/src/Snapshot/Psr16SnapshotStore.php +++ b/src/Snapshot/Psr16SnapshotStore.php @@ -8,7 +8,7 @@ use function sprintf; -class Psr16SnapshotStore implements SnapshotStore +final class Psr16SnapshotStore implements SnapshotStore { private CacheInterface $cache; diff --git a/src/Snapshot/Psr6SnapshotStore.php b/src/Snapshot/Psr6SnapshotStore.php index 81341c0f4..6583a6228 100644 --- a/src/Snapshot/Psr6SnapshotStore.php +++ b/src/Snapshot/Psr6SnapshotStore.php @@ -8,7 +8,7 @@ use function sprintf; -class Psr6SnapshotStore implements SnapshotStore +final class Psr6SnapshotStore implements SnapshotStore { private CacheItemPoolInterface $cache; diff --git a/src/WatchServer/WatchListener.php b/src/WatchServer/WatchListener.php index 42facb7f9..66746e685 100644 --- a/src/WatchServer/WatchListener.php +++ b/src/WatchServer/WatchListener.php @@ -7,7 +7,7 @@ use Patchlevel\EventSourcing\Aggregate\AggregateChanged; use Patchlevel\EventSourcing\EventBus\Listener; -class WatchListener implements Listener +final class WatchListener implements Listener { private WatchServerClient $client; diff --git a/src/WatchServer/WatchServer.php b/src/WatchServer/WatchServer.php index 3a6c30ac2..4fca0f7f8 100644 --- a/src/WatchServer/WatchServer.php +++ b/src/WatchServer/WatchServer.php @@ -21,6 +21,9 @@ use function strpos; use function unserialize; +/** + * @final + */ class WatchServer { private string $host; diff --git a/src/WatchServer/WatchServerClient.php b/src/WatchServer/WatchServerClient.php index 4c56b736b..e4e271266 100644 --- a/src/WatchServer/WatchServerClient.php +++ b/src/WatchServer/WatchServerClient.php @@ -20,6 +20,9 @@ use const STREAM_CLIENT_CONNECT; use const STREAM_SHUT_RDWR; +/** + * @final + */ class WatchServerClient { private string $host;