src/MocaBonita.php
public static function active(\Closure $active)
    {
        $mocaBonita = self::getInstance();

        register_activation_hook(MbPath::pBaseN(), function () use ($active, $mocaBonita) {
            try {
                MbMigration::enablePdoConnection();
                call_user_func_array($active, [$mocaBonita]);
            } catch (\Exception $e) {
                deactivate_plugins(basename(MbPath::pBaseN()));
                wp_die($e->getMessage());
            }
        });
    }
public static function active(\Closure $active)
    {
        $mocaBonita = self::getInstance();

        register_activation_hook(MbPath::pBaseN(), function () use ($active, $mocaBonita) {
            try {
                MbMigration::enablePdoConnection();
                call_user_func_array($active, [$mocaBonita]);
            } catch (\Exception $e) {
                deactivate_plugins(basename(MbPath::pBaseN()));
                wp_die($e->getMessage());
            }
        });
    }
public static function active ( \ Closure $ active ) { $ mocaBonita = self :: getInstance ( ) ; register_activation_hook ( MbPath :: pBaseN ( ) , function ( ) use ( $ active , $ mocaBonita ) { try { MbMigration :: enablePdoConnection ( ) ; call_user_func_array ( $ active , [ $ mocaBonita ] ) ; } catch ( \ Exception $ e ) { deactivate_plugins ( basename ( MbPath :: pBaseN ( ) ) ) ; wp_die ( $ e -> getMessage ( ) ) ; } } ) ; }
Set the callback that will be called when the plugin is activated

@param $active \Closure Callback that will be called

@return void
Set the callback that will be called when the plugin is activated