/** *Levert een array met alle methoden van deze class op * * @param boolean If the method should also return protected functions * @param boolean If the method should also return private functions * @return IPReflectionMethod[] */ public function getMethods($alsoProtected = true, $alsoPrivate = true) { $ar = parent::getMethods(); foreach ($ar as $method) { $m = new IPReflectionMethod($this->classname, $method->name); if ((!$m->isPrivate() || $alsoPrivate) && (!$m->isProtected() || $alsoProtected) && $m->getDeclaringClass()->name == $this->classname) { $this->methods[$method->name] = $m; } } ksort($this->methods); return $this->methods; }
/** *Levert een array met alle methoden van deze class op. * * @param bool If the method should also return protected functions * @param bool If the method should also return private functions * * @return IPReflectionMethod[] */ public function getMethods($alsoProtected = true, $alsoPrivate = true, $alsoHerited = false) { $ar = parent::getMethods(); foreach ($ar as $method) { if (substr($method->name, 0, 2) == '__' || $method->isAbstract() || $method->isConstructor() || $method->isDestructor()) { continue; } $m = new IPReflectionMethod($this->classname, $method->name); if ((!$m->isPrivate() || $alsoPrivate) && (!$m->isProtected() || $alsoProtected) && ($m->getDeclaringClass()->name == $this->classname || $alsoHerited)) { $this->methods[$method->name] = $m; } } ksort($this->methods); return $this->methods; }
public function testExternalAndStaticParameters() { $ref = new IPReflectionMethod('testReflectionMethodClass', 'meth8'); $parameters = $ref->getParameters(); $this->assertArrayHasKey('paramObj', $parameters); $this->assertArrayHasKey('arr', $parameters); $this->assertArrayHasKey('foo', $parameters); $p = $parameters['paramObj']; $this->assertEquals('testParamMethod2', $p->type); $p = $parameters['arr']; $this->assertEquals('array', $p->type); $p = $parameters['foo']; $this->assertEquals('integer', $p->type); }
/** * Return array of params object for the operation $operationName * @param string $operationName Name of the operation (controller method) * @return array list params object (empty if no params) */ public function getOperationParams($operationName) { $IPReflectionMethod = new IPReflectionMethod($this->controllerClassName, $operationName); return $IPReflectionMethod->getParameters(); }