From 802849d52cae9f22ff1696cdcac9afd68da3d83a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 11 Sep 2017 16:09:30 +0200 Subject: [PATCH] Wording tweaks --- src/Composer/Json/JsonManipulator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Json/JsonManipulator.php b/src/Composer/Json/JsonManipulator.php index 6810ece27..f929732fe 100644 --- a/src/Composer/Json/JsonManipulator.php +++ b/src/Composer/Json/JsonManipulator.php @@ -430,8 +430,8 @@ class JsonManipulator return false; } - //check if we do not left a coma alone on previous line if it was the last line - if(preg_match('#,\s*$#', $matches['start']) && preg_match('#^\}$#', $matches['end'])) { + // check that we are not leaving a dangling comma on the previous line if the last line was removed + if (preg_match('#,\s*$#', $matches['start']) && preg_match('#^\}$#', $matches['end'])) { $matches['start'] = rtrim(preg_replace('#,(\s*)$#', '$1', $matches['start']), $this->indent); }