protected function parseTemplate(string
$class, array
$search =
[], array
$replace =
[], array
$data =
[]): string
{ // Retrieves the namespace part from the fully qualified class name.
$namespace =
trim(implode('\\',
array_slice(explode('\\',
$class), 0, -1
)), '\\'
);
$search[] = '<@php';
$search[] = '{namespace}';
$search[] = '{class}';
$replace[] = '<?php';
$replace[] =
$namespace;
$replace[] =
str_replace($namespace . '\\', '',
$class);
return str_replace($search,
$replace,
$this->
renderTemplate($data));
} /**
* Builds the contents for class being generated, doing all
* the replacements necessary, and alphabetically sorts the
* imports for a given template.
*/
protected function buildContent(string
$class): string
{ $template =
$this->
prepare($class);