foreach ($methodDocs as $methodDoc) { $this->injectedServices
[ ltrim((string) $methodDoc->
getReturnType(), '\\'
) ] =
$methodDoc->
getMethodName();
} } public function generate(): array
{ $scriptServices =
$this->
findScriptServices();
$data =
$this->
getServicesData($scriptServices);
$originalLoader =
$this->twig->
getLoader();
$this->twig->
setLoader(new ArrayLoader([ 'service-reference.md.twig' =>
file_get_contents(self::TEMPLATE_FILE
),
]));
$result =
[];
try { foreach ($data as $group) { $result[self::GENERATED_DOC_FILE .
$group['fileName'
]] =
$this->twig->
render('service-reference.md.twig',
$group);
}