24
24
final class ApiProperty
25
25
{
26
26
/**
27
- * @param bool|null $readableLink https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
28
- * @param bool|null $writableLink https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
29
- * @param bool|null $required https://api-platform.com/docs/admin/validation/#client-side-validation
30
- * @param bool|null $identifier https://api-platform.com/docs/core/identifiers/
31
- * @param string|null $default
32
- * @param mixed $example https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
33
- * @param string|null $deprecationReason https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
34
- * @param bool|null $fetchEager https://api-platform.com/docs/core/performance/#eager-loading
35
- * @param array|null $jsonldContext https://api-platform.com/docs/core/extending-jsonld-context/#extending-json-ld-and-hydra-contexts
36
- * @param array|null $openapiContext https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
37
- * @param bool|null $push https://api-platform.com/docs/core/push-relations/
38
- * @param string|null $security https://api-platform.com/docs/core/security
39
- * @param string|null $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
40
- * @param string[] $types the RDF types of this property
41
- * @param string[] $iris
42
- * @param Type[] $builtinTypes
43
- * @param string|null $uriTemplate (experimental) whether to return the subRessource collection IRI instead of an iterable of IRI
27
+ * @param bool|null $readableLink https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
28
+ * @param bool|null $writableLink https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
29
+ * @param bool|null $required https://api-platform.com/docs/admin/validation/#client-side-validation
30
+ * @param bool|null $identifier https://api-platform.com/docs/core/identifiers/
31
+ * @param string|null $default
32
+ * @param mixed $example https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
33
+ * @param string|null $deprecationReason https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
34
+ * @param bool|null $fetchEager https://api-platform.com/docs/core/performance/#eager-loading
35
+ * @param array|null $jsonldContext https://api-platform.com/docs/core/extending-jsonld-context/#extending-json-ld-and-hydra-contexts
36
+ * @param array|null $openapiContext https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
37
+ * @param bool|null $push https://api-platform.com/docs/core/push-relations/
38
+ * @param string|\Stringable| null $security https://api-platform.com/docs/core/security
39
+ * @param string|\Stringable| null $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
40
+ * @param string[] $types the RDF types of this property
41
+ * @param string[] $iris
42
+ * @param Type[] $builtinTypes
43
+ * @param string|null $uriTemplate (experimental) whether to return the subRessource collection IRI instead of an iterable of IRI
44
44
*/
45
45
public function __construct (
46
46
private ?string $ description = null ,
@@ -148,7 +148,7 @@ public function __construct(
148
148
*
149
149
* </div>
150
150
*/
151
- private ? string $ security = null ,
151
+ private string | \ Stringable | null $ security = null ,
152
152
/**
153
153
* The `securityPostDenormalize` option defines access to the current property after the denormalization process, based on Symfony Security.
154
154
* It receives an `object` variable related to the current object, and a `property` variable related to the current property.
@@ -192,7 +192,7 @@ public function __construct(
192
192
*
193
193
* </div>
194
194
*/
195
- private ? string $ securityPostDenormalize = null ,
195
+ private string | \ Stringable | null $ securityPostDenormalize = null ,
196
196
private array |string |null $ types = null ,
197
197
/*
198
198
* The related php types.
@@ -420,7 +420,7 @@ public function withPush($push): self
420
420
421
421
public function getSecurity (): ?string
422
422
{
423
- return $ this ->security ;
423
+ return $ this ->security instanceof \Stringable ? ( string ) $ this -> security : $ this -> security ;
424
424
}
425
425
426
426
public function withSecurity ($ security ): self
@@ -433,7 +433,7 @@ public function withSecurity($security): self
433
433
434
434
public function getSecurityPostDenormalize (): ?string
435
435
{
436
- return $ this ->securityPostDenormalize ;
436
+ return $ this ->securityPostDenormalize instanceof \Stringable ? ( string ) $ this -> securityPostDenormalize : $ this -> securityPostDenormalize ;
437
437
}
438
438
439
439
public function withSecurityPostDenormalize ($ securityPostDenormalize ): self
0 commit comments