```php
if ( ! $cacheProvider instanceof CacheProvider) {
    throw new \InvalidArgumentException('...');
}


// ...
 $cacheProvider->flushAll();

```