The repository methods return a CollectionDocumentInterface or ItemDocumentInterface according to their docblock. However, they can also return a Document or an InvalidResponseDocument. This isn't reflected in the docblock. This can be added, but then it's hard to make tools like PHPStan satisfied and your code often need additional checks.
Argument of an invalid type Swis\JsonApi\Client\Interfaces\DataInterface supplied for foreach, only iterables are supported.
🪪 foreach.nonIterable
It would be nice if we could improve this and make it more unified.