private function reflectClassToNode(ReflectionClass $class, Node\ClassNode $node) { if (true === $class->isFinal()) { throw new ClassMirrorException(sprintf('Could not reflect class %s as it is marked final.', $class->getName()), $class); } $node->setParentClass($class->getName()); foreach ($class->getMethods(ReflectionMethod::IS_ABSTRACT) as $method) { if (false === $method->isProtected()) { continue; } $this->reflectMethodToNode($method, $node); } foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if (0 === strpos($method->getName(), '_') && !in_array($method->getName(), self::$reflectableMethods)) { continue; } if (true === $method->isFinal()) { continue; } $this->reflectMethodToNode($method, $node); } }