8000 [WebLink] Add type doc for link attributes · symfony/symfony@aa7ddb9 · GitHub
[go: up one dir, main page]

Skip to content

Commit aa7ddb9

Browse files
committed
[WebLink] Add type doc for link attributes
1 parent dff2ff8 commit aa7ddb9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Symfony/Component/WebLink/Link.php

+13
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ public function getRels(): array
175175
return array_values($this->rel);
176176
}
177177

178+
/**
179+
* Returns a list of attributes that describe the target URI.
180+
*
181+
* @return array<string, scalar|\Stringable|list<scalar|\Stringable>>
182+
*/
178183
public function getAttributes(): array
179184
{
180185
return $this->attributes;
@@ -204,6 +209,14 @@ public function withoutRel(string $rel): static
204209
return $that;
205210
}
206211

212+
/**
213+
* Returns an instance with the specified attribute added.
214+
*
215+
* If the specified attribute is already present, it will be overwritten
216+
* with the new value.
217+
*
218+
* @param scalar|\Stringable|list<scalar|\Stringable> $value
219+
*/
207220
public function withAttribute(string $attribute, string|\Stringable|int|float|bool|array $value): static
208221
{
209222
$that = clone $this;

0 commit comments

Comments
 (0)
0