Skip to content

Commit

Permalink
PhpdocScalarFixer - fix for comment with Windows line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored and keradus committed Jun 27, 2020
1 parent c0d6a34 commit 213c93e
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 318 deletions.
2 changes: 1 addition & 1 deletion src/DocBlock/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private function getTypesContent()
}

$matchingResult = Preg::match(
'{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.self::REGEX_TYPES.'(?:[*\h].*)?$}sx',
'{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.self::REGEX_TYPES.'(?:[*\h\v].*)?$}sx',
$this->lines[0]->getContent(),
$matches
);
Expand Down
8 changes: 8 additions & 0 deletions tests/DocBlock/AnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ public function provideTypeParsingCases()
'/** @var array<string|int, string>',
['array<string|int, string>'],
],
[
" * @return int\n",
['int'],
],
[
" * @return int\r\n",
['int'],
],
];
}

Expand Down
Loading

0 comments on commit 213c93e

Please sign in to comment.