Skip to content

Commit b2c21d1

Browse files
committed
Fix bug
1 parent 4e6bc03 commit b2c21d1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/lib/AttributeResolver.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ protected function resolveProperty(
259259
->setSize($fkProperty->getMaxLength())
260260
->setDescription($property->getRefSchema()->getDescription())
261261
->setDefault($fkProperty->guessDefault())
262-
->setLimits($min, $max, $fkProperty->getMinLength());
262+
->setLimits($min, $max, $fkProperty->getMinLength())
263+
->setFakerStub($this->guessFakerStub($attribute, $property));
263264

264265
$relation = Yii::createObject(
265266
AttributeRelation::class,
@@ -340,9 +341,6 @@ protected function resolveProperty(
340341
}
341342
$attribute->setPhpType($relatedClassName . '[]');
342343

343-
$this->attributes[$property->getName()] =
344-
$attribute->setFakerStub($this->guessFakerStub($attribute, $property)); // TODO
345-
346344
$this->relations[$property->getName()] =
347345
Yii::createObject(
348346
AttributeRelation::class,

src/lib/FakerStubResolver.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ public function aElementFaker($data): ?string
390390
];
391391

392392
$schema = new Schema($compoSchemaData);
393-
394393
if ($this->config) {
395394
$rc = new ReferenceContext($this->config->getOpenApi(), Yii::getAlias($this->config->openApiPath));
396395
$schema->setReferenceContext($rc);

0 commit comments

Comments
 (0)