method addMethods documentation in bbn\Parsers\Php
This function returns all the information of the methods cataloged by type
function($class_object, $origin = false, $file = NULL)
{
$methods = [
'private' => [],
'protected' => [],
'public' => []
];
foreach ($class_object->getMethods() as $m) {
$idx = 'public';
if ($m->isPrivate()) {
$idx = 'private';
}
elseif ($m->isProtected()) {
$idx = 'protected';
}
if ($m->getDeclaringClass()->getName() === $class_object->getName()) {
$doc = is_null($file) ? false : $m->getDocComment();
$ret = null;
if ($m->hasReTurnType()) {
$type = $m->getReturnType();
$ret = [(string)$type];
if ($type->allowsNull()) {
$ret[] = null;
}
}
$methods[$idx][$m->getName()] = [
'static' => $m->isStatic(),// ? 'static' : 'non-static',
'returns' => $ret,
'doc' => is_null($file) ? false : $doc,
'parsed' => is_null($file) ? false : $this->parser->parseDocblock($doc),
'line' => is_null($file) ? false : $m->getStartLine(),
'type' => $origin !== false ? $origin : 'origin',
'file' => $m->getDeclaringClass()->getName()
];
}
}
if ($origin === 'parent') {
unset($methods['private']);
}
return $methods;
}
This function returns all the information of the methods cataloged by type BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions