Skip to content

Commit 4c92456

Browse files
authored
docs: PHPDoc should have a dolar before the property name (#818)
1 parent 6527eb7 commit 4c92456

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Generators/ModelGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function fillDocs($templateData)
145145

146146
foreach ($this->commandData->fields as $field) {
147147
if ($field->isFillable) {
148-
$fillables .= ' * @property '.$this->getPHPDocType($field->fieldType).' '.$field->name.PHP_EOL;
148+
$fillables .= ' * @property '.$this->getPHPDocType($field->fieldType).' $'.$field->name.PHP_EOL;
149149
}
150150
}
151151
$docsTemplate = str_replace('$GENERATE_DATE$', date('F j, Y, g:i a T'), $docsTemplate);
@@ -171,19 +171,19 @@ private function getPHPDocType($db_type, $relation = null, $relationText = null)
171171
case 'datetime':
172172
return 'string|\Carbon\Carbon';
173173
case '1t1':
174-
return '\\'.$this->commandData->config->nsModel.'\\'.$relation->inputs[0].' '.Str::camel($relationText);
174+
return '\\'.$this->commandData->config->nsModel.'\\'.$relation->inputs[0].' $'.Str::camel($relationText);
175175
case 'mt1':
176176
if (isset($relation->inputs[1])) {
177177
$relationName = str_replace('_id', '', strtolower($relation->inputs[1]));
178178
} else {
179179
$relationName = $relationText;
180180
}
181181

182-
return '\\'.$this->commandData->config->nsModel.'\\'.$relation->inputs[0].' '.Str::camel($relationName);
182+
return '\\'.$this->commandData->config->nsModel.'\\'.$relation->inputs[0].' $'.Str::camel($relationName);
183183
case '1tm':
184184
case 'mtm':
185185
case 'hmt':
186-
return '\Illuminate\Database\Eloquent\Collection'.' '.Str::camel(Str::plural($relationText));
186+
return '\Illuminate\Database\Eloquent\Collection $'.Str::camel(Str::plural($relationText));
187187
default:
188188
$fieldData = SwaggerGenerator::getFieldType($db_type);
189189
if (!empty($fieldData['fieldType'])) {

0 commit comments

Comments
 (0)