You are here

public function RuntimeReflectionService::hasPublicMethod in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService::hasPublicMethod()

Checks if the class have a public method with the given name.

Parameters

mixed $class:

mixed $method:

Return value

bool

Overrides ReflectionService::hasPublicMethod

File

vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php, line 94

Class

RuntimeReflectionService
PHP Runtime Reflection Service.

Namespace

Doctrine\Common\Persistence\Mapping

Code

public function hasPublicMethod($class, $method) {
  try {
    $reflectionMethod = new ReflectionMethod($class, $method);
  } catch (ReflectionException $e) {
    return false;
  }
  return $reflectionMethod
    ->isPublic();
}