Update GeneratorCommand.php

Adds a check to prevent a foreach on an empty list of methods, which raises an Exception and stops generating the IDE Helper file.
This commit is contained in:
Frank
2013-04-28 12:40:56 +03:00
parent 1d26dfe58c
commit 191f73c0f9
@@ -168,10 +168,12 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
if(!in_array($alias, $onlyExtend) || $sublime)
{
$methods = $d->getMethods();
foreach ($methods as $method)
if($methods)
{
$output .= $this->parseMethod($method, $root, $sublime);
foreach ($methods as $method)
{
$output .= $this->parseMethod($method, $root, $sublime);
}
}
}
$output .= " }\n}\n\n";