1
0
mirror of synced 2025-02-14 19:23:15 +03:00

only check for traits when class exists

This commit is contained in:
Adam Prager 2013-03-26 21:28:09 +01:00
parent 8e3e2e770a
commit 8898c91dfc

View File

@ -710,6 +710,7 @@ public function __construct()
} }
// check traits for existing property // check traits for existing property
if (class_exists($metadata->name)) {
$reflClass = new \ReflectionClass($metadata->name); $reflClass = new \ReflectionClass($metadata->name);
foreach ($reflClass->getTraits() as $trait) { foreach ($reflClass->getTraits() as $trait) {
@ -717,6 +718,7 @@ public function __construct()
return true; return true;
} }
} }
}
return ( return (
isset($this->staticReflection[$metadata->name]) && isset($this->staticReflection[$metadata->name]) &&
@ -742,6 +744,7 @@ public function __construct()
} }
// check traits for existing method // check traits for existing method
if (class_exists($metadata->name)) {
$reflClass = new \ReflectionClass($metadata->name); $reflClass = new \ReflectionClass($metadata->name);
foreach ($reflClass->getTraits() as $trait) { foreach ($reflClass->getTraits() as $trait) {
@ -749,6 +752,7 @@ public function __construct()
return true; return true;
} }
} }
}
return ( return (
isset($this->staticReflection[$metadata->name]) && isset($this->staticReflection[$metadata->name]) &&