From 5d259dbd1e9c434e8f571205ceebee938c2fe66c Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 7 Jan 2018 13:12:25 -0500 Subject: [PATCH] Fix single line detection bug (found by Psalm!) --- src/Psalm/FileManipulation/FunctionDocblockManipulator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Psalm/FileManipulation/FunctionDocblockManipulator.php b/src/Psalm/FileManipulation/FunctionDocblockManipulator.php index 33a61e709..33faf78b1 100644 --- a/src/Psalm/FileManipulation/FunctionDocblockManipulator.php +++ b/src/Psalm/FileManipulation/FunctionDocblockManipulator.php @@ -159,6 +159,11 @@ class FunctionDocblockManipulator $in_multi_line_comment = true; ++$i; } + + if ($chars[$i + 1] === '/') { + $in_single_line_comment = true; + ++$i; + } continue; case '*':