/** * Browse the object's methods looking for annotated methods. * * @param ReflectionClass $class * @param ClassDefinition $classDefinition */ private function readMethods(ReflectionClass $class, ClassDefinition $classDefinition) { // This will look in all the methods, including those of the parent classes foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if ($method->isStatic()) { continue; } $methodInjection = $this->getMethodInjection($method); if (!$methodInjection) { continue; } if ($method->isConstructor()) { $classDefinition->setConstructorInjection($methodInjection); } else { $classDefinition->addMethodInjection($methodInjection); } } }