mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Merge pull request #47 from AoSiX/patch-1
Test if model class is instanciable
This commit is contained in:
@@ -141,7 +141,13 @@ class ModelsCommand extends Command {
|
||||
$this->properties = array();
|
||||
$this->methods = array();
|
||||
if(class_exists($name)){
|
||||
try{
|
||||
try {
|
||||
// handle abstract classes, interfaces, ...
|
||||
$reflectionClass = new \ReflectionClass($name);
|
||||
if (!$reflectionClass->IsInstantiable()) {
|
||||
throw new \Exception($name . ' is not instanciable.');
|
||||
}
|
||||
|
||||
$model = new $name();
|
||||
$this->getPropertiesFromTable($model);
|
||||
$this->getPropertiesFromMethods($model);
|
||||
|
||||
Reference in New Issue
Block a user