@@ -83,7 +83,7 @@ final class ApiProperty
83
83
private $ securityPostDenormalize ;
84
84
85
85
/**
86
- * The related schemas .
86
+ * The RDF types of this property .
87
87
*
88
88
* @var string[]
89
89
*/
@@ -122,6 +122,7 @@ final class ApiProperty
122
122
* @param bool $push
123
123
* @param string $security
124
124
* @param string $securityPostDenormalize
125
+ * @param string[]|string $types
125
126
*/
126
127
public function __construct (
127
128
?string $ description = null ,
@@ -132,8 +133,8 @@ public function __construct(
132
133
?bool $ required = null ,
133
134
?bool $ identifier = null ,
134
135
135
- $ default = null ,
136
- $ example = null ,
136
+ $ default = null ,
137
+ $ example = null ,
137
138
138
139
?string $ deprecationReason = null ,
139
140
?bool $ fetchable = null ,
@@ -144,7 +145,7 @@ public function __construct(
144
145
?string $ security = null ,
145
146
?string $ securityPostDenormalize = null ,
146
147
147
- ? array $ types = [],
148
+ $ types = [],
148
149
?array $ builtinTypes = [],
149
150
?array $ schema = [],
150
151
?bool $ initializable = null ,
@@ -170,7 +171,7 @@ public function __construct(
170
171
$ this ->security = $ security ;
171
172
$ this ->openapiContext = $ openapiContext ;
172
173
$ this ->securityPostDenormalize = $ securityPostDenormalize ;
173
- $ this ->types = $ types ;
174
+ $ this ->types = ( array ) $ types ;
174
175
$ this ->builtinTypes = $ builtinTypes ;
175
176
$ this ->schema = $ schema ;
176
177
$ this ->initializable = $ initializable ;
@@ -403,10 +404,13 @@ public function getTypes(): ?array
403
404
return $ this ->types ;
404
405
}
405
406
406
- public function withTypes (array $ types = []): self
407
+ /**
408
+ * @param string[]|string $types
409
+ */
410
+ public function withTypes ($ types = []): self
407
411
{
408
412
$ self = clone $ this ;
409
- $ self ->types = $ types ;
413
+ $ self ->types = ( array ) $ types ;
410
414
411
415
return $ self ;
412
416
}
0 commit comments