We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 068e9c6 commit f3613a6Copy full SHA for f3613a6
src/Type/ServiceDynamicReturnTypeExtension.php
@@ -55,6 +55,12 @@ public function getTypeFromMethodCall(
55
if ($methodReflection->getName() === 'get') {
56
$service = $this->serviceMap->getService($serviceId);
57
if ($service instanceof DrupalServiceDefinition) {
58
+ // Work around Drupal misusing the SplString class for string
59
+ // pseudo-services such as 'app.root'.
60
+ // @see https://www.drupal.org/project/drupal/issues/3074585
61
+ if ($service->getClass() === 'SplString') {
62
+ return new StringType();
63
+ }
64
return new ObjectType($service->getClass() ?? $serviceId);
65
}
66
return $returnType;
0 commit comments