Skip to content

Commit 7a5a294

Browse files
minor #41507 [WebLink] Added missing types (tarlepp)
This PR was squashed before being merged into the 6.0 branch. Discussion ---------- [WebLink] Added missing types | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch 5.x. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry --> Commits ------- 7193557622 [WebLink] Added missing types
2 parents 60de5d0 + f59f40b commit 7a5a294

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

GenericLinkProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getLinks(): array
4646
/**
4747
* {@inheritdoc}
4848
*/
49-
public function getLinksByRel($rel): array
49+
public function getLinksByRel(string $rel): array
5050
{
5151
$links = [];
5252

Link.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Link implements EvolvableLinkInterface
4646
private $rel = [];
4747

4848
/**
49-
* @var string[]
49+
* @var array<string, string|\Stringable|int|float|bool|array>
5050
*/
5151
private $attributes = [];
5252

@@ -95,7 +95,7 @@ public function getAttributes(): array
9595
*
9696
* @return static
9797
*/
98-
public function withHref($href)
98+
public function withHref(string|\Stringable $href)
9999
{
100100
$that = clone $this;
101101
$that->href = $href;
@@ -108,7 +108,7 @@ public function withHref($href)
108108
*
109109
* @return static
110110
*/
111-
public function withRel($rel)
111+
public function withRel(string $rel)
112112
{
113113
$that = clone $this;
114114
$that->rel[$rel] = $rel;
@@ -121,7 +121,7 @@ public function withRel($rel)
121121
*
122122
* @return static
123123
*/
124-
public function withoutRel($rel)
124+
public function withoutRel(string $rel)
125125
{
126126
$that = clone $this;
127127
unset($that->rel[$rel]);
@@ -134,7 +134,7 @@ public function withoutRel($rel)
134134
*
135135
* @return static
136136
*/
137-
public function withAttribute($attribute, $value)
137+
public function withAttribute(string $attribute, string|\Stringable|int|float|bool|array $value)
138138
{
139139
$that = clone $this;
140140
$that->attributes[$attribute] = $value;
@@ -147,7 +147,7 @@ public function withAttribute($attribute, $value)
147147
*
148148
* @return static
149149
*/
150-
public function withoutAttribute($attribute)
150+
public function withoutAttribute(string $attribute)
151151
{
152152
$that = clone $this;
153153
unset($that->attributes[$attribute]);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require": {
2222
"php": ">=8.0.2",
23-
"psr/link": "^1.0"
23+
"psr/link": "^1.1"
2424
},
2525
"suggest": {
2626
"symfony/http-kernel": ""

0 commit comments

Comments
 (0)