Skip to content

Commit 6fb044b

Browse files
committed
Fix S
1 parent a9e3edc commit 6fb044b

6 files changed

Lines changed: 246 additions & 63 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
3535
"doctrine/dbal": "^4.4.0",
3636
"doctrine/migrations": "^3.3.2",
37-
"patchlevel/hydrator": "^1.8.0",
37+
"patchlevel/hydrator": "^1.23.0",
3838
"patchlevel/worker": "^1.4.0",
3939
"psr/cache": "^2.0.0 || ^3.0.0",
4040
"psr/clock": "^1.0",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

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

39+
-
40+
message: '#^Anonymous function should return Doctrine\\DBAL\\Connection but returns mixed\.$#'
41+
identifier: return.type
42+
count: 1
43+
path: src/Container/Factory.php
44+
45+
-
46+
message: '#^Anonymous function should return Patchlevel\\EventSourcing\\EventBus\\EventBus but returns mixed\.$#'
47+
identifier: return.type
48+
count: 1
49+
path: src/Container/Factory.php
50+
51+
-
52+
message: '#^Anonymous function should return Patchlevel\\EventSourcing\\Store\\Store but returns mixed\.$#'
53+
identifier: return.type
54+
count: 1
55+
path: src/Container/Factory.php
56+
57+
-
58+
message: '#^Anonymous function should return Psr\\Log\\LoggerInterface but returns mixed\.$#'
59+
identifier: return.type
60+
count: 1
61+
path: src/Container/Factory.php
62+
63+
-
64+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Console\\Command\\DatabaseCreateCommand 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 \$connection of class Patchlevel\\EventSourcing\\Console\\Command\\DatabaseDropCommand constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
71+
identifier: argument.type
72+
count: 1
73+
path: src/Container/Factory.php
74+
75+
-
76+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Cryptography\\ExtensionDoctrineCipherKeyStore constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
77+
identifier: argument.type
78+
count: 1
79+
path: src/Container/Factory.php
80+
81+
-
82+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Schema\\DoctrineSchemaDirector constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
83+
identifier: argument.type
84+
count: 1
85+
path: src/Container/Factory.php
86+
87+
-
88+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Store\\StreamDoctrineDbalStore constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
89+
identifier: argument.type
90+
count: 2
91+
path: src/Container/Factory.php
92+
93+
-
94+
message: '#^Parameter \#1 \$connection of class Patchlevel\\EventSourcing\\Subscription\\Store\\DoctrineSubscriptionStore constructor expects Doctrine\\DBAL\\Connection, object given\.$#'
95+
identifier: argument.type
96+
count: 1
97+
path: src/Container/Factory.php
98+
99+
-
100+
message: '#^Parameter \#1 \$strategies of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\RetryStrategyRepository constructor expects array\<string, Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\RetryStrategy\>, array\<string, mixed\> given\.$#'
101+
identifier: argument.type
102+
count: 1
103+
path: src/Container/Factory.php
104+
105+
-
106+
message: '#^Parameter \#2 \$baseDelay of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\ClockBasedRetryStrategy constructor expects int, mixed given\.$#'
107+
identifier: argument.type
108+
count: 1
109+
path: src/Container/Factory.php
110+
111+
-
112+
message: '#^Parameter \#2 \$newStore of class Patchlevel\\EventSourcing\\Console\\Command\\StoreMigrateCommand constructor expects Patchlevel\\EventSourcing\\Store\\Store, object given\.$#'
113+
identifier: argument.type
114+
count: 1
115+
path: src/Container/Factory.php
116+
117+
-
118+
message: '#^Parameter \#3 \$delayFactor of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\ClockBasedRetryStrategy constructor expects float, mixed given\.$#'
119+
identifier: argument.type
120+
count: 1
121+
path: src/Container/Factory.php
122+
123+
-
124+
message: '#^Parameter \#4 \$maxAttempts of class Patchlevel\\EventSourcing\\Subscription\\RetryStrategy\\ClockBasedRetryStrategy constructor expects int\<1, max\>, mixed given\.$#'
125+
identifier: argument.type
126+
count: 1
127+
path: src/Container/Factory.php
128+
129+
-
130+
message: '#^Strict comparison using \!\=\= between ''custom'' and ''custom'' will always evaluate to false\.$#'
131+
identifier: notIdentical.alwaysFalse
132+
count: 1
133+
path: src/Container/Factory.php
134+
39135
-
40136
message: '#^Parameter \#1 \$key of class Patchlevel\\Hydrator\\Cryptography\\Cipher\\CipherKey constructor expects non\-empty\-string, string given\.$#'
41137
identifier: argument.type
@@ -306,18 +402,6 @@ parameters:
306402
count: 1
307403
path: tests/Integration/BasicImplementation/BasicIntegrationTest.php
308404

309-
-
310-
message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\BasicImplementation\\Profile\:\:\$id is never read, only written\.$#'
311-
identifier: property.onlyWritten
312-
count: 1
313-
path: tests/Integration/BasicImplementation/Profile.php
314-
315-
-
316-
message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\BasicImplementation\\ProfileWithCommands\:\:\$id is never read, only written\.$#'
317-
identifier: property.onlyWritten
318-
count: 1
319-
path: tests/Integration/BasicImplementation/ProfileWithCommands.php
320-
321405
-
322406
message: '#^Cannot access offset ''name'' on array\<string, mixed\>\|false\.$#'
323407
identifier: offsetAccess.nonOffsetAccessible
@@ -432,6 +516,120 @@ parameters:
432516
count: 5
433517
path: tests/Unit/CommandBus/InstantRetryCommandBusTest.php
434518

519+
-
520+
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\.$#'
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\\\\ShowAggregateCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\ShowAggregateCommand 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\\\\Console\\\\Command\\\\ShowCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\ShowCommand 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\\\\Console\\\\Command\\\\SubscriptionBootCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionBootCommand 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\\\\Console\\\\Command\\\\SubscriptionPauseCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionPauseCommand 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\\\\Console\\\\Command\\\\SubscriptionReactivateCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionReactivateCommand 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\\\\Console\\\\Command\\\\SubscriptionRemoveCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionRemoveCommand 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\\\\Console\\\\Command\\\\SubscriptionRunCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionRunCommand 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\\\\Console\\\\Command\\\\SubscriptionSetupCommand'' and Patchlevel\\EventSourcing\\Console\\Command\\SubscriptionSetupCommand will always evaluate to true\.$#'
569+
identifier: staticMethod.alreadyNarrowedType
570+
count: 8
571+
path: tests/Unit/Container/FactoryTest.php
572+
573+
-
574+
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\.$#'
575+
identifier: staticMethod.alreadyNarrowedType
576+
count: 8
577+
path: tests/Unit/Container/FactoryTest.php
578+
579+
-
580+
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\.$#'
581+
identifier: staticMethod.alreadyNarrowedType
582+
count: 8
583+
path: tests/Unit/Container/FactoryTest.php
584+
585+
-
586+
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\.$#'
587+
identifier: staticMethod.alreadyNarrowedType
588+
count: 8
589+
path: tests/Unit/Container/FactoryTest.php
590+
591+
-
592+
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\.$#'
593+
identifier: staticMethod.alreadyNarrowedType
594+
count: 8
595+
path: tests/Unit/Container/FactoryTest.php
596+
597+
-
598+
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\.$#'
599+
identifier: staticMethod.alreadyNarrowedType
600+
count: 8
601+
path: tests/Unit/Container/FactoryTest.php
602+
603+
-
604+
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\.$#'
605+
identifier: staticMethod.alreadyNarrowedType
606+
count: 8
607+
path: tests/Unit/Container/FactoryTest.php
608+
609+
-
610+
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\.$#'
611+
identifier: staticMethod.alreadyNarrowedType
612+
count: 8
613+
path: tests/Unit/Container/FactoryTest.php
614+
615+
-
616+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Serializer\\\\DefaultEventSerializer'' and Patchlevel\\EventSourcing\\Serializer\\DefaultEventSerializer will always evaluate to true\.$#'
617+
identifier: staticMethod.alreadyNarrowedType
618+
count: 8
619+
path: tests/Unit/Container/FactoryTest.php
620+
621+
-
622+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Store\\\\StreamDoctrineDbalStore'' and Patchlevel\\EventSourcing\\Store\\StreamDoctrineDbalStore will always evaluate to true\.$#'
623+
identifier: staticMethod.alreadyNarrowedType
624+
count: 8
625+
path: tests/Unit/Container/FactoryTest.php
626+
627+
-
628+
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\.$#'
629+
identifier: staticMethod.alreadyNarrowedType
630+
count: 1
631+
path: tests/Unit/Container/FactoryTest.php
632+
435633
-
436634
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\.$#'
437635
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)