Fixing a bug where non-existent classes would cause issues
This commit is contained in:
parent
e7b555e2c9
commit
4bb9d8207f
@ -238,7 +238,18 @@ EOF
|
||||
return false;
|
||||
}
|
||||
|
||||
// see if the class exists (only need to trigger autoload once)
|
||||
return class_exists($serviceId) || interface_exists($serviceId, false);
|
||||
// if the id has a \, assume it is a class
|
||||
if (false !== strpos($serviceId, '\\')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
$r = new \ReflectionClass($serviceId);
|
||||
|
||||
return true;
|
||||
} catch (\ReflectionException $e) {
|
||||
// the service id is not a valid class/interface
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user