-
-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
116 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
* | ||
* @author Kévin Dunglas <[email protected]> | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::TARGET_CLASS)] | ||
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] | ||
final class ApiProperty | ||
{ | ||
private ?array $types; | ||
|
@@ -216,6 +216,10 @@ public function __construct( | |
private ?string $property = null, | ||
private ?string $policy = null, | ||
array|Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth|null $serialize = null, | ||
/** | ||
* Whether to document this property as a hydra:supportedProperty | ||
*/ | ||
private ?bool $hydra = null, | ||
private array $extraProperties = [], | ||
) { | ||
$this->types = \is_string($types) ? (array) $types : $types; | ||
|
@@ -517,7 +521,7 @@ public function withSchema(array $schema = []): self | |
return $self; | ||
} | ||
|
||
public function withInitializable(?bool $initializable): self | ||
public function withInitializable(bool $initializable): self | ||
{ | ||
$self = clone $this; | ||
$self->initializable = $initializable; | ||
|
@@ -626,4 +630,17 @@ public function withSerialize(array|Context|Groups|Ignore|SerializedName|Seriali | |
|
||
return $self; | ||
} | ||
|
||
public function getHydra(): ?bool | ||
{ | ||
return $this->hydra; | ||
} | ||
|
||
public function withHydra(bool $hydra): static | ||
{ | ||
$self = clone $this; | ||
$self->hydra = $hydra; | ||
|
||
return $self; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.