protected function linksToArray(): array
    {
        $links = [];

        foreach ($this->links as $name => $link)
        {
            if (! $link->hasMetadata()) {
                $links[$name] = $link->getReference();
                continue;
            }

            $links[$name] = [
                'href' => $link->getReference(),
                'meta' => $link->getMetadata()
            ];
        }

        return $links;
    }