eosnewmedia / JSON-API-Common

Basic php implementation (shared structures for client and server) of the json api specification (jsonapi.org)
https://eosnewmedia.github.io/JSON-API-Common/
MIT License
14 stars 13 forks source link

[TypeError] In Enm\JsonApi\Model\Resource\ResourceCollection::merge #27

Open yngc0der opened 3 years ago

yngc0der commented 3 years ago
[TypeError] 
Argument 1 passed to Enm\JsonApi\Model\Resource\Link\LinkCollection::merge() must implement interface Enm\JsonApi\Model\Resource\Link\LinkInterface, array given, called in ...

when i try to work with relationships in https://github.com/eosnewmedia/JSON-API-Common/blob/b68f75e4086f39c103394c56d8300b046c2d2668/src/Model/Resource/ResourceCollection.php#L112

/** @var LinkInterface $link */
foreach ($resource->links() as $link) {
    $existing->links()->merge($link, $replaceExistingValues);
}

$link is array(1) {LinkInterface $link}