From 1b4b7d416efd46600692dfce8cddbde35d58d9ff Mon Sep 17 00:00:00 2001 From: Brown Date: Wed, 17 Apr 2019 14:07:17 -0400 Subject: [PATCH] Fix off-by-one error --- .../Internal/FileManipulation/FileManipulationBuffer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/FileManipulation/FileManipulationBuffer.php b/src/Psalm/Internal/FileManipulation/FileManipulationBuffer.php index 3ab44e855..e53673978 100644 --- a/src/Psalm/Internal/FileManipulation/FileManipulationBuffer.php +++ b/src/Psalm/Internal/FileManipulation/FileManipulationBuffer.php @@ -46,8 +46,8 @@ class FileManipulationBuffer $bounds[0]--; } - if ($file_contents[$bounds[1]] ?? null === PHP_EOL - && $file_contents[$bounds[1] + 1] ?? null === PHP_EOL + if ($file_contents[$bounds[1] + 1] ?? null === PHP_EOL + && $file_contents[$bounds[1] + 2] ?? null === PHP_EOL ) { $bounds[1]++; }