diff --git a/HttpHeaderSerializer.php b/HttpHeaderSerializer.php index 2ecdff0..4d537c9 100644 --- a/HttpHeaderSerializer.php +++ b/HttpHeaderSerializer.php @@ -35,18 +35,18 @@ public function serialize(iterable $links): ?string continue; } - $attributesParts = ['', sprintf('rel="%s"', implode(' ', $link->getRels()))]; + $attributesParts = ['', \sprintf('rel="%s"', implode(' ', $link->getRels()))]; foreach ($link->getAttributes() as $key => $value) { if (\is_array($value)) { foreach ($value as $v) { - $attributesParts[] = sprintf('%s="%s"', $key, preg_replace('/(?%s', $link->getHref(), implode('; ', $attributesParts)); + $elements[] = \sprintf('<%s>%s', $link->getHref(), implode('; ', $attributesParts)); } return $elements ? implode(',', $elements) : null; diff --git a/Link.php b/Link.php index 5eab613..1f5fbbd 100644 --- a/Link.php +++ b/Link.php @@ -98,6 +98,12 @@ class Link implements EvolvableLinkInterface public const REL_PREDECESSOR_VERSION = 'predecessor-version'; public const REL_PREFETCH = 'prefetch'; public const REL_PRELOAD = 'preload'; + + /** + * This feature is deprecated and superseded by the Speculation Rules API. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prerender + */ public const REL_PRERENDER = 'prerender'; public const REL_PREV = 'prev'; public const REL_PREVIEW = 'preview'; @@ -141,8 +147,6 @@ class Link implements EvolvableLinkInterface // Extra relations public const REL_MERCURE = 'mercure'; - private string $href = ''; - /** * @var string[] */ @@ -153,12 +157,13 @@ class Link implements EvolvableLinkInterface */ private array $attributes = []; - public function __construct(?string $rel = null, string $href = '') - { + public function __construct( + ?string $rel = null, + private string $href = '', + ) { if (null !== $rel) { $this->rel[$rel] = $rel; } - $this->href = $href; } public function getHref(): string pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy