Allow for camel case model properties.

This commit is contained in:
Stephen Rees-Carter
2016-03-03 21:36:10 +11:00
parent f1ebd847aa
commit a72cd81e5f
2 changed files with 39 additions and 0 deletions
+13
View File
@@ -476,6 +476,11 @@ class ModelsCommand extends Command
} else {
$attr = 'property-read';
}
if ($this->hasCamelCaseModelProperties()) {
$name = Str::camel($name);
}
$tagLine = trim("@{$attr} {$property['type']} {$name} {$property['comment']}");
$tag = Tag::createInstance($tagLine, $phpdoc);
$phpdoc->appendTag($tag);
@@ -575,4 +580,12 @@ class ModelsCommand extends Command
$model = new $className;
return '\\' . get_class($model->newCollection());
}
/**
* @return bool
*/
protected function hasCamelCaseModelProperties()
{
return $this->laravel['config']->get('ide-helper.model_camel_case_properties', false);
}
}