private function hasMethod($method, ClassMetadataInfo $metadata)
{
if ($this->extendsClass() || class_exists($metadata->name)) {
// don't generate method if its already on the base class.
$reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
if ($reflClass->hasMethod($method)) {
return true;
}
}
foreach ($this->getTraits($metadata) as $trait) {
if ($trait->hasMethod($method)) {
return true;
}
}
return isset($this->staticReflection[$metadata->name]) && in_array($method, $this->staticReflection[$metadata->name]['methods']);
}