Skip to content

Commit 242ad86

Browse files
committed
use constructor property promotion
1 parent 3953f0a commit 242ad86

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Link.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ class Link implements EvolvableLinkInterface
141141
// Extra relations
142142
public const REL_MERCURE = 'mercure';
143143

144-
private string $href = '';
145-
146144
/**
147145
* @var string[]
148146
*/
@@ -153,12 +151,13 @@ class Link implements EvolvableLinkInterface
153151
*/
154152
private array $attributes = [];
155153

156-
public function __construct(?string $rel = null, string $href = '')
157-
{
154+
public function __construct(
155+
?string $rel = null,
156+
private string $href = '',
157+
) {
158158
if (null !== $rel) {
159159
$this->rel[$rel] = $rel;
160160
}
161-
$this->href = $href;
162161
}
163162

164163
public function getHref(): string

0 commit comments

Comments
 (0)