From 5d24ffc6ba911321382dae5cf38fc7c419b2481c Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 17 Mar 2021 13:50:39 -0100 Subject: [PATCH] ability to add some entries out of rfc Signed-off-by: Maxence Lange --- lib/public/Http/WellKnown/JrdResponse.php | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/public/Http/WellKnown/JrdResponse.php b/lib/public/Http/WellKnown/JrdResponse.php index 01b7da9dbb..7a1c609554 100644 --- a/lib/public/Http/WellKnown/JrdResponse.php +++ b/lib/public/Http/WellKnown/JrdResponse.php @@ -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 $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 $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|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 $href, ?array $titles = [], - ?array $properties = []): self { - $this->links[] = array_filter([ - 'rel' => $rel, - 'type' => $type, - 'href' => $href, - 'titles' => $titles, - 'properties' => $properties, - ]); + ?array $properties = [], + array $entries = [] + ): self { + $this->links[] = array_filter( + array_merge( + [ + 'rel' => $rel, + 'type' => $type, + 'href' => $href, + 'titles' => $titles, + 'properties' => $properties + ], + $entries + ) + ); return $this; }