mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-20 19:13:11 +00:00
Remove verbose comments
Just show when it's actually a Model, not every class (for L5 especially). See #135
This commit is contained in:
@@ -150,8 +150,6 @@ class ModelsCommand extends Command
|
|||||||
if (in_array($name, $ignore)) {
|
if (in_array($name, $ignore)) {
|
||||||
$this->comment("Ignoring model '$name'");
|
$this->comment("Ignoring model '$name'");
|
||||||
continue;
|
continue;
|
||||||
} else {
|
|
||||||
$this->comment("Loading model '$name'");
|
|
||||||
}
|
}
|
||||||
$this->properties = array();
|
$this->properties = array();
|
||||||
$this->methods = array();
|
$this->methods = array();
|
||||||
@@ -159,11 +157,15 @@ class ModelsCommand extends Command
|
|||||||
try {
|
try {
|
||||||
// handle abstract classes, interfaces, ...
|
// handle abstract classes, interfaces, ...
|
||||||
$reflectionClass = new \ReflectionClass($name);
|
$reflectionClass = new \ReflectionClass($name);
|
||||||
|
|
||||||
|
if (!$reflectionClass->isSubclassOf('Illuminate\Database\Eloquent\Model')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->comment("Loading model '$name'");
|
||||||
|
|
||||||
if (!$reflectionClass->IsInstantiable()) {
|
if (!$reflectionClass->IsInstantiable()) {
|
||||||
throw new \Exception($name . ' is not instanciable.');
|
throw new \Exception($name . ' is not instanciable.');
|
||||||
} elseif (!$reflectionClass->isSubclassOf('Illuminate\Database\Eloquent\Model')) {
|
|
||||||
$this->comment("Class '$name' is not a model");
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$model = new $name();
|
$model = new $name();
|
||||||
@@ -175,10 +177,6 @@ class ModelsCommand extends Command
|
|||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->error("Exception: " . $e->getMessage() . "\nCould not analyze class $name.");
|
$this->error("Exception: " . $e->getMessage() . "\nCould not analyze class $name.");
|
||||||
}
|
}
|
||||||
} elseif (interface_exists($name) || (function_exists('trait_exists') && trait_exists($name))) {
|
|
||||||
$this->info("Skipping interface/trait $name");
|
|
||||||
} else {
|
|
||||||
$this->error("Class $name does not exist");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user