8000 [WebLink] Added missing types · symfony/symfony@7193557 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7193557

Browse files
tarleppnicolas-grekas
authored andcommitted
[WebLink] Added missing types
1 parent 1a01afb commit 7193557

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"psr/cache": "^1.0|^2.0",
4242
"psr/container": "^1.0",
4343
"psr/event-dispatcher": "^1.0",
44-
"psr/link": "^1.0",
44+
"psr/link": "^1.1",
4545
"psr/log": "~1.0",
4646
"symfony/contracts": "^2.1",
4747
"symfony/polyfill-ctype": "~1.8",

src/Symfony/Component/WebLink/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

src/Symfony/Component/WebLink/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]);

src/Symfony/Component/WebLink/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)
0