Skip to content

Commit c744140

Browse files
committed
Fix ServiceMethodsSubscriberTrait for nullable service
1 parent 465bd9d commit c744140

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ServiceSubscriberTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function getSubscribedServices(): array
5151
$attribute = $attribute->newInstance();
5252
$attribute->key ??= self::class.'::'.$method->name;
5353
$attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType;
54-
$attribute->nullable = $returnType->allowsNull();
54+
$attribute->nullable = $attribute->nullable ?: $returnType->allowsNull();
5555

5656
if ($attribute->attributes) {
5757
$services[] = $attribute;

0 commit comments

Comments
 (0)