reservedWords = array_merge($reservedWords, $this->reservedWords); $this->actionInterface = $actionInterface; $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()->get(Serialize::class); $data = $cache->load($cacheKey); if (!$data) { $this->actions = $moduleReader->getActionFiles(); $cache->save($this->serializer->serialize($this->actions), $cacheKey); } else { $this->actions = $this->serializer->unserialize($data); } } /** * Retrieve action class * * @param string $module * @param string $area * @param string $namespace * @param string $action * @return null|string */ public function get($module, $area, $namespace, $action) { if ($area) { $area = '\\' . $area; } if (strpos($namespace, self::NOT_ALLOWED_IN_NAMESPACE_PATH) !== false) { return null; } if (in_array(strtolower($action), $this->reservedWords)) { $action .= 'action'; } $fullPath = str_replace( '_', '\\', strtolower( $module . '\\controller' . $area . '\\' . $namespace . '\\' . $action ) ); if (isset($this->actions[$fullPath])) { return is_subclass_of($this->actions[$fullPath], $this->actionInterface) ? $this->actions[$fullPath] : null; } return null; } }