Skip to content

Commit 951a906

Browse files
committed
No nullables
1 parent d3aae60 commit 951a906

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Generator/Schema.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ public static function generate(string $name, string $namespace, string $classNa
104104
if ($t !== '') {
105105
$dft = [];
106106
if ($t !== 'array') {
107-
$t = '?' . $t;
108107
$dft = null;
109108
}
110109
$propertyStmt->setType($t)->setDefault($dft);
@@ -114,15 +113,15 @@ public static function generate(string $name, string $namespace, string $classNa
114113

115114
if (is_array($property->anyOf) && $property->anyOf[0] instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property->anyOf[0]), $schemaClassNameMap)) {
116115
$fqcnn = '\\' . $rootNamespace . '\\' . $schemaClassNameMap[spl_object_hash($property->anyOf[0])];
117-
$propertyStmt->setType('?' . $fqcnn)->setDefault(null);
118-
$method->setReturnType('?' . $fqcnn);
116+
$propertyStmt->setType( $fqcnn)->setDefault(null);
117+
$method->setReturnType( $fqcnn);
119118
$propertyDocBlock[] = '@\WyriHaximus\Hydrator\Attribute\Hydrate(' . $fqcnn . '::class)';
120119
}
121120

122121
if ($property->type === 'object' && $property instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property), $schemaClassNameMap)) {
123122
$fqcnn = '\\' . $rootNamespace . '\\' . $schemaClassNameMap[spl_object_hash($property)];
124-
$propertyStmt->setType('?' . $fqcnn)->setDefault(null);
125-
$method->setReturnType('?' . $fqcnn);
123+
$propertyStmt->setType( $fqcnn)->setDefault(null);
124+
$method->setReturnType( $fqcnn);
126125
$propertyDocBlock[] = '@\WyriHaximus\Hydrator\Attribute\Hydrate(' . $fqcnn . '::class)';
127126
}
128127

0 commit comments

Comments
 (0)