Skip to content

Commit fabd048

Browse files
Copilotschlessera
andcommitted
Use static function for closure without $this context
Change the closure to a static function since it doesn't use $this instance context or any external variables. This follows best practices and improves performance by avoiding unnecessary binding. Co-authored-by: schlessera <[email protected]>
1 parent a674646 commit fabd048

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Core_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ public function update( $args, $assoc_args ) {
12161216
// Prevent async translation updates which output HTML.
12171217
add_action(
12181218
'upgrader_process_complete',
1219-
function () {
1219+
static function () {
12201220
remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
12211221
},
12221222
1

0 commit comments

Comments
 (0)