mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Make doctrine optional
Not needed for most people.
This commit is contained in:
@@ -126,6 +126,8 @@ class ModelsCommand extends Command {
|
||||
*/
|
||||
\n\n";
|
||||
|
||||
$hasDoctrine = interface_exists('Doctrine\DBAL\Driver');
|
||||
|
||||
if(empty($loadModels)){
|
||||
$models = $this->loadModels();
|
||||
}else{
|
||||
@@ -158,7 +160,9 @@ class ModelsCommand extends Command {
|
||||
}
|
||||
|
||||
$model = new $name();
|
||||
$this->getPropertiesFromTable($model);
|
||||
if($hasDoctrine){
|
||||
$this->getPropertiesFromTable($model);
|
||||
}
|
||||
$this->getPropertiesFromMethods($model);
|
||||
$output .= $this->createPhpDocs($name);
|
||||
}catch(\Exception $e){
|
||||
@@ -169,6 +173,10 @@ class ModelsCommand extends Command {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!$hasDoctrine){
|
||||
$this->error("Warning: 'doctrine/dbal: ~2.3' is required to load database information. Please require that in your composer.json and run 'composer update'.");
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user