31 'abstract',
'and',
'array',
'as',
'break',
'callable',
'case',
'catch',
'class',
'clone',
'const',
32 'continue',
'declare',
'default',
'die',
'do',
'echo',
'else',
'elseif',
'empty',
'enddeclare',
33 'endfor',
'endforeach',
'endif',
'endswitch',
'endwhile',
'eval',
'exit',
'extends',
'final',
34 'for',
'foreach',
'function',
'global',
'goto',
'if',
'implements',
'include',
'instanceof',
35 'insteadof',
'interface',
'isset',
'list',
'namespace',
'new',
'or',
'print',
'private',
'protected',
36 'public',
'require',
'return',
'static',
'switch',
'throw',
'trait',
'try',
'unset',
'use',
'var',
37 'while',
'xor',
'void',
48 private $actionInterface;
62 ModuleReader $moduleReader,
63 $actionInterface = \
Magento\Framework\
App\ActionInterface::class,
64 $cacheKey =
'app_action_list',
68 $this->reservedWords = array_merge(
$reservedWords, $this->reservedWords);
69 $this->actionInterface = $actionInterface;
73 $this->actions = $moduleReader->getActionFiles();
74 $cache->save($this->serializer->serialize($this->actions), $cacheKey);
76 $this->actions = $this->serializer->unserialize(
$data);
89 public function get($module, $area, $namespace, $action)
94 if (strpos($namespace, self::NOT_ALLOWED_IN_NAMESPACE_PATH) !==
false) {
97 if (in_array(strtolower($action), $this->reservedWords)) {
100 $fullPath = str_replace(
104 $module .
'\\controller' . $area .
'\\' . $namespace .
'\\' . $action
107 if (isset($this->actions[$fullPath])) {
108 return is_subclass_of($this->actions[$fullPath], $this->actionInterface) ? $this->actions[$fullPath] :
null;
is_subclass_of($obj, $className)
const NOT_ALLOWED_IN_NAMESPACE_PATH
__construct(\Magento\Framework\Config\CacheInterface $cache, ModuleReader $moduleReader, $actionInterface=\Magento\Framework\App\ActionInterface::class, $cacheKey='app_action_list', $reservedWords=[], SerializerInterface $serializer=null)