mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
regex cleanup
This commit is contained in:
parent
d4732f118e
commit
16aaa3ae2b
@ -259,7 +259,7 @@ class CommentAnalyzer
|
||||
public static function sanitizeDocblockType(string $docblock_type): string
|
||||
{
|
||||
$docblock_type = preg_replace('@^[ \t]*\*@m', '', $docblock_type);
|
||||
$docblock_type = preg_replace('/,\n\s+\}/', '}', $docblock_type);
|
||||
$docblock_type = preg_replace('/,\n\s+}/', '}', $docblock_type);
|
||||
return str_replace("\n", '', $docblock_type);
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ class CommentAnalyzer
|
||||
$remaining = trim(preg_replace('@^[ \t]*\* *@m', ' ', substr($return_block, $i + 1)));
|
||||
|
||||
if ($remaining) {
|
||||
return array_merge([rtrim($type)], preg_split('/[ \s]+/', $remaining) ?: []);
|
||||
return array_merge([rtrim($type)], preg_split('/\s+/', $remaining) ?: []);
|
||||
}
|
||||
|
||||
return [$type];
|
||||
|
@ -2433,7 +2433,7 @@ class ConditionalTest extends TestCase
|
||||
|
||||
if ($remaining) {
|
||||
/** @var array<string> */
|
||||
return array_merge([rtrim($type)], preg_split(\'/[ \s]+/\', $remaining));
|
||||
return array_merge([rtrim($type)], preg_split(\'/\s+/\', $remaining));
|
||||
}
|
||||
|
||||
return [$type];
|
||||
|
Loading…
x
Reference in New Issue
Block a user