if (!
$this->poolNames
) { throw new InvalidArgumentException('Could not clear all cache pools, try specifying a specific pool or cache clearer.'
);
} $io->
comment('Clearing all cache pools...'
);
$poolNames =
$this->poolNames;
} elseif (!
$poolNames) { throw new InvalidArgumentException('Either specify at least one pool name, or provide the --all option to clear all pools.'
);
} foreach ($poolNames as $id) { if ($this->poolClearer->
hasPool($id)) { $pools[$id] =
$id;
} else { $pool =
$kernel->
getContainer()->
get($id);
if ($pool instanceof CacheItemPoolInterface
) { $pools[$id] =
$pool;
} elseif ($pool instanceof Psr6CacheClearer
) { $clearers[$id] =
$pool;
} else { throw new InvalidArgumentException(sprintf('"%s" is not a cache pool nor a cache clearer.',
$id));
} }