ReflectionMethod::getClosure
ReflectionMethod::getModifiers
ReflectionMethod
PHP Manual

# ReflectionMethod::getDeclaringClass

(PHP 5)

ReflectionMethod::getDeclaringClass — Gets declaring class for the reflected method.

### Descrição

public ReflectionClass ReflectionMethod::getDeclaringClass ( void )

Gets the declaring class for the reflected method.

### Parâmetros

Esta função não possui parâmetros.

### Valor Retornado

A ReflectionClass object of the class that the reflected method is part of.

### Exemplos

Exemplo #1 ReflectionMethod::getDeclaringClass() example

`<?php
class HelloWorld {
protected function sayHelloTo($name) {
return 'Hello ' . $name;
}
}
$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');
var_dump($reflectionMethod->getDeclaringClass());
?>`

O exemplo acima irá imprimir:

    object(ReflectionClass)#2 (1) {
      ["name"]=>
      string(10) "HelloWorld"
    }

### Veja Também

- ReflectionMethod::isAbstract() - Checks if method is abstract

ReflectionMethod::getClosure
ReflectionMethod::getModifiers
ReflectionMethod
PHP Manual