Skip to content

Commit 0aef975

Browse files
authored
Merge pull request dokuwiki#4307 from fiwswe/nit-AbstractAction
Very minor performance nit in AbstractAction constructor
2 parents e08dea6 + d22e654 commit 0aef975

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/Action/AbstractAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function __construct($actionname = '')
2727
if ($actionname !== '') {
2828
$this->actionname = $actionname;
2929
} else {
30-
// http://stackoverflow.com/a/27457689/172068
31-
$this->actionname = strtolower(substr(strrchr(get_class($this), '\\'), 1));
30+
// As of PHP 8 this seems to be the fastest way to get the name:
31+
$this->actionname = strtolower((new \ReflectionClass($this))->getShortName());
3232
}
3333
}
3434

0 commit comments

Comments
 (0)