This commit is contained in:
Maxence Lange 2021-06-03 15:59:38 -04:00 committed by GitHub
commit e27c909b45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 9 deletions

View File

@ -121,7 +121,8 @@ final class JrdResponse implements IResponse {
* @param string|null $type https://tools.ietf.org/html/rfc7033#section-4.4.4.2 * @param string|null $type https://tools.ietf.org/html/rfc7033#section-4.4.4.2
* @param string|null $href https://tools.ietf.org/html/rfc7033#section-4.4.4.3 * @param string|null $href https://tools.ietf.org/html/rfc7033#section-4.4.4.3
* @param string[]|null $titles https://tools.ietf.org/html/rfc7033#section-4.4.4.4 * @param string[]|null $titles https://tools.ietf.org/html/rfc7033#section-4.4.4.4
* @param string|null $properties https://tools.ietf.org/html/rfc7033#section-4.4.4.5 * @param string[]|null $properties https://tools.ietf.org/html/rfc7033#section-4.4.4.5
* @param string[] $entries
* *
* @psalm-param array<string,(string|null)>|null $properties https://tools.ietf.org/html/rfc7033#section-4.4.4.5 * @psalm-param array<string,(string|null)>|null $properties https://tools.ietf.org/html/rfc7033#section-4.4.4.5
* *
@ -132,14 +133,21 @@ final class JrdResponse implements IResponse {
?string $type, ?string $type,
?string $href, ?string $href,
?array $titles = [], ?array $titles = [],
?array $properties = []): self { ?array $properties = [],
$this->links[] = array_filter([ array $entries = []
'rel' => $rel, ): self {
'type' => $type, $this->links[] = array_filter(
'href' => $href, array_merge(
'titles' => $titles, [
'properties' => $properties, 'rel' => $rel,
]); 'type' => $type,
'href' => $href,
'titles' => $titles,
'properties' => $properties
],
$entries
)
);
return $this; return $this;
} }