@@ -80,7 +80,6 @@ public function __construct($tableName, Context $context)
8080 $ this ->driver = $ context ->getConnection ()->getSupplementalDriver ();
8181 $ this ->conventions = $ context ->getConventions ();
8282 $ this ->structure = $ context ->getStructure ();
83-
8483 $ this ->delimitedTable = implode ('. ' , array_map ([$ this ->driver , 'delimite ' ], explode ('. ' , $ tableName )));
8584 }
8685
@@ -151,7 +150,6 @@ public function buildSelectQuery($columns = NULL)
151150 } else {
152151 $ prefix = $ joins ? "{$ this ->delimitedTable }. " : '' ;
153152 $ querySelect = $ this ->buildSelect ([$ prefix . '* ' ]);
154-
155153 }
156154
157155 $ queryJoins = $ this ->buildQueryJoins ($ joins );
@@ -503,14 +501,11 @@ public function parseJoinsCb(& $joins, $match)
503501 protected function buildQueryJoins (array $ joins )
504502 {
505503 $ return = '' ;
506- foreach ($ joins as $ join ) {
507- list ($ joinTable , $ joinAlias , $ table , $ tableColumn , $ joinColumn ) = $ join ;
508-
504+ foreach ($ joins as list ($ joinTable , $ joinAlias , $ table , $ tableColumn , $ joinColumn )) {
509505 $ return .=
510506 " LEFT JOIN {$ joinTable }" . ($ joinTable !== $ joinAlias ? " {$ joinAlias }" : '' ) .
511507 " ON {$ table }. {$ tableColumn } = {$ joinAlias }. {$ joinColumn }" ;
512508 }
513-
514509 return $ return ;
515510 }
516511
@@ -539,9 +534,8 @@ protected function buildQueryEnd()
539534
540535 protected function tryDelimite ($ s )
541536 {
542- $ driver = $ this ->driver ;
543- return preg_replace_callback ('#(?<=[^\w`"\[?]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|\z)#i ' , function ($ m ) use ($ driver ) {
544- return strtoupper ($ m [0 ]) === $ m [0 ] ? $ m [0 ] : $ driver ->delimite ($ m [0 ]);
537+ return preg_replace_callback ('#(?<=[^\w`"\[?]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|\z)#i ' , function ($ m ) {
538+ return strtoupper ($ m [0 ]) === $ m [0 ] ? $ m [0 ] : $ this ->driver ->delimite ($ m [0 ]);
545539 }, $ s );
546540 }
547541
0 commit comments