Skip to content

Commit

Permalink
minor regex cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Jun 28, 2022
1 parent 9058608 commit f917bca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Psalm/Internal/Scanner/DocblockParser.php
Expand Up @@ -60,9 +60,9 @@ public static function parse(string $docblock, int $offsetStart): ParsedDocblock

$last = false;
foreach ($lines as $k => $line) {
if (preg_match('/^[ \t]*\*?\s*@\w/i', $line)) {
if (preg_match('/^[ \t]*\*?\s*@\w/', $line)) {
$last = $k;
} elseif (preg_match('/^\s*\r?$/', $line)) {
} elseif (trim($line) === '') {
$last = false;
} elseif ($last !== false) {
$old_last_line = $lines[$last];
Expand Down Expand Up @@ -94,8 +94,8 @@ public static function parse(string $docblock, int $offsetStart): ParsedDocblock
[$type] = $type_info;
[$data, $data_offset] = $data_info;

if (strpos($data, '*')) {
$data = rtrim(preg_replace('/^[ \t]*\*\s*$/m', '', $data));
if (trim($data) === '*') {
$data = '';
}

if (empty($special[$type])) {
Expand Down

0 comments on commit f917bca

Please sign in to comment.