File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public function format($sql)
132132 $ this ->newLine ->addNewLineAfterOpeningParentheses ();
133133 } elseif ($ this ->parentheses ->stringIsClosingParentheses ($ token )) {
134134 $ this ->indentation ->decreaseIndentLevelUntilIndentTypeIsSpecial ($ this );
135- $ this ->newLine ->addNewLineBeforeClosingParentheses ($ addedNewline , $ tab );
135+ $ this ->newLine ->addNewLineBeforeToken ($ addedNewline , $ tab );
136136 } elseif ($ this ->isTokenTypeReservedTopLevel ($ token )) {
137137 $ this ->indentation
138138 ->setIncreaseSpecialIndent (true )
@@ -152,7 +152,7 @@ public function format($sql)
152152 ) {
153153 $ this ->newLine ->writeNewLineBecauseOfComma ();
154154 } elseif ($ this ->newLine ->isTokenTypeReservedNewLine ($ token )) {
155- $ this ->newLine ->writeNewLineBeforeReservedWord ($ addedNewline , $ tab );
155+ $ this ->newLine ->addNewLineBeforeToken ($ addedNewline , $ tab );
156156
157157 if (WhiteSpace::tokenHasExtraWhiteSpaces ($ token )) {
158158 $ queryValue = preg_replace ('/\s+/ ' , ' ' , $ queryValue );
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ public function addNewLineAfterOpeningParentheses()
112112 * @param boolean $addedNewline
113113 * @param string $tab
114114 */
115- public function addNewLineBeforeClosingParentheses ($ addedNewline , $ tab )
115+ public function addNewLineBeforeToken ($ addedNewline , $ tab )
116116 {
117117 if (false === $ addedNewline ) {
118118 $ this ->formatter ->appendToFormattedSql (
@@ -164,17 +164,6 @@ public function isTokenTypeReservedNewLine($token)
164164 return $ token [Tokenizer::TOKEN_TYPE ] === Tokenizer::TOKEN_TYPE_RESERVED_NEWLINE ;
165165 }
166166
167- /**
168- * @param boolean $addedNewline
169- * @param string $tab
170- */
171- public function writeNewLineBeforeReservedWord ($ addedNewline , $ tab )
172- {
173- if (false === $ addedNewline ) {
174- $ this ->formatter ->appendToFormattedSql ("\n" . str_repeat ($ tab , $ this ->indentation ->getIndentLvl ()));
175- }
176- }
177-
178167 /**
179168 * @return boolean
180169 */
You can’t perform that action at this time.
0 commit comments