Skip to content

Commit 272d63e

Browse files
authored
Merge pull request #39 from arnedesmedt/feature/php8.4-remove-deprecations
Remove php8.4 deprecations
2 parents 181f6f3 + f9102ac commit 272d63e

File tree

9 files changed

+30
-30
lines changed

9 files changed

+30
-30
lines changed

examples/FunctionalFlavour/Api/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function canCreate(string $commandName): bool
3636
return array_key_exists($commandName, self::CLASS_MAP);
3737
}
3838

39-
public static function createFromNameAndPayload(string $commandName, array $payload, array $metadata = null)
39+
public static function createFromNameAndPayload(string $commandName, array $payload, ?array $metadata = null)
4040
{
4141
$class = self::CLASS_MAP[$commandName];
4242

src/Aggregate/GenericAggregateRepository.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public function __construct(
5454
Flavour $flavour,
5555
EventStore $eventStore,
5656
string $streamName,
57-
DocumentStore $documentStore = null,
58-
string $aggregateCollection = null,
59-
string $multiStoreMode = null
57+
?DocumentStore $documentStore = null,
58+
?string $aggregateCollection = null,
59+
?string $multiStoreMode = null
6060
) {
6161
$this->flavour = $flavour;
6262
$this->eventStore = $eventStore;
@@ -140,7 +140,7 @@ public function getAggregateRoot(
140140
string $aggregateType,
141141
string $aggregateId,
142142
array $eventApplyMap,
143-
int $expectedVersion = null
143+
?int $expectedVersion = null
144144
): ?FlavouredAggregateRoot {
145145
$documentStore = $this->getDocumentStore();
146146

@@ -207,7 +207,7 @@ public function getAggregateRootUntil(
207207
string $aggregateType,
208208
string $aggregateId,
209209
array $eventApplyMap,
210-
int $maxVersion = null
210+
?int $maxVersion = null
211211
): ?FlavouredAggregateRoot {
212212
$streamEvents = $this->eventStore->loadAggregateEvents($this->streamName, $aggregateType, $aggregateId, 1, $maxVersion);
213213

src/Commanding/CommandDispatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function exec(
5353
bool $autoProject,
5454
MessageProducer $eventQueue,
5555
EventEngine $eventEngine,
56-
DocumentStore $documentStore = null,
56+
?DocumentStore $documentStore = null,
5757
array $contextProviders = [],
5858
array $services = [],
5959
bool $forwardMetadata = false

src/Commanding/CommandProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function fromDescriptionArraysAndDependencies(
118118
EventStore $eventStore,
119119
LogEngine $logEngine,
120120
EventEngine $eventEngine,
121-
DocumentStore $documentStore = null,
121+
?DocumentStore $documentStore = null,
122122
$contextProviders = [],
123123
array $services = [],
124124
$forwardMetadata = false
@@ -194,8 +194,8 @@ private function __construct(
194194
array $services,
195195
bool $forwardMetadata,
196196
array $contextProviders,
197-
DocumentStore $documentStore = null,
198-
string $aggregateCollection = null
197+
?DocumentStore $documentStore = null,
198+
?string $aggregateCollection = null
199199
) {
200200
$this->commandName = $commandName;
201201
$this->aggregateType = $aggregateType;

src/EventEngine.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ public static function fromCachedConfig(
268268
EventStore $eventStore,
269269
LogEngine $logEngine,
270270
ContainerInterface $container,
271-
DocumentStore $documentStore = null,
272-
MessageProducer $eventQueue = null
271+
?DocumentStore $documentStore = null,
272+
?MessageProducer $eventQueue = null
273273
): self {
274274
$self = new self($schema);
275275

@@ -472,7 +472,7 @@ public function registerEvent(string $eventName, PayloadSchema $schema): self
472472
return $this;
473473
}
474474

475-
public function registerQuery(string $queryName, PayloadSchema $payloadSchema = null): QueryDescription
475+
public function registerQuery(string $queryName, ?PayloadSchema $payloadSchema = null): QueryDescription
476476
{
477477
$this->assertNotInitialized(__METHOD__);
478478

@@ -511,12 +511,12 @@ public function registerProjection(string $projectionName, ProjectionDescription
511511
$this->projectionMap[$projectionName] = $projectionDescription;
512512
}
513513

514-
public function registerType(string $nameOrImmutableRecordClass, ResponseTypeSchema $schema = null): void
514+
public function registerType(string $nameOrImmutableRecordClass, ?ResponseTypeSchema $schema = null): void
515515
{
516516
$this->registerResponseType($nameOrImmutableRecordClass, $schema);
517517
}
518518

519-
public function registerResponseType(string $nameOrImmutableRecordClass, ResponseTypeSchema $schema = null): void
519+
public function registerResponseType(string $nameOrImmutableRecordClass, ?ResponseTypeSchema $schema = null): void
520520
{
521521
$this->assertNotInitialized(__METHOD__);
522522

@@ -543,7 +543,7 @@ public function registerResponseType(string $nameOrImmutableRecordClass, Respons
543543
$this->typeSchemaMap->add($name, $schema);
544544
}
545545

546-
public function registerInputType(string $nameOrImmutableRecordClass, InputTypeSchema $schema = null): void
546+
public function registerInputType(string $nameOrImmutableRecordClass, ?InputTypeSchema $schema = null): void
547547
{
548548
$this->assertNotInitialized(__METHOD__);
549549

@@ -740,8 +740,8 @@ public function initialize(
740740
EventStore $eventStore,
741741
LogEngine $logEngine,
742742
ContainerInterface $container,
743-
DocumentStore $documentStore = null,
744-
MessageProducer $eventQueue = null
743+
?DocumentStore $documentStore = null,
744+
?MessageProducer $eventQueue = null
745745
): self {
746746
$this->assertNotInitialized(__METHOD__);
747747

@@ -1020,7 +1020,7 @@ public function rebuildAggregateState(string $aggregateType, string $aggregateId
10201020
}
10211021
}
10221022

1023-
public function loadAggregateState(string $aggregateType, string $aggregateId, int $expectedVersion = null)
1023+
public function loadAggregateState(string $aggregateType, string $aggregateId, ?int $expectedVersion = null)
10241024
{
10251025
$this->assertBootstrapped(__METHOD__);
10261026

@@ -1050,7 +1050,7 @@ public function loadAggregateEvents(
10501050
string $aggregateType,
10511051
string $aggregateId,
10521052
int $minVersion = 1,
1053-
int $maxVersion = null
1053+
?int $maxVersion = null
10541054
): \Iterator
10551055
{
10561056
$this->assertBootstrapped(__METHOD__);
@@ -1075,7 +1075,7 @@ public function loadAggregateEvents(
10751075
}
10761076

10771077

1078-
public function loadAggregateStateUntil(string $aggregateType, string $aggregateId, int $maxVersion = null)
1078+
public function loadAggregateStateUntil(string $aggregateType, string $aggregateId, ?int $maxVersion = null)
10791079
{
10801080
$this->assertBootstrapped(__METHOD__);
10811081

@@ -1090,7 +1090,7 @@ public function loadAggregateStateUntil(string $aggregateType, string $aggregate
10901090
return $aggregate->currentState();
10911091
}
10921092

1093-
private function loadAggregateRoot(string $aggregateType, string $aggregateId, int $expectedVersion = null, bool $forceReplay = false)
1093+
private function loadAggregateRoot(string $aggregateType, string $aggregateId, ?int $expectedVersion = null, bool $forceReplay = false)
10941094
{
10951095
$aggregateDesc = $this->aggregateDescriptions[$aggregateType];
10961096

@@ -1135,7 +1135,7 @@ private function loadAggregateRoot(string $aggregateType, string $aggregateId, i
11351135
* @param int $maxVersion
11361136
* @return FlavouredAggregateRoot
11371137
*/
1138-
private function loadAggregateRootUntil(string $aggregateType, string $aggregateId, int $maxVersion = null): FlavouredAggregateRoot
1138+
private function loadAggregateRootUntil(string $aggregateType, string $aggregateId, ?int $maxVersion = null): FlavouredAggregateRoot
11391139
{
11401140
$aggregateDesc = $this->aggregateDescriptions[$aggregateType];
11411141

@@ -1330,7 +1330,7 @@ public function cacheAggregateState(string $aggregateType, string $aggregateId,
13301330
* @param int|null $expectedVersion
13311331
* @return null|mixed Null is returned if no state is cached, otherwise the cached process state
13321332
*/
1333-
public function loadAggregateStateFromCache(string $aggregateType, string $aggregateId, int $expectedVersion = null)
1333+
public function loadAggregateStateFromCache(string $aggregateType, string $aggregateId, ?int $expectedVersion = null)
13341334
{
13351335
$cache = $this->aggregateCache[$aggregateType][$aggregateId] ?? null;
13361336
if (!$cache) {

src/Projecting/ProjectionInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function fromDescriptionArray(array $desc): self
7474
);
7575
}
7676

77-
private function __construct(string $name, string $version, StreamCollection $sourceStreams, string $aggregateTypeFilter = null, array $eventsFilter = null)
77+
private function __construct(string $name, string $version, StreamCollection $sourceStreams, ?string $aggregateTypeFilter = null, ?array $eventsFilter = null)
7878
{
7979
$this->name = $name;
8080
$this->version = $version;

src/Runtime/FunctionalFlavour.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final class FunctionalFlavour implements Flavour, MessageFactoryAware
6363
*/
6464
private $aggregateMetadataProvider;
6565

66-
public function __construct(Port $port, DataConverter $dataConverter = null, MetadataProvider $metadataProvider = null)
66+
public function __construct(Port $port, ?DataConverter $dataConverter = null, ?MetadataProvider $metadataProvider = null)
6767
{
6868
$this->port = $port;
6969

src/Runtime/PrototypingFlavour.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ final class PrototypingFlavour implements Flavour, MessageFactoryAware
6262
*/
6363
private $aggregateMetadataProvider;
6464

65-
public function __construct(DataConverter $dataConverter = null, MetadataProvider $metadataProvider = null)
65+
public function __construct(?DataConverter $dataConverter = null, ?MetadataProvider $metadataProvider = null)
6666
{
6767
if (null === $dataConverter) {
6868
$dataConverter = new ImmutableRecordDataConverter();

tests/EventEngineTestAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ protected function setUpRegisteredUsersProjector(
185185
}
186186

187187
protected function initializeEventEngine(
188-
LogEngine $logEngine = null,
189-
DocumentStore $documentStore = null,
190-
MessageProducer $eventQueue = null,
188+
?LogEngine $logEngine = null,
189+
?DocumentStore $documentStore = null,
190+
?MessageProducer $eventQueue = null,
191191
bool $autoProjecting = false,
192192
bool $forwardMetadata = false
193193
): void {

0 commit comments

Comments
 (0)