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;
    }
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;
    }
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 ; }
Cast links to an array

@return array
Cast links to an array