1
0
mirror of synced 2025-02-21 14:43: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 // 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) { foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasProperty($property)) { if ($trait->hasProperty($property)) {
return true; return true;
}
} }
} }
@ -742,11 +744,13 @@ public function __construct()
} }
// check traits for existing method // 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) { foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasMethod($method)) { if ($trait->hasMethod($method)) {
return true; return true;
}
} }
} }