File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -95,15 +95,7 @@ protected function getFunction()
9595 protected function trimStrings ($ return )
9696 {
9797 if (is_string ($ return )) {
98- /**
99- * Do not trim strings containing line breaks.
100- */
101- if (strpos ($ return , "\n" ) !== false
102- || strpos ($ return , "\r\n" ) !== false
103- ) {
104- return $ return ;
105- }
106- return rtrim ($ return );
98+ return $ this ->rTrim ($ return );
10799 }
108100 if (is_array ($ return )) {
109101 foreach ($ return as $ key => $ value ) {
@@ -112,4 +104,22 @@ protected function trimStrings($return)
112104 }
113105 return $ return ;
114106 }
107+
108+ /**
109+ * Trim a string.
110+ * @param string $string
111+ * @return string
112+ */
113+ protected function rTrim ($ string )
114+ {
115+ /**
116+ * Do not trim strings containing line breaks.
117+ */
118+ if (strpos ($ string , "\n" ) !== false
119+ || strpos ($ string , "\r\n" ) !== false
120+ ) {
121+ return $ string ;
122+ }
123+ return rtrim ($ string );
124+ }
115125}
You can’t perform that action at this time.
0 commit comments