From a18a4c50633f0570b2a666027658518f4d07cddd Mon Sep 17 00:00:00 2001 From: Yosmany Garcia Date: Tue, 15 Jan 2013 12:55:57 -0500 Subject: [PATCH] Made fix to remove spaces before a comment --- src/Symfony/Component/ClassLoader/ClassCollectionLoader.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php index 8e835d8beb120..5a32945583956 100644 --- a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -142,6 +142,12 @@ public static function fixNamespaceDeclarations($source) $token = $tokens[$i]; if (is_string($token)) { $output .= $token; + } elseif (T_WHITESPACE === $token[0]) { + if (isset($tokens[$i+1]) && T_COMMENT === $tokens[$i+1][0]) { + // remove spaces before a comment + $token[1] = str_replace(' ', '', $token[1]); + } + $output .= $token[1]; } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { // strip comments continue;