only check for traits when class exists
This commit is contained in:
parent
8e3e2e770a
commit
8898c91dfc
@ -710,11 +710,13 @@ public function __construct()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check traits for existing property
|
// check traits for existing property
|
||||||
$reflClass = new \ReflectionClass($metadata->name);
|
if (class_exists($metadata->name)) {
|
||||||
|
$reflClass = new \ReflectionClass($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 (class_exists($metadata->name)) {
|
||||||
|
$reflClass = new \ReflectionClass($metadata->name);
|
||||||
|
|
||||||
foreach ($reflClass->getTraits() as $trait) {
|
foreach ($reflClass->getTraits() as $trait) {
|
||||||
if ($trait->hasMethod($method)) {
|
if ($trait->hasMethod($method)) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user