Fix camelCase duplicated properties generator. (#881)

* Fix camelCase duplicated properties generator.

* Add basic tests for camel case
This commit is contained in:
Sergio García
2020-03-10 12:17:29 +01:00
committed by GitHub
parent e743f44011
commit 90437012b8
3 changed files with 238 additions and 4 deletions
+5 -4
View File
@@ -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);