1
0
mirror of synced 2025-02-20 22:23:14 +03:00

only use already existing reflections

This commit is contained in:
Adam Prager 2013-03-26 21:14:52 +01:00
parent 521276f1ed
commit bb5bdcf0f4

View File

@ -710,11 +710,13 @@ public function __construct()
}
// check traits for existing property
$reflClass = new \ReflectionClass($metadata->name);
if (isset($this->staticReflection[$metadata->name])) {
$reflClass = $this->staticReflection[$metadata->name];
foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasProperty($property)) {
return true;
foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasProperty($property)) {
return true;
}
}
}
@ -742,11 +744,13 @@ public function __construct()
}
// check traits for existing method
$reflClass = new \ReflectionClass($metadata->name);
if (isset($this->staticReflection[$metadata->name])) {
$reflClass = $this->staticReflection[$metadata->name];
foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasMethod($method)) {
return true;
foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasMethod($method)) {
return true;
}
}
}