Move helpers to root

To get them in the namespace.
This commit is contained in:
Barry vd. Heuvel
2014-03-20 16:20:31 +01:00
parent 348ecb361c
commit 16f77638f1
@@ -193,23 +193,25 @@ class GeneratorCommand extends Command {
}
}
foreach ($output as $ns => $body){
if ($ns == '__root') $ns = '';
$outputString .= "namespace $ns{\n";
$outputString .= $body;
$outputString .= "}\n\n";
}
//Include the helper file, if requested
if(!empty($this->helpers)){
foreach($this->helpers as $helper){
if (file_exists($helper)){
$outputString .= str_replace(array('<?php', '?>'), '', \File::get($helper));
$output['__root'] .= str_replace(array('<?php', '?>'), '', \File::get($helper));
}
}
}
foreach ($output as $ns => $body){
if ($ns == '__root'){
$ns = '';
}
$outputString .= "namespace $ns{\n";
$outputString .= $body;
$outputString .= "}\n\n";
}
return $outputString;
}