protected static function _generateMethod($method, $callParent = false)
{
$result = join(' ', Reflection::getModifierNames($method->getModifiers()));
$result = preg_replace('/abstract\\s*/', '', $result);
$name = $method->getName();
$parameters = static::_generateSignature($method);
$type = static::_generateReturnType($method);
$body = "{$result} function {$name}({$parameters}) {$type}{";
if ($callParent) {
$parameters = static::_generateParameters($method);
$return = 'return ';
if ($method->isConstructor() || $method->isDestructor()) {
$return = '';
}
$body .= "{$return}parent::{$name}({$parameters});";
}
return $body . "}";
}