Update way of creating aliases

Again.. Sublime didn't really understand it. Passing null as parameters
to avoid errors.
This commit is contained in:
Barry vd. Heuvel
2013-07-02 21:10:55 +02:00
parent 63b1026fc3
commit 007a96ef3f
@@ -295,8 +295,21 @@ exit('Only to be used as an helper for your IDE');\n\n";
$return = ($returnValue && $returnValue !== "void" && $method->name !== "__construct") ? 'return' : '';
//Reference the 'real' function in the declaringclass
$root = $method->getDeclaringClass()->getName();
$output .= "\t\t$return \\$root::";
$declaringClass = $method->getDeclaringClass();
$constructor = $declaringClass->getConstructor();
$root = $declaringClass->getName();
$output .= "\t\t\ $root = new \\$root(";
if(!is_null($constructor)){
$constructorParams = array();
for($i=0;$i<$constructor->getNumberOfRequiredParameters();$i++){
$constructorParams[] = 'null';
}
$output .= implode($constructorParams, ',');
}
$output .= ");\n";
$output .= "\t\t$return \$root->";
//Write the default parameters in the function call
$output .= $method->name."(".implode($params, ", ").");\r\n";