diff --git a/build/stubGenerator.php b/build/stubGenerator.php index d93b8d2f2d6de..f4b899cdece1a 100644 --- a/build/stubGenerator.php +++ b/build/stubGenerator.php @@ -61,6 +61,7 @@ class StubGenerator extends CliApplication public function doExecute() { $this->createExtensionNamespaceMap(); + $contentsByNamespace = []; $file = "isInterface() && $reflection->isFinal()) ? 'final ' : ''; $modifier = ($reflection->isAbstract() && !$reflection->isInterface()) ? $modifier . 'abstract ' : $modifier; + $namespaceSegments = explode('\\', $oldName); + $className = array_pop($namespaceSegments); + $targetNamespace = ltrim(implode('\\', $namespaceSegments), '\\'); + // If a deprecated version is available, write a stub class doc block with a deprecated tag if ($deprecatedVersion !== false) { - $file .= << $contents) + { + $file .= "namespace $namespace {\n"; + $file .= $contents; + $file .= "}\n\n"; } // And save the file locally