There are some words that you cannot use for class names.
Basically the reserved php words like new
, public
, static
, ...
To overcome this and still allow these words in the urls Magento adds the suffix Action
when the class is autoloaded.
This means that new
maps to NewAction.php
, public
to PublicAction.php
.
You can find in the class \Magento\Framework\App\Router\ActionList
(2.3 branch) the list of words that have this behavior.
protected $reservedWords = [
'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const',
'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare',
'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final',
'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'instanceof',
'insteadof','interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected',
'public', 'require', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var',
'while', 'xor',
];
and here is the code that changes new
to NewAction
.