I think there is a much simpler approach that does not use the evil `@` operator:

```php
return null !== parse_url($file, PHP_URL_HOST);
```

So, this can be inlined instead of creating an additional method.