We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1157b5 commit 63ba67dCopy full SHA for 63ba67d
src/Telegram.php
@@ -1294,10 +1294,11 @@ public function getUpdateFilter(): ?callable
1294
*/
1295
protected function classNameToCommandName(string $class): string
1296
{
1297
- if (!preg_match('/^(.+)Command$/', $class, $matches)) {
+ // 7 is the length of 'Command'
1298
+ if (substr($class, -7) !== 'Command') {
1299
return '';
1300
}
- $temp = $matches[1];
1301
+ $temp = substr($class, 0, -7);
1302
$chunks = [];
1303
$currentUpperCaseLetter = '';
1304
while ($temp !== '') {
0 commit comments