1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix getSymbolInformation() for symbols containing ":" (#3400)

Currently a Symbol like `10-15:array{foo: string}` will return ` string}`, as the regex does not specify a string-start caret.
This commit is contained in:
Joe Hoyle 2020-05-19 16:15:13 +02:00 committed by GitHub
parent 47cf69ded1
commit 588be3b269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1034,7 +1034,7 @@ class Codebase
public function getSymbolInformation(string $file_path, string $symbol)
{
if (\is_numeric($symbol[0])) {
return \preg_replace('/[^:]*:/', '', $symbol);
return \preg_replace('/^[^:]*:/', '', $symbol);
}
try {