Skip to content

Commit

Permalink
Merge pull request #113 from patchlevel/make-it-final
Browse files Browse the repository at this point in the history
make it final :)
  • Loading branch information
DanielBadura authored Dec 9, 2021
2 parents fe16d70 + 4ba1036 commit 603347c
Show file tree
Hide file tree
Showing 36 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/Console/Command/DatabaseCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use function sprintf;

class DatabaseCreateCommand extends Command
final class DatabaseCreateCommand extends Command
{
private Store $store;
private DoctrineHelper $helper;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/DatabaseDropCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use function sprintf;

class DatabaseDropCommand extends Command
final class DatabaseDropCommand extends Command
{
private Store $store;
private DoctrineHelper $helper;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/ProjectionCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/ProjectionDropCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/ProjectionRebuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/SchemaCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/SchemaDropCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/SchemaUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use function count;
use function sprintf;

class ShowCommand extends Command
final class ShowCommand extends Command
{
private Store $store;

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/WatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use function sprintf;

class WatchCommand extends Command
final class WatchCommand extends Command
{
private WatchServer $server;

Expand Down
3 changes: 3 additions & 0 deletions src/Console/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

use function in_array;

/**
* @final
*/
class DoctrineHelper
{
public function databaseName(Connection $connection): string
Expand Down
2 changes: 1 addition & 1 deletion src/Console/EventPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/EventBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Patchlevel\EventSourcing\Aggregate\AggregateChanged;
use Patchlevel\EventSourcing\Aggregate\AggregateRoot;

class EventBucket
final class EventBucket
{
/** @var class-string<AggregateRoot> */
private string $aggregateClass;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/ChainMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Patchlevel\EventSourcing\Pipeline\EventBucket;

class ChainMiddleware implements Middleware
final class ChainMiddleware implements Middleware
{
/** @var list<Middleware> */
private array $middlewares;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/ClassRenameMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<AggregateChanged<array<string, mixed>>>, class-string<AggregateChanged<array<string, mixed>>>> */
private array $classes;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/ExcludeEventMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<class-string<AggregateChanged>> */
private array $classes;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/FilterEventMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/FromIndexEventMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Patchlevel\EventSourcing\Pipeline\EventBucket;

class FromIndexEventMiddleware implements Middleware
final class FromIndexEventMiddleware implements Middleware
{
private int $fromIndex;

Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/IncludeEventMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<class-string<AggregateChanged>> */
private array $classes;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/RecalculatePlayheadMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use function array_key_exists;

class RecalculatePlayheadMiddleware implements Middleware
final class RecalculatePlayheadMiddleware implements Middleware
{
/** @var array<class-string<AggregateRoot>, array<string, int>> */
private array $index = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/ReplaceEventMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* @template T of AggregateChanged
*/
class ReplaceEventMiddleware implements Middleware
final class ReplaceEventMiddleware implements Middleware
{
/** @var class-string<T> */
private string $class;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Middleware/UntilEventMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use DateTimeImmutable;
use Patchlevel\EventSourcing\Pipeline\EventBucket;

class UntilEventMiddleware implements Middleware
final class UntilEventMiddleware implements Middleware
{
private DateTimeImmutable $until;

Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Source/InMemorySource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use function count;

class InMemorySource implements Source
final class InMemorySource implements Source
{
/** @var list<EventBucket> */
private array $events;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Source/StoreSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Target/InMemoryTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Patchlevel\EventSourcing\Pipeline\EventBucket;

class InMemoryTarget implements Target
final class InMemoryTarget implements Target
{
/** @var list<EventBucket> */
private array $buckets = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Target/ProjectionRepositoryTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Target/ProjectionTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/Target/StoreTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Schema/DoctrineSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Snapshot/InMemorySnapshotStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function array_key_exists;
use function sprintf;

class InMemorySnapshotStore implements SnapshotStore
final class InMemorySnapshotStore implements SnapshotStore
{
/** @var array<string, Snapshot> */
private array $snapshots = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Snapshot/Psr16SnapshotStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use function sprintf;

class Psr16SnapshotStore implements SnapshotStore
final class Psr16SnapshotStore implements SnapshotStore
{
private CacheInterface $cache;

Expand Down
2 changes: 1 addition & 1 deletion src/Snapshot/Psr6SnapshotStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use function sprintf;

class Psr6SnapshotStore implements SnapshotStore
final class Psr6SnapshotStore implements SnapshotStore
{
private CacheItemPoolInterface $cache;

Expand Down
2 changes: 1 addition & 1 deletion src/WatchServer/WatchListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions src/WatchServer/WatchServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
use function strpos;
use function unserialize;

/**
* @final
*/
class WatchServer
{
private string $host;
Expand Down
3 changes: 3 additions & 0 deletions src/WatchServer/WatchServerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
use const STREAM_CLIENT_CONNECT;
use const STREAM_SHUT_RDWR;

/**
* @final
*/
class WatchServerClient
{
private string $host;
Expand Down

0 comments on commit 603347c

Please sign in to comment.