public function flushOneCommand($identifier)
{
if (!$this->cacheManager->hasCache($identifier)) {
$this->outputLine('The cache "%s" does not exist.', [$identifier]);
$cacheConfigurations = $this->cacheManager->getCacheConfigurations();
$shortestDistance = -1;
foreach (array_keys($cacheConfigurations) as $existingIdentifier) {
$distance = levenshtein($existingIdentifier, $identifier);
if ($distance <= $shortestDistance || $shortestDistance < 0) {
$shortestDistance = $distance;
$closestIdentifier = $existingIdentifier;
}
}
if (isset($closestIdentifier)) {
$this->outputLine('Did you mean "%s"?', [$closestIdentifier]);
}
$this->quit(1);
}
$this->cacheManager->getCache($identifier)->flush();
$this->outputLine('Flushed "%s" cache for "%s" context.', [$identifier, $this->bootstrap->getContext()]);
$this->sendAndExit(0);
}