_cacheTypeList = $cacheTypeList; $this->_cacheState = $cacheState; $this->_cacheFrontendPool = $cacheFrontendPool; $this->resultPageFactory = $resultPageFactory; } /** * Check whether specified cache types exist * * @param array $types * @return void * @throws \Magento\Framework\Exception\LocalizedException */ protected function _validateTypes(array $types) { if (empty($types)) { return; } $allTypes = array_keys($this->_cacheTypeList->getTypes()); $invalidTypes = array_diff($types, $allTypes); if (count($invalidTypes) > 0) { throw new LocalizedException(__('These cache type(s) don\'t exist: %1', join(', ', $invalidTypes))); } } }