I'd go for a return ASAP instead:

```php
if (!$container->has('fos_http_cache.user_context.hash_generator')) {
    return;
}
```

This allows to have one indentation less.