private function scanMethods()
{
// merging together methods from interfaces, parent class, traits, current class (in this precise order)
/* @var $inheritedMethods \ReflectionMethod[] */
$inheritedMethods = array_merge(array_merge([], ...array_map(function (ReflectionClass $ancestor) {
return $ancestor->getMethods();
}, array_values(array_merge($this->getInterfaces(), array_filter([$this->getParentClass()]), $this->getTraits())))), array_map(function (ClassMethod $methodNode) {
return ReflectionMethod::createFromNode($this->reflector, $methodNode, $this);
}, $this->node->getMethods()));
$methodsByName = [];
foreach ($inheritedMethods as $inheritedMethod) {
$methodsByName[$inheritedMethod->getName()] = $inheritedMethod;
}
return $methodsByName;
}