Skip to content

Commit 85906f9

Browse files
committed
Add callback instead of anonymous function.
Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com>
1 parent 75ff5cc commit 85906f9

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

admin-tools-command.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
EE::add_command( 'admin-tools', 'Admin_Tools_Command' );
2121

2222

23-
EE::add_hook('before_invoke:admin-tools up', function ( $args, $assoc_args ) {
24-
23+
EE::add_hook('before_invoke:admin-tools up', 'init_global_auth' );
24+
25+
/**
26+
* Initialize global auth if it's not present.
27+
*
28+
* @throws \EE\ExitException
29+
*/
30+
function init_global_auth() {
2531
if ( ! is_array( EE::get_runner()->find_command_to_run( [ 'auth' ] ) ) ) {
26-
EE::error( 'Auth command needs to be registered for admin_tools' );
32+
EE::error( 'Auth command needs to be registered for mailhog' );
2733
}
2834

2935
EE::run_command( [ 'auth', 'init' ] );
30-
});
36+
}

0 commit comments

Comments
 (0)