mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Fix camelCase duplicated properties generator. (#881)
* Fix camelCase duplicated properties generator. * Add basic tests for camel case
This commit is contained in:
@@ -674,6 +674,11 @@ class ModelsCommand extends Command
|
||||
|
||||
foreach ($this->properties as $name => $property) {
|
||||
$name = "\$$name";
|
||||
|
||||
if ($this->hasCamelCaseModelProperties()) {
|
||||
$name = Str::camel($name);
|
||||
}
|
||||
|
||||
if (in_array($name, $properties)) {
|
||||
continue;
|
||||
}
|
||||
@@ -685,10 +690,6 @@ class ModelsCommand extends Command
|
||||
$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);
|
||||
|
||||
Reference in New Issue
Block a user