Skip to content

Commit d5ee7c5

Browse files
author
Robert Remenyi
committed
feat: Make array items required by default
1 parent 025ac04 commit d5ee7c5

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Entity/Field.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,7 @@ public function getPhpDocType(bool $allowNullable = true): string
208208

209209
if ($this->isArray() && !$this->isArrayOfObjects()) {
210210
$arraySuffix = '[]';
211-
$arrayItem = $this->getArrayItem();
212-
213-
$typeHint = $arrayItem->getType()->isMixed()
214-
? self::TYPE_MIXED
215-
: $arrayItem->getPhpTypeHint();
211+
$typeHint = $this->getArrayItem()->getPhpDocType();
216212
}
217213

218214
return sprintf('%s%s%s', $typeHint, $arraySuffix, $nullableSuffix);

src/Input/Factory/FieldFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function create(
8080
$operationName,
8181
lcfirst($itemReferenceName),
8282
$sibling,
83-
$required,
83+
true,
8484
$itemReferenceName
8585
);
8686
} elseif (FieldType::isSpecificationTypeObject($type)) {

0 commit comments

Comments
 (0)