Skip to content

Commit 4bfdafc

Browse files
committed
Fix S
1 parent d6d550c commit 4bfdafc

4 files changed

Lines changed: 244 additions & 61 deletions

File tree

phpstan-baseline.neon

Lines changed: 210 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,102 @@ parameters:
66
count: 1
77
path: src/Console/DoctrineHelper.php
88

9+
-
10+
message: '#^Anonymous function should return Doctrine\\DBAL\\Connection but returns mixed\.$#'
11+
identifier: return.type
12+
count: 1
13+
path: src/Container/Factory.php
14+
15+
-
16+
message: '#^Anonymous function should return Patchlevel\\EventSourcing\\EventBus\\EventBus but returns mixed\.$#'
17+
identifier: return.type
18+
count: 1
19+
path: src/Container/Factory.php
20+
21+
-
22+
message: '#^Anonymous function should return Patchlevel\\EventSourcing\\Store\\Store but returns mixed\.$#'
23+
identifier: return.type
24+
count: 1
25+
path: src/Container/Factory.php
26+
27+
-
28+
message: '#^Anonymous function should return Psr\\Log\\LoggerInterface but returns mixed\.$#'
29+
identifier: return.type
30+
count: 1
31+
path: src/Container/Factory.php
32+
33+
-
34+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Console\\Command\\DatabaseCreateCommand constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: src/Container/Factory.php
38+
39+
-
40+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Console\\Command\\DatabaseDropCommand constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
41+
identifier: argument.type
42+
count: 1
43+
path: src/Container/Factory.php
44+
45+
-
46+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Cryptography\\ExtensionDoctrineCipherKeyStore constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
47+
identifier: argument.type
48+
count: 1
49+
path: src/Container/Factory.php
50+
51+
-
52+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Schema\\DoctrineSchemaDirector constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
53+
identifier: argument.type
54+
count: 1
55+
path: src/Container/Factory.php
56+
57+
-
58+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Store\\StreamDoctrineDbalStore constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
59+
identifier: argument.type
60+
count: 2
61+
path: src/Container/Factory.php
62+
63+
-
64+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Subscription\\Store\\DoctrineSubscriptionStore constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
65+
identifier: argument.type
66+
count: 1
67+
path: src/Container/Factory.php
68+
69+
-
70+
message: '#^Parameter \#1 \$strategies of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\RetryStrategyRepository constructor expects array\<string, Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\RetryStrategy\>, array\<string, mixed\> given\.$#'
71+
identifier: argument.type
72+
count: 1
73+
path: src/Container/Factory.php
74+
75+
-
76+
message: '#^Parameter \#2 \$baseDelay of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\ClockBasedRetryStrategy constructor expects int, mixed given\.$#'
77+
identifier: argument.type
78+
count: 1
79+
path: src/Container/Factory.php
80+
81+
-
82+
message: '#^Parameter \#2 \$newStore of class Patchlevel\\EventSourcing\\Console\\Command\\StoreMigrateCommand constructor expects Patchlevel\\EventSourcing\\Store\\Store, object given\.$#'
83+
identifier: argument.type
84+
count: 1
85+
path: src/Container/Factory.php
86+
87+
-
88+
message: '#^Parameter \#3 \$delayFactor of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\ClockBasedRetryStrategy constructor expects float, mixed given\.$#'
89+
identifier: argument.type
90+
count: 1
91+
path: src/Container/Factory.php
92+
93+
-
94+
message: '#^Parameter \#4 \$maxAttempts of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\ClockBasedRetryStrategy constructor expects int\<1, max\>, mixed given\.$#'
95+
identifier: argument.type
96+
count: 1
97+
path: src/Container/Factory.php
98+
99+
-
100+
message: '#^Strict comparison using \!\=\= between ''custom'' and ''custom'' will always evaluate to false\.$#'
101+
identifier: notIdentical.alwaysFalse
102+
count: 1
103+
path: src/Container/Factory.php
104+
9105
-
10106
message: '#^Parameter \#1 \$key of class Patchlevel\\Hydrator\\Cryptography\\Cipher\\CipherKey constructor expects non\-empty\-string, string given\.$#'
11107
identifier: argument.type
@@ -246,18 +342,6 @@ parameters:
246342
count: 1
247343
path: tests/Integration/BasicImplementation/BasicIntegrationTest.php
248344

249-
-
250-
message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\BasicImplementation\\Profile\:\:\$id is never read, only written\.$#'
251-
identifier: property.onlyWritten
252-
count: 1
253-
path: tests/Integration/BasicImplementation/Profile.php
254-
255-
-
256-
message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\BasicImplementation\\ProfileWithCommands\:\:\$id is never read, only written\.$#'
257-
identifier: property.onlyWritten
258-
count: 1
259-
path: tests/Integration/BasicImplementation/ProfileWithCommands.php
260-
261345
-
262346
message: '#^Cannot access offset ''name'' on array\<string, mixed\>\|false\.$#'
263347
identifier: offsetAccess.nonOffsetAccessible
@@ -372,6 +456,120 @@ parameters:
372456
count: 5
373457
path: tests/Unit/CommandBus/InstantRetryCommandBusTest.php
374458

459+
-
460+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\DebugCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\DebugCommand will always evaluate to true\.$#'
461+
identifier: staticMethod.alreadyNarrowedType
462+
count: 8
463+
path: tests/Unit/Container/FactoryTest.php
464+
465+
-
466+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\ShowAggregateCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\ShowAggregateCommand will always evaluate to true\.$#'
467+
identifier: staticMethod.alreadyNarrowedType
468+
count: 8
469+
path: tests/Unit/Container/FactoryTest.php
470+
471+
-
472+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\ShowCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\ShowCommand will always evaluate to true\.$#'
473+
identifier: staticMethod.alreadyNarrowedType
474+
count: 8
475+
path: tests/Unit/Container/FactoryTest.php
476+
477+
-
478+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionBootCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionBootCommand will always evaluate to true\.$#'
479+
identifier: staticMethod.alreadyNarrowedType
480+
count: 8
481+
path: tests/Unit/Container/FactoryTest.php
482+
483+
-
484+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionPauseCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionPauseCommand will always evaluate to true\.$#'
485+
identifier: staticMethod.alreadyNarrowedType
486+
count: 8
487+
path: tests/Unit/Container/FactoryTest.php
488+
489+
-
490+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionReactivateCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionReactivateCommand will always evaluate to true\.$#'
491+
identifier: staticMethod.alreadyNarrowedType
492+
count: 8
493+
path: tests/Unit/Container/FactoryTest.php
494+
495+
-
496+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionRemoveCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionRemoveCommand will always evaluate to true\.$#'
497+
identifier: staticMethod.alreadyNarrowedType
498+
count: 8
499+
path: tests/Unit/Container/FactoryTest.php
500+
501+
-
502+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionRunCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionRunCommand will always evaluate to true\.$#'
503+
identifier: staticMethod.alreadyNarrowedType
504+
count: 8
505+
path: tests/Unit/Container/FactoryTest.php
506+
507+
-
508+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionSetupCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionSetupCommand will always evaluate to true\.$#'
509+
identifier: staticMethod.alreadyNarrowedType
510+
count: 8
511+
path: tests/Unit/Container/FactoryTest.php
512+
513+
-
514+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionStatusCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionStatusCommand will always evaluate to true\.$#'
515+
identifier: staticMethod.alreadyNarrowedType
516+
count: 8
517+
path: tests/Unit/Container/FactoryTest.php
518+
519+
-
520+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\SubscriptionTeardownCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionTeardownCommand will always evaluate to true\.$#'
521+
identifier: staticMethod.alreadyNarrowedType
522+
count: 8
523+
path: tests/Unit/Container/FactoryTest.php
524+
525+
-
526+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Console\\\\Command\\\\WatchCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\WatchCommand will always evaluate to true\.$#'
527+
identifier: staticMethod.alreadyNarrowedType
528+
count: 8
529+
path: tests/Unit/Container/FactoryTest.php
530+
531+
-
532+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Metadata\\\\AggregateRoot\\\\AggregateRootRegistry'' and Patchlevel\\EventSourcing\\Metadata\\AggregateRoot\\AggregateRootRegistry will always evaluate to true\.$#'
533+
identifier: staticMethod.alreadyNarrowedType
534+
count: 8
535+
path: tests/Unit/Container/FactoryTest.php
536+
537+
-
538+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Metadata\\\\Event\\\\EventRegistry'' and Patchlevel\\EventSourcing\\Metadata\\Event\\EventRegistry will always evaluate to true\.$#'
539+
identifier: staticMethod.alreadyNarrowedType
540+
count: 8
541+
path: tests/Unit/Container/FactoryTest.php
542+
543+
-
544+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Metadata\\\\Message\\\\MessageHeaderRegistry'' and Patchlevel\\EventSourcing\\Metadata\\Message\\MessageHeaderRegistry will always evaluate to true\.$#'
545+
identifier: staticMethod.alreadyNarrowedType
546+
count: 8
547+
path: tests/Unit/Container/FactoryTest.php
548+
549+
-
550+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Repository\\\\MessageDecorator\\\\SplitStreamDecorator'' and Patchlevel\\EventSourcing\\Repository\\MessageDecorator\\SplitStreamDecorator will always evaluate to true\.$#'
551+
identifier: staticMethod.alreadyNarrowedType
552+
count: 8
553+
path: tests/Unit/Container/FactoryTest.php
554+
555+
-
556+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Serializer\\\\DefaultEventSerializer'' and Patchlevel\\EventSourcing\\Serializer\\DefaultEventSerializer will always evaluate to true\.$#'
557+
identifier: staticMethod.alreadyNarrowedType
558+
count: 8
559+
path: tests/Unit/Container/FactoryTest.php
560+
561+
-
562+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Store\\\\StreamDoctrineDbalStore'' and Patchlevel\\EventSourcing\\Store\\StreamDoctrineDbalStore will always evaluate to true\.$#'
563+
identifier: staticMethod.alreadyNarrowedType
564+
count: 8
565+
path: tests/Unit/Container/FactoryTest.php
566+
567+
-
568+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Subscription\\\\RetryStrategy\\\\RetryStrategyRepository'' and Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\RetryStrategyRepository will always evaluate to true\.$#'
569+
identifier: staticMethod.alreadyNarrowedType
570+
count: 1
571+
path: tests/Unit/Container/FactoryTest.php
572+
375573
-
376574
message: '#^Parameter \#1 \$data of static method Patchlevel\\EventSourcing\\Tests\\Unit\\Fixture\\Message\:\:fromArray\(\) expects array\{id\: string, text\: string, createdAt\: string\}, array\<mixed, mixed\> given\.$#'
377575
identifier: argument.type

src/Container/Configuration.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ public function withCommandHandlerProviders(array $commandHandlerProviders): sel
425425
}
426426

427427
/**
428-
* @param positive-int $defaultMaxRetries
428+
* @param positive-int $defaultMaxRetries
429429
* @param list<class-string<Throwable>> $defaultExceptions
430430
*/
431431
public function withCommandBusInstantRetry(
@@ -476,9 +476,7 @@ public function withSubscriptionCleanupTaskHandlers(array $subscriptionCleanupTa
476476
return $newConfiguration;
477477
}
478478

479-
/**
480-
* @param positive-int $maxAttempts
481-
*/
479+
/** @param positive-int $maxAttempts */
482480
public function withSubscriptionRetryDefaults(
483481
int $baseDelay = 5,
484482
float $delayFactor = 2.0,
@@ -491,8 +489,8 @@ public function withSubscriptionRetryDefaults(
491489
'base_delay' => $baseDelay,
492490
'delay_factor' => $delayFactor,
493491
'max_attempts' => $maxAttempts,
494-
]
495-
]
492+
],
493+
],
496494
]);
497495
}
498496

0 commit comments

Comments
 (0)