@@ -184,8 +184,8 @@ public function buildSelectQuery(array $columns = null): string
184184 {
185185 if (!$ this ->order && ($ this ->limit !== null || $ this ->offset )) {
186186 $ this ->order = array_map (
187- function ($ col ) { return "$ this ->tableName . $ col " ; } ,
188- (array ) $ this ->conventions ->getPrimary ($ this ->tableName )
187+ fn ($ col ) => "$ this ->tableName . $ col " ,
188+ (array ) $ this ->conventions ->getPrimary ($ this ->tableName ),
189189 );
190190 }
191191
@@ -239,7 +239,7 @@ public function getParameters(): array
239239 $ this ->parameters ['where ' ],
240240 $ this ->parameters ['group ' ],
241241 $ this ->parameters ['having ' ],
242- $ this ->parameters ['order ' ]
242+ $ this ->parameters ['order ' ],
243243 );
244244 }
245245
@@ -562,7 +562,7 @@ protected function parseJoinConditions(&$joins, $joinConditions): array
562562 protected function getSortedJoins (string $ table , &$ leftJoinDependency , &$ tableJoins , &$ finalJoins ): void
563563 {
564564 if (isset ($ this ->expandingJoins [$ table ])) {
565- $ path = implode ("' => ' " , array_map (function (string $ value ): string { return $ this ->reservedTableNames [$ value ]; } , array_merge (array_keys ($ this ->expandingJoins ), [$ table ])));
565+ $ path = implode ("' => ' " , array_map (fn (string $ value ): string => $ this ->reservedTableNames [$ value ], array_merge (array_keys ($ this ->expandingJoins ), [$ table ])));
566566 throw new Nette \InvalidArgumentException ("Circular reference detected at left join conditions (tables ' $ path'). " );
567567 }
568568 if (isset ($ tableJoins [$ table ])) {
@@ -773,19 +773,17 @@ protected function buildQueryEnd(): string
773773
774774 protected function tryDelimite (string $ s ): string
775775 {
776- return preg_replace_callback ('#(?<=[^\w`"\[?:]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|$)#Di ' , function (array $ m ): string {
777- return strtoupper ($ m [0 ]) === $ m [0 ]
776+ return preg_replace_callback ('#(?<=[^\w`"\[?:]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|$)#Di ' , fn (array $ m ): string => strtoupper ($ m [0 ]) === $ m [0 ]
778777 ? $ m [0 ]
779- : $ this ->driver ->delimite ($ m [0 ]);
780- }, $ s );
778+ : $ this ->driver ->delimite ($ m [0 ]), $ s );
781779 }
782780
783781
784782 protected function addConditionComposition (
785783 array $ columns ,
786784 array $ parameters ,
787785 array &$ conditions ,
788- array &$ conditionsParameters
786+ array &$ conditionsParameters,
789787 ): bool {
790788 if ($ this ->driver ->isSupported (Driver::SUPPORT_MULTI_COLUMN_AS_OR_COND )) {
791789 $ conditionFragment = '( ' . implode (' = ? AND ' , $ columns ) . ' = ?) OR ' ;
@@ -817,9 +815,7 @@ private function getConditionHash($condition, array $parameters): string
817815 private function getCachedTableList (): array
818816 {
819817 if (!$ this ->cacheTableList ) {
820- $ this ->cacheTableList = array_flip (array_map (function (array $ pair ): string {
821- return $ pair ['fullName ' ] ?? $ pair ['name ' ];
822- }, $ this ->structure ->getTables ()));
818+ $ this ->cacheTableList = array_flip (array_map (fn (array $ pair ): string => $ pair ['fullName ' ] ?? $ pair ['name ' ], $ this ->structure ->getTables ()));
823819 }
824820
825821 return $ this ->cacheTableList ;
0 commit comments