I'm actually just doing that before with

```php
$link = array_shift($links);
$object = is_array($link) ? $link[0] : $link;
```
Basically if rel is used it will contain another dimension, if not used (= as before) then the link will be the object.

I can of course always make 2 different tests 'link with rel' and 'link without rel' ...