Extend the facade class

Fixes Issue #1
Only extended when it is not the same as the root class (because of
overriding static methods)
This commit is contained in:
Barry
2013-04-01 19:15:48 +02:00
parent ec18f19777
commit 063e59895c
@@ -139,7 +139,12 @@ class GeneratorCommand extends Command {
if($sublime){ if($sublime){
$output .= " class $alias extends \\$root{\n"; $output .= " class $alias extends \\$root{\n";
}else{ }else{
$output .= " class $alias{\n"; //If the root class is not the same as the facade extend it.
if($root !== $facade){
$output .= " class $alias extends $facade{\n";
}else{
$output .= " class $alias{\n";
}
$output .= "\t/**\n\t * @var \\$root \$root\n\t */\n\t static private \$root;\n\n"; $output .= "\t/**\n\t * @var \\$root \$root\n\t */\n\t static private \$root;\n\n";
} }
$methods = $d->getMethods(); $methods = $d->getMethods();