Skip to content

Commit

Permalink
Merge pull request #5442 from dlubitz/90/task/explicit-nullable-param…
Browse files Browse the repository at this point in the history
…eter-84

TASK: Make nullable parameter explicit to become PHP 8.4 compatible
  • Loading branch information
dlubitz authored Jan 17, 2025
2 parents f638792 + ff97999 commit d6e578f
Show file tree
Hide file tree
Showing 58 changed files with 216 additions and 216 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public function getIngoingHierarchyRelationsForNodeAndSubgraph(
public function findIngoingHierarchyRelationsForNode(
NodeRelationAnchorPoint $childAnchorPoint,
ContentStreamId $contentStreamId,
DimensionSpacePointSet $restrictToSet = null
?DimensionSpacePointSet $restrictToSet = null
): array {
$ingoingHierarchyRelationsStatement = <<<SQL
SELECT
Expand Down Expand Up @@ -439,7 +439,7 @@ public function findIngoingHierarchyRelationsForNode(
public function findOutgoingHierarchyRelationsForNode(
NodeRelationAnchorPoint $parentAnchorPoint,
ContentStreamId $contentStreamId,
DimensionSpacePointSet $restrictToSet = null
?DimensionSpacePointSet $restrictToSet = null
): array {
$outgoingHierarchyRelationsStatement = <<<SQL
SELECT
Expand Down Expand Up @@ -512,7 +512,7 @@ public function findOutgoingHierarchyRelationsForNodeAggregate(
public function findIngoingHierarchyRelationsForNodeAggregate(
ContentStreamId $contentStreamId,
NodeAggregateId $nodeAggregateId,
DimensionSpacePointSet $dimensionSpacePointSet = null
?DimensionSpacePointSet $dimensionSpacePointSet = null
): array {
$ingoingHierarchyRelationsStatement = <<<SQL
SELECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function resetCommand(): void
* @param string|null $storeTrace The path to store the full trace in NDJSON format (optional).
* @internal
*/
public function analyzeTraceCommand(string $storeTrace = null): void
public function analyzeTraceCommand(?string $storeTrace = null): void
{
RedisInterleavingLogger::connect($this->configuration['redis']['host'], $this->configuration['redis']['port']);
$traces = RedisInterleavingLogger::getTraces();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public function getWeightedGeneralizations(DimensionSpacePoint $specialization):
public function getSpecializationSet(
DimensionSpacePoint $origin,
bool $includeOrigin = true,
DimensionSpacePointSet $excludedSet = null
?DimensionSpacePointSet $excludedSet = null
): DimensionSpacePointSet {
if (!$this->contentDimensionZookeeper->getAllowedDimensionSubspace()->contains($origin)) {
throw Exception\DimensionSpacePointNotFound::becauseItIsNotWithinTheAllowedDimensionSubspace($origin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ private function __construct(
*/
public static function create(
DecoratedEvent|EventInterface $event,
EventId $eventId = null,
EventMetadata|array $metadata = null,
EventId|CausationId $causationId = null,
CorrelationId $correlationId = null,
?EventId $eventId = null,
EventMetadata|array|null $metadata = null,
EventId|CausationId|null $causationId = null,
?CorrelationId $correlationId = null,
): self {
if ($event instanceof EventInterface) {
$event = new self($event, null, null, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private function __construct(
* @param SerializedPropertyValues|null $initialPropertyValues The node's initial property values (serialized). Will be merged over the node type's default property values
* @param SerializedNodeReferences|null $references The node's initial references (serialized).
*/
public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateId $parentNodeAggregateId, NodeAggregateId $succeedingSiblingNodeAggregateId = null, SerializedPropertyValues $initialPropertyValues = null, SerializedNodeReferences $references = null): self
public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateId $parentNodeAggregateId, ?NodeAggregateId $succeedingSiblingNodeAggregateId = null, ?SerializedPropertyValues $initialPropertyValues = null, ?SerializedNodeReferences $references = null): self
{
return new self($workspaceName, $nodeAggregateId, $nodeTypeName, $originDimensionSpacePoint, $parentNodeAggregateId, $initialPropertyValues ?? SerializedPropertyValues::createEmpty(), $succeedingSiblingNodeAggregateId, null, NodeAggregateIdsByNodePaths::createEmpty(), $references ?: SerializedNodeReferences::createEmpty());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ArrayNormalizer implements DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $data;
}

public function supportsDenormalization($data, $type, string $format = null)
public function supportsDenormalization($data, $type, ?string $format = null)
{
return $type === 'array';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class CollectionTypeDenormalizer implements
* @return array<int|string,mixed>
* @throws NotNormalizableValueException
*/
public function denormalize($data, string $type, string $format = null, array $context = []): array
public function denormalize($data, string $type, ?string $format = null, array $context = []): array
{
if ($this->serializer === null) {
throw new BadMethodCallException('Please set a serializer before calling denormalize()!', 1596463254);
Expand Down Expand Up @@ -72,7 +72,7 @@ public function denormalize($data, string $type, string $format = null, array $c
* {@inheritdoc}
* @param array<string,mixed> $context
*/
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool
{
if ($this->serializer === null) {
throw new BadMethodCallException(sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ final class ScalarNormalizer implements NormalizerInterface, DenormalizerInterfa
* @param array<string,mixed> $context
* @return int|float|bool|string
*/
public function normalize($object, string $format = null, array $context = []): mixed
public function normalize($object, ?string $format = null, array $context = []): mixed
{
return $object;
}

public function supportsNormalization($data, string $format = null)
public function supportsNormalization($data, ?string $format = null)
{
$type = TypeHandling::getTypeForValue($data);
return TypeHandling::isSimpleType($type) && !TypeHandling::isCollectionType($type);
Expand All @@ -31,12 +31,12 @@ public function supportsNormalization($data, string $format = null)
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $data;
}

public function supportsDenormalization($data, $type, string $format = null)
public function supportsDenormalization($data, $type, ?string $format = null)
{
return TypeHandling::isSimpleType($type) && !TypeHandling::isCollectionType($type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ final class UriNormalizer implements NormalizerInterface, DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function normalize($data, string $format = null, array $context = []): string
public function normalize($data, ?string $format = null, array $context = []): string
{
return (string)$data;
}

public function supportsNormalization($data, string $format = null)
public function supportsNormalization($data, ?string $format = null)
{
return $data instanceof Uri;
}

/**
* @param array<string,mixed> $context
*/
public function denormalize($data, string $type, string $format = null, array $context = [])
public function denormalize($data, string $type, ?string $format = null, array $context = [])
{
return new Uri($data);
}

public function supportsDenormalization($data, string $type, string $format = null)
public function supportsDenormalization($data, string $type, ?string $format = null)
{
return is_string($data) && $type === Uri::class;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ValueObjectArrayDenormalizer implements DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $type::fromArray($data);
}

public function supportsDenormalization($data, $type, string $format = null): bool
public function supportsDenormalization($data, $type, ?string $format = null): bool
{
return is_array($data) && class_exists($type) && method_exists($type, 'fromArray');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ValueObjectBoolDenormalizer implements DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $type::fromBool($data);
}

public function supportsDenormalization($data, $type, string $format = null): bool
public function supportsDenormalization($data, $type, ?string $format = null): bool
{
return is_bool($data) && class_exists($type) && method_exists($type, 'fromBool');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ValueObjectFloatDenormalizer implements DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $type::fromFloat($data);
}

public function supportsDenormalization($data, $type, string $format = null): bool
public function supportsDenormalization($data, $type, ?string $format = null): bool
{
return is_float($data) && class_exists($type) && method_exists($type, 'fromFloat');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ValueObjectIntDenormalizer implements DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $type::fromInt($data);
}

public function supportsDenormalization($data, $type, string $format = null): bool
public function supportsDenormalization($data, $type, ?string $format = null): bool
{
return is_int($data) && class_exists($type) && method_exists($type, 'fromInt');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ValueObjectStringDenormalizer implements DenormalizerInterface
/**
* @param array<string,mixed> $context
*/
public function denormalize($data, $type, string $format = null, array $context = [])
public function denormalize($data, $type, ?string $format = null, array $context = [])
{
return $type::fromString($data);
}

public function supportsDenormalization($data, $type, string $format = null): bool
public function supportsDenormalization($data, $type, ?string $format = null): bool
{
return is_string($data) && class_exists($type) && method_exists($type, 'fromString');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private function __construct(
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public static function create(
NodeTypeCriteria|string $nodeTypes = null
NodeTypeCriteria|string|null $nodeTypes = null
): self {
if (is_string($nodeTypes)) {
$nodeTypes = NodeTypeCriteria::fromFilterString($nodeTypes);
Expand All @@ -52,7 +52,7 @@ public static function fromFindAncestorNodesFilter(FindAncestorNodesFilter $filt
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public function with(
NodeTypeCriteria|string $nodeTypes = null
NodeTypeCriteria|string|null $nodeTypes = null
): self {
return self::create(
$nodeTypes ?? $this->nodeTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ private function __construct(
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public static function create(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string $nodePropertyValue = null,
SearchTerm|string $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string $referencePropertyValue = null,
ReferenceName|string $referenceName = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string|null $nodePropertyValue = null,
SearchTerm|string|null $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string|null $referencePropertyValue = null,
ReferenceName|string|null $referenceName = null,
): self {
if (is_string($nodeTypes)) {
$nodeTypes = NodeTypeCriteria::fromFilterString($nodeTypes);
Expand Down Expand Up @@ -89,12 +89,12 @@ public static function fromFindBackReferencesFilter(FindBackReferencesFilter $fi
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public function with(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string $nodePropertyValue = null,
SearchTerm|string $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string $referencePropertyValue = null,
ReferenceName|string $referenceName = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string|null $nodePropertyValue = null,
SearchTerm|string|null $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string|null $referencePropertyValue = null,
ReferenceName|string|null $referenceName = null,
): self {
return self::create(
$nodeTypes ?? $this->nodeTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ private function __construct(
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public static function create(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $searchTerm = null,
PropertyValueCriteriaInterface|string $propertyValue = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $searchTerm = null,
PropertyValueCriteriaInterface|string|null $propertyValue = null,
): self {
if (is_string($nodeTypes)) {
$nodeTypes = NodeTypeCriteria::fromFilterString($nodeTypes);
Expand All @@ -69,9 +69,9 @@ public static function fromFindChildNodesFilter(FindChildNodesFilter $filter): s
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public function with(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $searchTerm = null,
PropertyValueCriteriaInterface|string $propertyValue = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $searchTerm = null,
PropertyValueCriteriaInterface|string|null $propertyValue = null,
): self {
return self::create(
$nodeTypes ?? $this->nodeTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ private function __construct(
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public static function create(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $searchTerm = null,
PropertyValueCriteriaInterface|string $propertyValue = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $searchTerm = null,
PropertyValueCriteriaInterface|string|null $propertyValue = null,
): self {
if (is_string($nodeTypes)) {
$nodeTypes = NodeTypeCriteria::fromFilterString($nodeTypes);
Expand All @@ -69,9 +69,9 @@ public static function fromFindDescendantNodesFilter(FindDescendantNodesFilter $
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public function with(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $searchTerm = null,
PropertyValueCriteriaInterface|string $propertyValue = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $searchTerm = null,
PropertyValueCriteriaInterface|string|null $propertyValue = null,
): self {
return self::create(
$nodeTypes ?? $this->nodeTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ private function __construct(
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public static function create(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string $nodePropertyValue = null,
SearchTerm|string $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string $referencePropertyValue = null,
ReferenceName|string $referenceName = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string|null $nodePropertyValue = null,
SearchTerm|string|null $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string|null $referencePropertyValue = null,
ReferenceName|string|null $referenceName = null,
): self {
if (is_string($nodeTypes)) {
$nodeTypes = NodeTypeCriteria::fromFilterString($nodeTypes);
Expand Down Expand Up @@ -89,12 +89,12 @@ public static function fromFindReferencesFilter(FindReferencesFilter $filter): s
* @see https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
*/
public function with(
NodeTypeCriteria|string $nodeTypes = null,
SearchTerm|string $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string $nodePropertyValue = null,
SearchTerm|string $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string $referencePropertyValue = null,
ReferenceName|string $referenceName = null,
NodeTypeCriteria|string|null $nodeTypes = null,
SearchTerm|string|null $nodeSearchTerm = null,
PropertyValueCriteriaInterface|string|null $nodePropertyValue = null,
SearchTerm|string|null $referenceSearchTerm = null,
PropertyValueCriteriaInterface|string|null $referencePropertyValue = null,
ReferenceName|string|null $referenceName = null,
): self {
return self::create(
$nodeTypes ?? $this->nodeTypes,
Expand Down
Loading

0 comments on commit d6e578f

Please sign in to comment.