ReflectionClass::getMethods
Obtiene un array de métodos
&reftitle.description;
public arrayReflectionClass::getMethods
intfilter
Obtiene un array de métodos de una clase.
&reftitle.parameters;
filter
Filtra los resultados para incluir solamente los métodos con ciertos atributos. Lo predeterminado
es no filtrar nada.
Cualquier combinación de ReflectionMethod::IS_STATIC,
ReflectionMethod::IS_PUBLIC,
ReflectionMethod::IS_PROTECTED,
ReflectionMethod::IS_PRIVATE,
ReflectionMethod::IS_ABSTRACT,
ReflectionMethod::IS_FINAL.
&reftitle.returnvalues;
Un array de objetos ReflectionMethod
que reflejan cada método.
&reftitle.examples;
Uso básico de ReflectionClass::getMethods
getMethods();
var_dump($métodos);
?>
]]>
&example.outputs;
&object(ReflectionMethod)#2 (2) {
["name"]=>
string(11) "firstMethod"
["class"]=>
string(5) "Apple"
}
[1]=>
&object(ReflectionMethod)#3 (2) {
["name"]=>
string(12) "secondMethod"
["class"]=>
string(5) "Apple"
}
[2]=>
&object(ReflectionMethod)#4 (2) {
["name"]=>
string(11) "thirdMethod"
["class"]=>
string(5) "Apple"
}
}
]]>
Filtrar los resultados de ReflectionClass::getMethods
getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_FINAL);
var_dump($métodos);
?>
]]>
&example.outputs;
&object(ReflectionMethod)#2 (2) {
["name"]=>
string(12) "secondMethod"
["class"]=>
string(5) "Apple"
}
[1]=>
&object(ReflectionMethod)#3 (2) {
["name"]=>
string(11) "thirdMethod"
["class"]=>
string(5) "Apple"
}
}
]]>
&reftitle.seealso;
ReflectionClass::getMethod