/** * {@inheritdoc} */ public function getInheritedMagicMethods() { $methods = []; $allMethods = array_flip(array_map(function (MethodReflectionInterface $method) { return $method->getName(); }, $this->getOwnMagicMethods())); /** @var ClassReflectionInterface[] $parentClassesAndInterfaces */ $parentClassesAndInterfaces = array_merge($this->classReflection->getParentClasses(), $this->classReflection->getInterfaces()); foreach ($parentClassesAndInterfaces as $class) { $inheritedMethods = $this->getUsedElements($class->getOwnMagicMethods(), $allMethods); $methods = $this->sortElements($inheritedMethods, $methods, $class); } return $methods; }
/** * @return ClassReflectionInterface[] */ private function getParentClassesAndInterfaces() { return array_merge($this->reflectionClass->getParentClasses(), $this->reflectionClass->getInterfaces()); }