Skip to content

Commit 372a436

Browse files
authored
Merge pull request #29 from php-api-clients/only-set-array-as-default-property-value
Only set array as default property value
2 parents 3b20b2c + 2990580 commit 372a436

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Generator/Schema.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ public static function generate(string $name, string $namespace, string $classNa
102102
'bool',
103103
], $property->type);
104104
if ($t !== '') {
105-
$dft = [];
106-
if ($t !== 'array') {
107-
$dft = null;
105+
if ($t === 'array') {
106+
$propertyStmt->setType($t)->setDefault([]);
107+
} else {
108+
$propertyStmt->setType($t);
108109
}
109-
$propertyStmt->setType($t)->setDefault($dft);
110110
$method->setReturnType($t);
111111
}
112112
}

0 commit comments

Comments
 (0)