Completed
Push — master ( 45836f...af2240 )
by
unknown
07:35 queued 14s
created
kmm-shield.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 use KMM\Shield\Core;
17 17
 
18
-if ( ! function_exists( 'add_filter' ) ) {
18
+if ( ! function_exists('add_filter')) {
19 19
 	return;
20 20
 }
21 21
 
@@ -27,26 +27,26 @@  discard block
 block discarded – undo
27 27
  *
28 28
  * @return bool
29 29
  */
30
-function ensure_class_loaded( $class_name ) {
30
+function ensure_class_loaded($class_name) {
31 31
 
32
-	$class_exists   = class_exists( $class_name );
33
-	$autoload_found = file_exists( __DIR__ . '/vendor/autoload.php' );
32
+	$class_exists   = class_exists($class_name);
33
+	$autoload_found = file_exists(__DIR__ . '/vendor/autoload.php');
34 34
 
35 35
 	// If the class does not exist, and the vendor file is there
36 36
 	// maybe the plugin was installed separately via Composer, let's try to load autoload
37
-	if ( ! $class_exists && $autoload_found ) {
37
+	if ( ! $class_exists && $autoload_found) {
38 38
 		@require_once __DIR__ . '/vendor/autoload.php';
39 39
 	}
40 40
 
41
-	return $class_exists || ( $autoload_found && class_exists( $class_name ) );
41
+	return $class_exists || ($autoload_found && class_exists($class_name));
42 42
 }
43 43
 
44 44
 // Exit if classes are not available
45
-if ( ! ensure_class_loaded( __NAMESPACE__ . '\Core' ) ) {
45
+if ( ! ensure_class_loaded(__NAMESPACE__ . '\Core')) {
46 46
 	return;
47 47
 }
48 48
 
49
-add_action( 'plugins_loaded', __NAMESPACE__ . '\main' );
49
+add_action('plugins_loaded', __NAMESPACE__ . '\main');
50 50
 
51 51
 
52 52
 /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 function main() {
56 56
 	new Core();
57 57
 
58
-	if ( is_admin() ) {
58
+	if (is_admin()) {
59 59
 		// Backend
60 60
 
61 61
 		// TODO: register your backend-code here...
Please login to merge, or discard this patch.
src/Core.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     {
19 19
         add_action('admin_menu', [$this, 'enqueue_styles'], 20);
20 20
         add_action('admin_enqueue_scripts', [$this, 'enqueue_scripts'], 10, 1);
21
-        add_action('rest_api_init', function () {
21
+        add_action('rest_api_init', function() {
22 22
             register_rest_route('kmm/v2', '/alive', [
23 23
                 'methods' => 'POST',
24 24
                 'callback' => [$this, 'check_alive'],
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         $msg .= 'PostID: ' . $post . "\n";
47 47
 
48
-        if (! is_user_logged_in()) {
48
+        if ( ! is_user_logged_in()) {
49 49
             do_action('krn_send_slack', ['channel' => '#debug-editor', 'text' => $msg], true);
50 50
         }
51 51
 
Please login to merge, or discard this patch.