@@ -83,8 +83,6 @@ final class ApiProperty
83
83
private $ securityPostDenormalize ;
84
84
85
85
/**
86
- * The related schemas.
87
- *
88
86
* @var string[]
89
87
*/
90
88
private $ types ;
@@ -108,20 +106,21 @@ final class ApiProperty
108
106
* @param string $description
109
107
* @param bool $readable
110
108
* @param bool $writable
111
- * @param bool $readableLink
112
- * @param bool $writableLink
113
- * @param bool $required
114
- * @param bool $identifier
109
+ * @param bool $readableLink https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
110
+ * @param bool $writableLink https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
111
+ * @param bool $required https://api-platform.com/docs/admin/validation/#client-side-validation
112
+ * @param bool $identifier https://api-platform.com/docs/core/identifiers/
115
113
* @param string|int|float|bool|array $default
116
- * @param string|int|float|bool|array $example
117
- * @param string $deprecationReason
114
+ * @param string|int|float|bool|array $example https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
115
+ * @param string $deprecationReason https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
118
116
* @param bool $fetchable
119
- * @param bool $fetchEager
120
- * @param array $jsonldContext
121
- * @param array $openapiContext
122
- * @param bool $push
123
- * @param string $security
124
- * @param string $securityPostDenormalize
117
+ * @param bool $fetchEager https://api-platform.com/docs/core/performance/#eager-loading
118
+ * @param array $jsonldContext https://api-platform.com/docs/core/extending-jsonld-context/#extending-json-ld-and-hydra-contexts
119
+ * @param array $openapiContext https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
120
+ * @param bool $push https://api-platform.com/docs/core/push-relations/
121
+ * @param string $security https://api-platform.com/docs/core/security
122
+ * @param string $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
123
+ * @param string[]|string $types the RDF types of this property
125
124
*/
126
125
public function __construct (
127
126
?string $ description = null ,
@@ -132,8 +131,8 @@ public function __construct(
132
131
?bool $ required = null ,
133
132
?bool $ identifier = null ,
134
133
135
- $ default = null ,
136
- $ example = null ,
134
+ $ default = null ,
135
+ $ example = null ,
137
136
138
137
?string $ deprecationReason = null ,
139
138
?bool $ fetchable = null ,
@@ -144,7 +143,7 @@ public function __construct(
144
143
?string $ security = null ,
145
144
?string $ securityPostDenormalize = null ,
146
145
147
- ? array $ types = [],
146
+ $ types = [],
148
147
?array $ builtinTypes = [],
149
148
?array $ schema = [],
150
149
?bool $ initializable = null ,
@@ -170,7 +169,7 @@ public function __construct(
170
169
$ this ->security = $ security ;
171
170
$ this ->openapiContext = $ openapiContext ;
172
171
$ this ->securityPostDenormalize = $ securityPostDenormalize ;
173
- $ this ->types = $ types ;
172
+ $ this ->types = ( array ) $ types ;
174
173
$ this ->builtinTypes = $ builtinTypes ;
175
174
$ this ->schema = $ schema ;
176
175
$ this ->initializable = $ initializable ;
@@ -403,10 +402,13 @@ public function getTypes(): ?array
403
402
return $ this ->types ;
404
403
}
405
404
406
- public function withTypes (array $ types = []): self
405
+ /**
406
+ * @param string[]|string $types
407
+ */
408
+ public function withTypes ($ types = []): self
407
409
{
408
410
$ self = clone $ this ;
409
- $ self ->types = $ types ;
411
+ $ self ->types = ( array ) $ types ;
410
412
411
413
return $ self ;
412
414
}
0 commit comments