Skip to content

Commit

Permalink
Merge pull request #430 from patchlevel/update-cs
Browse files Browse the repository at this point in the history
update codestyle
  • Loading branch information
DavidBadura authored Dec 12, 2023
2 parents 3f7344b + 3fc4585 commit 01d5119
Show file tree
Hide file tree
Showing 301 changed files with 1,054 additions and 1,765 deletions.
30 changes: 11 additions & 19 deletions baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
<code>MetadataAwareProjectionHandler::class</code>
<code><![CDATA[new MetadataAwareProjectionHandler(
$projections,
$projectionHandler->metadataFactory()
$projectionHandler->metadataFactory(),
)]]></code>
</DeprecatedClass>
<DeprecatedInterface>
<code>ProjectionHandler</code>
<code>ProjectionHandler</code>
<code>ProjectionHandler</code>
<code>ProjectionHandler</code>
<code><![CDATA[non-empty-array<class-string<Projection>>]]></code>
<code><![CDATA[non-empty-array<class-string<Projection>>|null]]></code>
<code>private</code>
</DeprecatedInterface>
<InvalidOperand>
<code><![CDATA[$projectionHandler->projections()]]></code>
Expand All @@ -42,20 +41,17 @@
</file>
<file src="src/Console/Command/SchemaCreateCommand.php">
<DeprecatedInterface>
<code>SchemaManager|SchemaDirector</code>
<code>SchemaManager|SchemaDirector $schemaDirector</code>
<code>private</code>
</DeprecatedInterface>
</file>
<file src="src/Console/Command/SchemaDropCommand.php">
<DeprecatedInterface>
<code>SchemaManager|SchemaDirector</code>
<code>SchemaManager|SchemaDirector $schemaDirector</code>
<code>private</code>
</DeprecatedInterface>
</file>
<file src="src/Console/Command/SchemaUpdateCommand.php">
<DeprecatedInterface>
<code>SchemaManager|SchemaDirector</code>
<code>SchemaManager|SchemaDirector $schemaDirector</code>
<code>private</code>
</DeprecatedInterface>
</file>
<file src="src/Console/DoctrineHelper.php">
Expand Down Expand Up @@ -124,22 +120,20 @@
</file>
<file src="src/Pipeline/Source/StoreSource.php">
<DeprecatedInterface>
<code>PipelineStore</code>
<code>PipelineStore</code>
<code>private</code>
</DeprecatedInterface>
</file>
<file src="src/Pipeline/Target/ProjectionHandlerTarget.php">
<DeprecatedInterface>
<code>ProjectionHandler</code>
<code>ProjectionHandler</code>
<code>private</code>
</DeprecatedInterface>
</file>
<file src="src/Pipeline/Target/ProjectionTarget.php">
<DeprecatedClass>
<code>MetadataAwareProjectionHandler</code>
<code>new MetadataAwareProjectionHandler(
[$projection],
$projectionMetadataFactory
$projectionMetadataFactory,
)</code>
</DeprecatedClass>
<DeprecatedInterface>
Expand All @@ -149,7 +143,6 @@
<file src="src/Projection/MetadataAwareProjectionHandler.php">
<DeprecatedInterface>
<code>MetadataAwareProjectionHandler</code>
<code>iterable</code>
<code><![CDATA[iterable<Projection>]]></code>
<code><![CDATA[iterable<Projection>]]></code>
</DeprecatedInterface>
Expand All @@ -164,8 +157,7 @@
</file>
<file src="src/Projection/ProjectionListener.php">
<DeprecatedInterface>
<code>ProjectionHandler</code>
<code>ProjectionHandler</code>
<code>private</code>
</DeprecatedInterface>
</file>
<file src="src/Projection/Projector/InMemoryProjectorRepository.php">
Expand Down Expand Up @@ -270,7 +262,7 @@
<file src="tests/Benchmark/WriteEventsBench.php">
<DeprecatedClass>
<code>new MetadataAwareProjectionHandler(
[$profileProjection]
[$profileProjection],
)</code>
<code>new ProjectionListener($projectionRepository)</code>
</DeprecatedClass>
Expand Down Expand Up @@ -306,7 +298,7 @@
<file src="tests/Integration/Outbox/OutboxTest.php">
<DeprecatedClass>
<code>new MetadataAwareProjectionHandler(
[$profileProjection]
[$profileProjection],
)</code>
<code>new ProjectionListener($projectionRepository)</code>
</DeprecatedClass>
Expand Down
6 changes: 2 additions & 4 deletions src/Aggregate/AggregateRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

abstract class AggregateRoot
{
private static ?AggregateRootMetadataFactory $metadataFactory = null;
private static AggregateRootMetadataFactory|null $metadataFactory = null;

/** @var list<object> */
private array $uncommittedEvents = [];
Expand Down Expand Up @@ -63,9 +63,7 @@ final public function catchUp(array $events): void
}
}

/**
* @return list<object>
*/
/** @return list<object> */
final public function releaseEvents(): array
{
$events = $this->uncommittedEvents;
Expand Down
4 changes: 2 additions & 2 deletions src/Aggregate/ApplyMethodNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public function __construct(string $aggregate, string $event)
sprintf(
'Apply method in "%s" could not be found for the event "%s"',
$aggregate,
$event
)
$event,
),
);
}
}
5 changes: 1 addition & 4 deletions src/Attribute/Aggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
#[Attribute(Attribute::TARGET_CLASS)]
final class Aggregate
{
private string $name;

public function __construct(string $name)
public function __construct(private string $name)
{
$this->name = $name;
}

public function name(): string
Expand Down
16 changes: 4 additions & 12 deletions src/Attribute/Apply.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,13 @@
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Apply
{
/** @var class-string|null */
private ?string $eventClass;

/**
* @param class-string|null $eventClass
*/
public function __construct(?string $eventClass = null)
/** @param class-string|null $eventClass */
public function __construct(private string|null $eventClass = null)
{
$this->eventClass = $eventClass;
}

/**
* @return class-string|null
*/
public function eventClass(): ?string
/** @return class-string|null */
public function eventClass(): string|null
{
return $this->eventClass;
}
Expand Down
5 changes: 1 addition & 4 deletions src/Attribute/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
#[Attribute(Attribute::TARGET_CLASS)]
final class Event
{
private string $name;

public function __construct(string $name)
public function __construct(private string $name)
{
$this->name = $name;
}

public function name(): string
Expand Down
14 changes: 3 additions & 11 deletions src/Attribute/Handle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Handle
{
/** @var class-string */
private string $eventClass;

/**
* @param class-string $eventClass
*/
public function __construct(string $eventClass)
/** @param class-string $eventClass */
public function __construct(private string $eventClass)
{
$this->eventClass = $eventClass;
}

/**
* @return class-string
*/
/** @return class-string */
public function eventClass(): string
{
return $this->eventClass;
Expand Down
5 changes: 1 addition & 4 deletions src/Attribute/NormalizedName.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
#[Attribute(Attribute::TARGET_PROPERTY)]
final class NormalizedName
{
private string $name;

public function __construct(string $name)
public function __construct(private string $name)
{
$this->name = $name;
}

public function name(): string
Expand Down
13 changes: 3 additions & 10 deletions src/Attribute/Snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,21 @@
#[Attribute(Attribute::TARGET_CLASS)]
final class Snapshot
{
private string $name;
private ?int $batch;
private ?string $version;

public function __construct(string $name, ?int $batch = null, ?string $version = null)
public function __construct(private string $name, private int|null $batch = null, private string|null $version = null)
{
$this->name = $name;
$this->batch = $batch;
$this->version = $version;
}

public function name(): string
{
return $this->name;
}

public function batch(): ?int
public function batch(): int|null
{
return $this->batch;
}

public function version(): ?string
public function version(): string|null
{
return $this->version;
}
Expand Down
8 changes: 2 additions & 6 deletions src/Attribute/SuppressMissingApply.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ final class SuppressMissingApply
private array $suppressEvents = [];
private bool $suppressAll = false;

/**
* @param list<class-string>|self::ALL $suppress
*/
/** @param list<class-string>|self::ALL $suppress */
public function __construct(string|array $suppress)
{
if ($suppress === self::ALL) {
Expand All @@ -29,9 +27,7 @@ public function __construct(string|array $suppress)
$this->suppressEvents = $suppress;
}

/**
* @return list<class-string>
*/
/** @return list<class-string> */
public function suppressEvents(): array
{
return $this->suppressEvents;
Expand Down
4 changes: 1 addition & 3 deletions src/Clock/FrozenClock.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public function update(DateTimeImmutable $frozenDateTime): void
$this->frozenDateTime = $frozenDateTime;
}

/**
* @param positive-int $seconds
*/
/** @param positive-int $seconds */
public function sleep(int $seconds): void
{
$this->frozenDateTime = $this->frozenDateTime->modify(sprintf('+%s seconds', $seconds));
Expand Down
10 changes: 2 additions & 8 deletions src/Console/Command/DatabaseCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@

#[AsCommand(
'event-sourcing:database:create',
'create eventstore database'
'create eventstore database',
)]
final class DatabaseCreateCommand extends Command
{
private Store $store;
private DoctrineHelper $helper;

public function __construct(Store $store, DoctrineHelper $helper)
public function __construct(private Store $store, private DoctrineHelper $helper)
{
parent::__construct();

$this->store = $store;
$this->helper = $helper;
}

protected function configure(): void
Expand Down
10 changes: 2 additions & 8 deletions src/Console/Command/DatabaseDropCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@

#[AsCommand(
'event-sourcing:database:drop',
'drop eventstore database'
'drop eventstore database',
)]
final class DatabaseDropCommand extends Command
{
private Store $store;
private DoctrineHelper $helper;

public function __construct(Store $store, DoctrineHelper $helper)
public function __construct(private Store $store, private DoctrineHelper $helper)
{
parent::__construct();

$this->store = $store;
$this->helper = $helper;
}

protected function configure(): void
Expand Down
8 changes: 4 additions & 4 deletions src/Console/Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
#[AsCommand(
'event-sourcing:debug',
'show event sourcing debug information',
['debug:event-sourcing']
['debug:event-sourcing'],
)]
final class DebugCommand extends Command
{
public function __construct(
private readonly AggregateRootRegistry $aggregateRootRegistry,
private readonly EventRegistry $eventRegistry
private readonly EventRegistry $eventRegistry,
) {
parent::__construct();
}
Expand All @@ -48,7 +48,7 @@ private function showAggregates(OutputStyle $console): void

$console->table(
['name', 'class'],
array_map(null, array_keys($aggregates), array_values($aggregates))
array_map(null, array_keys($aggregates), array_values($aggregates)),
);
}

Expand All @@ -60,7 +60,7 @@ private function showEvents(OutputStyle $console): void

$console->table(
['name', 'class'],
array_map(null, array_keys($events), array_values($events))
array_map(null, array_keys($events), array_values($events)),
);
}
}
Loading

0 comments on commit 01d5119

Please sign in to comment.