Thinking out loud here, would it be easier to just do:

```php
if ( ! is_array($hosts)) $hosts = (array) $hosts;
```

I think it looks a little tidier, is consistent with other similar checks around the framework and you're doing one less level of nesting!