We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc44027 commit a40eb00Copy full SHA for a40eb00
src/Subscriber/TestExecutor.php
@@ -145,9 +145,13 @@ private function prefixes(Location $location): array
145
"namespace TH\\Doctest\\Runtime\\{$source->getName()}{$extraNamespacePart}\\Example{$location->index}",
146
];
147
148
- $prefixes[] = $source instanceof \ReflectionFunctionAbstract
149
- ? "use {$source->getNamespaceName()}"
150
- : "use {$source->getName()}";
+ $fqcn = $source instanceof \ReflectionFunctionAbstract
+ ? $source->getNamespaceName()
+ : $source->getName();
151
+
152
+ if ($fqcn !== "") {
153
+ $prefixes[] = "use $fqcn;";
154
+ }
155
156
return $prefixes;
157
}
0 commit comments