@@ -728,7 +728,7 @@ private static function esc_like( $old ) {
728
728
* @return string|array An escaped string if given a string, or an array of escaped strings if given an array of strings.
729
729
*/
730
730
private static function esc_sql_ident ( $ idents ) {
731
- $ backtick = function ( $ v ) {
731
+ $ backtick = static function ( $ v ) {
732
732
// Escape any backticks in the identifier by doubling.
733
733
return '` ' . str_replace ( '` ' , '`` ' , $ v ) . '` ' ;
734
734
};
@@ -745,7 +745,7 @@ private static function esc_sql_ident( $idents ) {
745
745
* @return string|array A quoted string if given a string, or an array of quoted strings if given an array of strings.
746
746
*/
747
747
private static function esc_sql_value ( $ values ) {
748
- $ quote = function ( $ v ) {
748
+ $ quote = static function ( $ v ) {
749
749
// Don't quote integer values to avoid MySQL's implicit type conversion.
750
750
if ( preg_match ( '/^[+-]?[0-9]{1,20}$/ ' , $ v ) ) { // MySQL BIGINT UNSIGNED max 18446744073709551615 (20 digits).
751
751
return esc_sql ( $ v );
@@ -772,7 +772,7 @@ private static function esc_sql_value( $values ) {
772
772
private function get_colors ( $ assoc_args , $ colors ) {
773
773
$ color_reset = WP_CLI ::colorize ( '%n ' );
774
774
775
- $ color_code_callback = function ( $ v ) {
775
+ $ color_code_callback = static function ( $ v ) {
776
776
return substr ( $ v , 1 );
777
777
};
778
778
@@ -891,12 +891,12 @@ private function log_bits( $search_regex, $old_data, $old_matches, $new ) {
891
891
$ new_matches = array ();
892
892
$ new_data = preg_replace_callback (
893
893
$ search_regex ,
894
- function ( $ matches ) use ( $ old_matches , $ new , $ is_regex , &$ new_matches , &$ i , &$ diff ) {
894
+ static function ( $ matches ) use ( $ old_matches , $ new , $ is_regex , &$ new_matches , &$ i , &$ diff ) {
895
895
if ( $ is_regex ) {
896
896
// Sub in any back references, "$1", "\2" etc, in the replacement string.
897
897
$ new = preg_replace_callback (
898
898
'/(?<! \\\\)(?: \\\\\\\\)*((?: \\\\| \\$)[0-9]{1,2}| \\${[0-9]{1,2} \\})/ ' ,
899
- function ( $ m ) use ( $ matches ) {
899
+ static function ( $ m ) use ( $ matches ) {
900
900
$ idx = (int ) str_replace ( array ( '\\' , '$ ' , '{ ' , '} ' ), '' , $ m [0 ] );
901
901
return isset ( $ matches [ $ idx ] ) ? $ matches [ $ idx ] : '' ;
902
902
},
0 commit comments