From 4bf5c08f99ccc706962f18dfe38f839a4d3df383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 15 May 2025 15:32:20 +0200 Subject: [PATCH] [WebLink] Add type doc for link attributes --- src/Symfony/Component/WebLink/Link.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/WebLink/Link.php b/src/Symfony/Component/WebLink/Link.php index f8bf6e4f52e01..95156cc57e502 100644 --- a/src/Symfony/Component/WebLink/Link.php +++ b/src/Symfony/Component/WebLink/Link.php @@ -147,7 +147,7 @@ class Link implements EvolvableLinkInterface private array $rel = []; /** - * @var array + * @var array> */ private array $attributes = []; @@ -175,6 +175,11 @@ public function getRels(): array return array_values($this->rel); } + /** + * Returns a list of attributes that describe the target URI. + * + * @return array> + */ public function getAttributes(): array { return $this->attributes; @@ -204,6 +209,14 @@ public function withoutRel(string $rel): static return $that; } + /** + * Returns an instance with the specified attribute added. + * + * If the specified attribute is already present, it will be overwritten + * with the new value. + * + * @param scalar|\Stringable|list $value + */ public function withAttribute(string $attribute, string|\Stringable|int|float|bool|array $value): static { $that = clone $this;