@@ -19,7 +19,6 @@ class SqlPreprocessor
1919{
2020 use Nette \SmartObject;
2121
22- /** @var array */
2322 private const MODE_LIST = ['and ' , 'or ' , 'set ' , 'values ' , 'order ' ];
2423
2524 private const ARRAY_MODES = [
@@ -222,7 +221,9 @@ private function formatValue($value, string $mode = null): string
222221 } elseif (!$ mode || $ mode === 'set ' ) {
223222 foreach ($ value as $ k => $ v ) {
224223 if (is_int ($ k )) { // value, value, ... OR (1, 2), (3, 4)
225- $ vx [] = is_array ($ v ) ? '( ' . $ this ->formatValue ($ v ) . ') ' : $ this ->formatValue ($ v );
224+ $ vx [] = is_array ($ v )
225+ ? '( ' . $ this ->formatValue ($ v ) . ') '
226+ : $ this ->formatValue ($ v );
226227 } elseif (substr ($ k , -1 ) === '= ' ) { // key+=value, key-=value, ...
227228 $ k2 = $ this ->delimite (substr ($ k , 0 , -2 ));
228229 $ vx [] = $ k2 . '= ' . $ k2 . ' ' . substr ($ k , -2 , 1 ) . ' ' . $ this ->formatValue ($ v );
@@ -255,7 +256,9 @@ private function formatValue($value, string $mode = null): string
255256 $ vx [] = $ k . ' ' . $ operator . ' ' . $ v ;
256257 }
257258 }
258- return $ value ? '( ' . implode (') ' . strtoupper ($ mode ) . ' ( ' , $ vx ) . ') ' : '1=1 ' ;
259+ return $ value
260+ ? '( ' . implode (') ' . strtoupper ($ mode ) . ' ( ' , $ vx ) . ') '
261+ : '1=1 ' ;
259262
260263 } elseif ($ mode === 'order ' ) { // key, key DESC, ...
261264 foreach ($ value as $ k => $ v ) {
0 commit comments