@@ -175,7 +175,7 @@ protected function scan($sql2)
175
175
}
176
176
$ stringSize = $ this ->parseBrackets ($ sql2 , $ index );
177
177
$ bracketContent = substr ($ sql2 , $ index + 1 , $ stringSize - 2 );
178
- $ tokens [] = '[ ' . trim ($ bracketContent , '" ' ) . '] ' ;
178
+ $ tokens [] = '[ ' . trim ($ bracketContent , '" ' ). '] ' ;
179
179
180
180
// We need to subtract one here because the for loop will automatically increment the index
181
181
$ index += $ stringSize - 1 ;
@@ -187,7 +187,7 @@ protected function scan($sql2)
187
187
if (!$ isEscaped && in_array ($ character , ['" ' , "' " ], true )) {
188
188
// Checking if the previous or next value is a ' to handle the weird SQL strings
189
189
// This will not check if the amount of quotes is even
190
- $ nextCharacter = $ this -> getCharacterAtIndex ( $ sql2 , $ index + 1 ) ;
190
+ $ nextCharacter = $ splitString [ $ index + 1 ] ?? '' ;
191
191
if ($ character === "' " && $ nextCharacter === "' " ) {
192
192
$ isEscaped = true ;
193
193
$ escapedQuotesCount ++;
@@ -226,15 +226,6 @@ protected function scan($sql2)
226
226
return $ tokens ;
227
227
}
228
228
229
- private function getCharacterAtIndex ($ string , $ index )
230
- {
231
- if ($ index < strlen ($ string )) {
232
- return $ string [$ index ];
233
- }
234
-
235
- return '' ;
236
- }
237
-
238
229
private function parseBrackets (string $ query , int $ index ): int
239
230
{
240
231
$ endPosition = strpos ($ query , '] ' , $ index ) + 1 ;
0 commit comments