Skip to content

Commit 236d3b5

Browse files
committed
Fix regex for namespace extraction of custom command classes
1 parent a3f329d commit 236d3b5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
1212
### Deprecated
1313
### Removed
1414
### Fixed
15+
- Regex for namespace extraction from custom command classes.
1516
### Security
1617

1718
## [0.72.0] - 2021-04-16

src/Telegram.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public function getCommandObject(string $command, string $filepath = ''): ?Comma
391391
protected function getFileNamespace(string $src): ?string
392392
{
393393
$content = file_get_contents($src);
394-
if (preg_match('#^\s+namespace\s+(.+?);#m', $content, $m)) {
394+
if (preg_match('#^\s*namespace\s+(.+?);#m', $content, $m)) {
395395
return $m[1];
396396
}
397397

0 commit comments

Comments
 (0)