Skip to content

Commit 5ac4502

Browse files
committed
fix cs
1 parent 844f09e commit 5ac4502

File tree

4 files changed

+23
-45
lines changed

4 files changed

+23
-45
lines changed

src/AggregateRoot.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Patchlevel\EventSourcing\Repository\Repository;
1010
use Patchlevel\EventSourcing\Repository\RepositoryManager;
1111

12+
use function app;
13+
1214
abstract class AggregateRoot extends BasicAggregateRoot
1315
{
1416
public static function load(AggregateRootId $id): static
@@ -26,9 +28,7 @@ public function save(): void
2628
self::repository()->save($this);
2729
}
2830

29-
/**
30-
* @return Repository<static>
31-
*/
31+
/** @return Repository<static> */
3232
public static function repository(): Repository
3333
{
3434
return app(RepositoryManager::class)->get(static::class);

src/EventSourcingServiceProvider.php

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@
9797
use Patchlevel\LaravelEventSourcing\Middleware\AutoSetupMiddleware;
9898
use Patchlevel\LaravelEventSourcing\Middleware\SubscriptionRebuildAfterFileChangeMiddleware;
9999

100+
use function app;
100101
use function array_key_exists;
102+
use function config;
103+
use function config_path;
104+
use function database_path;
105+
use function is_string;
101106
use function sprintf;
102107
use function str_starts_with;
103108

@@ -178,9 +183,7 @@ private function registerConnection(): void
178183
);
179184
}
180185

181-
/**
182-
* @var array<string, array{url: string|null, driver: string, database: string, username: string, password: string, host: string, port: int}> $connections
183-
*/
186+
/** @var array<string, array{url: string|null, driver: string, database: string, username: string, password: string, host: string, port: int}> $connections */
184187
$connections = config('database.connections');
185188

186189
/** @var string $connectionKey */
@@ -198,9 +201,7 @@ private function registerConnection(): void
198201
);
199202
}
200203

201-
/**
202-
* @var 'pdo_mysql'|'pdo_pgsql'|'pdo_sqlite' $driver
203-
*/
204+
/** @var 'pdo_mysql'|'pdo_pgsql'|'pdo_sqlite' $driver */
204205
$driver = match ($connectionParams['driver']) {
205206
'mysql', 'mariadb' => 'pdo_mysql',
206207
'pgsql' => 'pdo_pgsql',
@@ -224,15 +225,11 @@ private function registerConnection(): void
224225
private function registerStore(): void
225226
{
226227
$this->app->singleton(Store::class, static function () {
227-
/**
228-
* @var string $type
229-
*/
228+
/** @var string $type */
230229
$type = config('event-sourcing.store.type');
231230

232231
if ($type === 'custom') {
233-
/**
234-
* @var string $service
235-
*/
232+
/** @var string $service */
236233
$service = config('event-sourcing.store.service');
237234

238235
return app($service);
@@ -242,9 +239,7 @@ private function registerStore(): void
242239
return new InMemoryStore();
243240
}
244241

245-
/**
246-
* @var array<string, mixed> $options
247-
*/
242+
/** @var array<string, mixed> $options */
248243
$options = config('event-sourcing.store.options');
249244

250245
if ($type === 'dbal_aggregate') {
@@ -269,9 +264,7 @@ private function registerStore(): void
269264
throw new InvalidArgumentException(sprintf('Unknown store type "%s"', $type));
270265
});
271266

272-
/**
273-
* @var string $type
274-
*/
267+
/** @var string $type */
275268
$type = config('event-sourcing.store.type');
276269

277270
if (!str_starts_with($type, 'dbal_')) {
@@ -284,9 +277,7 @@ private function registerStore(): void
284277
private function registerSerializer(): void
285278
{
286279
$this->app->singleton(EventRegistry::class, static function () {
287-
/**
288-
* @var list<string> $paths
289-
*/
280+
/** @var list<string> $paths */
290281
$paths = config('event-sourcing.events');
291282

292283
return (new AttributeEventRegistryFactory())->create($paths);
@@ -448,9 +439,7 @@ private function registerDebugCommands(): void
448439

449440
private function registerUpcaster(): void
450441
{
451-
/**
452-
* @var class-string $class
453-
*/
442+
/** @var class-string $class */
454443
foreach (config('event-sourcing.upcaster') as $class) {
455444
$this->app->tag($class, 'event_sourcing.upcaster');
456445
}
@@ -464,9 +453,7 @@ private function registerUpcaster(): void
464453

465454
private function registerMessageDecorator(): void
466455
{
467-
/**
468-
* @var class-string $class
469-
*/
456+
/** @var class-string $class */
470457
foreach (config('event-sourcing.message_decorator') as $class) {
471458
$this->app->tag($class, 'event_sourcing.message_decorator');
472459
}
@@ -488,9 +475,7 @@ private function registerMessageDecorator(): void
488475

489476
private function registerEventBus(): void
490477
{
491-
/**
492-
* @var class-string $class
493-
*/
478+
/** @var class-string $class */
494479
foreach (config('event-sourcing.listeners') as $class) {
495480
$this->app->tag($class, 'event_sourcing.listener');
496481
}
@@ -529,9 +514,7 @@ private function registerSnapshots(): void
529514

530515
private function registerSubscription(): void
531516
{
532-
/**
533-
* @var class-string $class
534-
*/
517+
/** @var class-string $class */
535518
foreach (config('event-sourcing.subscribers') as $class) {
536519
$this->app->tag($class, 'event_sourcing.subscriber');
537520
}
@@ -559,9 +542,7 @@ private function registerSubscription(): void
559542

560543
$this->app->tag(SubscriptionStore::class, ['event_sourcing.doctrine_schema_configurator']);
561544

562-
/**
563-
* @var class-string $class
564-
*/
545+
/** @var class-string $class */
565546
foreach (config('event-sourcing.argument_resolvers') as $class) {
566547
$this->app->tag($class, 'event_sourcing.argument_resolver');
567548
}

src/Middleware/AutoSetupMiddleware.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ public function __construct(
2424
) {
2525
}
2626

27-
/**
28-
* @param Closure(Request): Response $next
29-
*/
27+
/** @param Closure(Request): Response $next */
3028
public function handle(Request $request, Closure $next): Response
3129
{
3230
$subscriptions = $this->subscriptionEngine->subscriptions(

src/Middleware/SubscriptionRebuildAfterFileChangeMiddleware.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Patchlevel\EventSourcing\Subscription\RunMode;
1515
use ReflectionClass;
1616

17+
use function cache;
1718
use function filemtime;
1819

1920
final class SubscriptionRebuildAfterFileChangeMiddleware
@@ -26,9 +27,7 @@ public function __construct(
2627
) {
2728
}
2829

29-
/**
30-
* @param Closure(Request): Response $next
31-
*/
30+
/** @param Closure(Request): Response $next */
3231
public function handle(Request $request, Closure $next): Response
3332
{
3433
$toRemove = [];

0 commit comments

Comments
 (0)