Completed
Push — master ( c1bd80...7840cd )
by CodexShaper
11:04 queued 12s
created
includes/class-wpb-loader.php 2 patches
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -22,107 +22,107 @@
 block discarded – undo
22 22
  */
23 23
 class WPB_Loader {
24 24
 
25
-	/**
26
-	 * The array of actions registered with WordPress.
27
-	 *
28
-	 * @since    1.0.0
29
-	 * @access   protected
30
-	 * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
31
-	 */
32
-	protected $actions;
33
-
34
-	/**
35
-	 * The array of filters registered with WordPress.
36
-	 *
37
-	 * @since    1.0.0
38
-	 * @access   protected
39
-	 * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
40
-	 */
41
-	protected $filters;
42
-
43
-	/**
44
-	 * Initialize the collections used to maintain the actions and filters.
45
-	 *
46
-	 * @since    1.0.0
47
-	 */
48
-	public function __construct() {
49
-
50
-		$this->actions = array();
51
-		$this->filters = array();
52
-
53
-	}
54
-
55
-	/**
56
-	 * Add a new action to the collection to be registered with WordPress.
57
-	 *
58
-	 * @since    1.0.0
59
-	 * @param    string $hook             The name of the WordPress action that is being registered.
60
-	 * @param    object $component        A reference to the instance of the object on which the action is defined.
61
-	 * @param    string $callback         The name of the function definition on the $component.
62
-	 * @param    int    $priority         Optional. The priority at which the function should be fired. Default is 10.
63
-	 * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
64
-	 */
65
-	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
66
-		$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
67
-	}
68
-
69
-	/**
70
-	 * Add a new filter to the collection to be registered with WordPress.
71
-	 *
72
-	 * @since    1.0.0
73
-	 * @param    string $hook             The name of the WordPress filter that is being registered.
74
-	 * @param    object $component        A reference to the instance of the object on which the filter is defined.
75
-	 * @param    string $callback         The name of the function definition on the $component.
76
-	 * @param    int    $priority         Optional. The priority at which the function should be fired. Default is 10.
77
-	 * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
78
-	 */
79
-	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
80
-		$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
81
-	}
82
-
83
-	/**
84
-	 * A utility function that is used to register the actions and hooks into a single
85
-	 * collection.
86
-	 *
87
-	 * @since    1.0.0
88
-	 * @access   private
89
-	 * @param    array  $hooks            The collection of hooks that is being registered (that is, actions or filters).
90
-	 * @param    string $hook             The name of the WordPress filter that is being registered.
91
-	 * @param    object $component        A reference to the instance of the object on which the filter is defined.
92
-	 * @param    string $callback         The name of the function definition on the $component.
93
-	 * @param    int    $priority         The priority at which the function should be fired.
94
-	 * @param    int    $accepted_args    The number of arguments that should be passed to the $callback.
95
-	 * @return   array                                  The collection of actions and filters registered with WordPress.
96
-	 */
97
-	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
98
-
99
-		$hooks[] = array(
100
-			'hook'          => $hook,
101
-			'component'     => $component,
102
-			'callback'      => $callback,
103
-			'priority'      => $priority,
104
-			'accepted_args' => $accepted_args,
105
-		);
106
-
107
-		return $hooks;
108
-
109
-	}
110
-
111
-	/**
112
-	 * Register the filters and actions with WordPress.
113
-	 *
114
-	 * @since    1.0.0
115
-	 */
116
-	public function run() {
117
-
118
-		foreach ( $this->filters as $hook ) {
119
-			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
120
-		}
121
-
122
-		foreach ( $this->actions as $hook ) {
123
-			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
124
-		}
125
-
126
-	}
25
+    /**
26
+     * The array of actions registered with WordPress.
27
+     *
28
+     * @since    1.0.0
29
+     * @access   protected
30
+     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
31
+     */
32
+    protected $actions;
33
+
34
+    /**
35
+     * The array of filters registered with WordPress.
36
+     *
37
+     * @since    1.0.0
38
+     * @access   protected
39
+     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
40
+     */
41
+    protected $filters;
42
+
43
+    /**
44
+     * Initialize the collections used to maintain the actions and filters.
45
+     *
46
+     * @since    1.0.0
47
+     */
48
+    public function __construct() {
49
+
50
+        $this->actions = array();
51
+        $this->filters = array();
52
+
53
+    }
54
+
55
+    /**
56
+     * Add a new action to the collection to be registered with WordPress.
57
+     *
58
+     * @since    1.0.0
59
+     * @param    string $hook             The name of the WordPress action that is being registered.
60
+     * @param    object $component        A reference to the instance of the object on which the action is defined.
61
+     * @param    string $callback         The name of the function definition on the $component.
62
+     * @param    int    $priority         Optional. The priority at which the function should be fired. Default is 10.
63
+     * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
64
+     */
65
+    public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
66
+        $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
67
+    }
68
+
69
+    /**
70
+     * Add a new filter to the collection to be registered with WordPress.
71
+     *
72
+     * @since    1.0.0
73
+     * @param    string $hook             The name of the WordPress filter that is being registered.
74
+     * @param    object $component        A reference to the instance of the object on which the filter is defined.
75
+     * @param    string $callback         The name of the function definition on the $component.
76
+     * @param    int    $priority         Optional. The priority at which the function should be fired. Default is 10.
77
+     * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
78
+     */
79
+    public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
80
+        $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
81
+    }
82
+
83
+    /**
84
+     * A utility function that is used to register the actions and hooks into a single
85
+     * collection.
86
+     *
87
+     * @since    1.0.0
88
+     * @access   private
89
+     * @param    array  $hooks            The collection of hooks that is being registered (that is, actions or filters).
90
+     * @param    string $hook             The name of the WordPress filter that is being registered.
91
+     * @param    object $component        A reference to the instance of the object on which the filter is defined.
92
+     * @param    string $callback         The name of the function definition on the $component.
93
+     * @param    int    $priority         The priority at which the function should be fired.
94
+     * @param    int    $accepted_args    The number of arguments that should be passed to the $callback.
95
+     * @return   array                                  The collection of actions and filters registered with WordPress.
96
+     */
97
+    private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
98
+
99
+        $hooks[] = array(
100
+            'hook'          => $hook,
101
+            'component'     => $component,
102
+            'callback'      => $callback,
103
+            'priority'      => $priority,
104
+            'accepted_args' => $accepted_args,
105
+        );
106
+
107
+        return $hooks;
108
+
109
+    }
110
+
111
+    /**
112
+     * Register the filters and actions with WordPress.
113
+     *
114
+     * @since    1.0.0
115
+     */
116
+    public function run() {
117
+
118
+        foreach ( $this->filters as $hook ) {
119
+            add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
120
+        }
121
+
122
+        foreach ( $this->actions as $hook ) {
123
+            add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
124
+        }
125
+
126
+    }
127 127
 
128 128
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 * @param    int    $priority         Optional. The priority at which the function should be fired. Default is 10.
63 63
 	 * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
64 64
 	 */
65
-	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
66
-		$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
65
+	public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) {
66
+		$this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args);
67 67
 	}
68 68
 
69 69
 	/**
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 	 * @param    int    $priority         Optional. The priority at which the function should be fired. Default is 10.
77 77
 	 * @param    int    $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
78 78
 	 */
79
-	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
80
-		$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
79
+	public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) {
80
+		$this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args);
81 81
 	}
82 82
 
83 83
 	/**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 * @param    int    $accepted_args    The number of arguments that should be passed to the $callback.
95 95
 	 * @return   array                                  The collection of actions and filters registered with WordPress.
96 96
 	 */
97
-	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
97
+	private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) {
98 98
 
99 99
 		$hooks[] = array(
100 100
 			'hook'          => $hook,
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function run() {
117 117
 
118
-		foreach ( $this->filters as $hook ) {
119
-			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
118
+		foreach ($this->filters as $hook) {
119
+			add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
120 120
 		}
121 121
 
122
-		foreach ( $this->actions as $hook ) {
123
-			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
122
+		foreach ($this->actions as $hook) {
123
+			add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
124 124
 		}
125 125
 
126 126
 	}
Please login to merge, or discard this patch.
src/Composer/ComposerScripts.php 2 patches
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -26,139 +26,139 @@
 block discarded – undo
26 26
  */
27 27
 class ComposerScripts {
28 28
 
29
-	/**
30
-	 * Handle the post-install Composer event.
31
-	 *
32
-	 * @param  \Composer\Script\Event $event The composer event.
33
-	 * @return void
34
-	 */
35
-	public static function post_install( Event $event ) {
36
-		require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
37
-	}
29
+    /**
30
+     * Handle the post-install Composer event.
31
+     *
32
+     * @param  \Composer\Script\Event $event The composer event.
33
+     * @return void
34
+     */
35
+    public static function post_install( Event $event ) {
36
+        require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
37
+    }
38 38
 
39
-	/**
40
-	 * Handle the post-update Composer event.
41
-	 *
42
-	 * @param  \Composer\Script\Event $event The composer event.
43
-	 * @return void
44
-	 */
45
-	public static function post_update( Event $event ) {
46
-		require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
47
-	}
39
+    /**
40
+     * Handle the post-update Composer event.
41
+     *
42
+     * @param  \Composer\Script\Event $event The composer event.
43
+     * @return void
44
+     */
45
+    public static function post_update( Event $event ) {
46
+        require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
47
+    }
48 48
 
49
-	/**
50
-	 * Handle the post-autoload-dump Composer event.
51
-	 *
52
-	 * @param  \Composer\Script\Event $event The composer event.
53
-	 * @return void
54
-	 */
55
-	public static function post_autoload_dump( Event $event ) {
56
-		require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
49
+    /**
50
+     * Handle the post-autoload-dump Composer event.
51
+     *
52
+     * @param  \Composer\Script\Event $event The composer event.
53
+     * @return void
54
+     */
55
+    public static function post_autoload_dump( Event $event ) {
56
+        require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
57 57
 
58
-		$dir  = $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/../';
59
-		$root = dirname( $event->getComposer()->getConfig()->get( 'vendor-dir' ) );
58
+        $dir  = $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/../';
59
+        $root = dirname( $event->getComposer()->getConfig()->get( 'vendor-dir' ) );
60 60
 
61
-		$vendor_name         = strtolower( basename( $root ) );
62
-		$partials            = explode( '-', $vendor_name );
63
-		$camel_case_partials = array();
64
-		foreach ( $partials as $partial ) {
65
-			$camel_case_partials[] = ucfirst( strtolower( $partial ) );
66
-		}
67
-		$camel_case = implode( '_', $camel_case_partials );
68
-		$snake_case = implode( '_', $partials );
61
+        $vendor_name         = strtolower( basename( $root ) );
62
+        $partials            = explode( '-', $vendor_name );
63
+        $camel_case_partials = array();
64
+        foreach ( $partials as $partial ) {
65
+            $camel_case_partials[] = ucfirst( strtolower( $partial ) );
66
+        }
67
+        $camel_case = implode( '_', $camel_case_partials );
68
+        $snake_case = implode( '_', $partials );
69 69
 
70
-		$files = array(
71
-			'/wpb.php',
72
-			'/bootstrap/app.php',
73
-			'/includes/class-wpb-activator.php',
74
-			'/includes/class-wpb-deactivator.php',
75
-			'/includes/class-wpb-i18n.php',
76
-			'/includes/class-wpb-loader.php',
77
-			'/includes/class-wpb.php',
78
-			'/admin/class-wpb-admin.php',
79
-			'/admin/class-wpb-admin-menu.php',
80
-			'/admin/class-wpb-admin-submenu.php',
81
-			'/admin/partials/wpb-admin-display.php',
82
-			'/admin/css/wpb-admin.css',
83
-			'/admin/js/wpb-admin.js',
84
-			'/public/class-wpb-public.php',
85
-			'/public/partials/wpb-public-display.php',
86
-			'/public/css/wpb-public.css',
87
-			'/public/js/wpb-public.js',
88
-			'/routes/web.php',
89
-			'/routes/api.php',
90
-			'/resources/js/admin/main.js',
91
-			'/resources/js/frontend/main.js',
92
-			'/resources/js/spa/main.js',
93
-			'/src/Application.php',
94
-			'/src/helpers.php',
95
-			'/src/Support/Facades/Config.php',
96
-			'/src/Support/Facades/Route.php',
97
-			'/src/Http/Kernel.php',
98
-			'/src/Http/Events/RequestHandler.php',
99
-			'/src/Exceptions/Handler.php',
100
-			'/app/User.php',
101
-			'/app/Post.php',
102
-			'/app/Http/Controllers/ProductController.php',
103
-			'/app/Http/Middleware/AuthMiddleware.php',
104
-			'/app/Http/Middleware/VerifyCsrfToken.php',
105
-			'/app/Http/Kernel.php',
106
-			'/app/Exceptions/Handler.php',
107
-		);
70
+        $files = array(
71
+            '/wpb.php',
72
+            '/bootstrap/app.php',
73
+            '/includes/class-wpb-activator.php',
74
+            '/includes/class-wpb-deactivator.php',
75
+            '/includes/class-wpb-i18n.php',
76
+            '/includes/class-wpb-loader.php',
77
+            '/includes/class-wpb.php',
78
+            '/admin/class-wpb-admin.php',
79
+            '/admin/class-wpb-admin-menu.php',
80
+            '/admin/class-wpb-admin-submenu.php',
81
+            '/admin/partials/wpb-admin-display.php',
82
+            '/admin/css/wpb-admin.css',
83
+            '/admin/js/wpb-admin.js',
84
+            '/public/class-wpb-public.php',
85
+            '/public/partials/wpb-public-display.php',
86
+            '/public/css/wpb-public.css',
87
+            '/public/js/wpb-public.js',
88
+            '/routes/web.php',
89
+            '/routes/api.php',
90
+            '/resources/js/admin/main.js',
91
+            '/resources/js/frontend/main.js',
92
+            '/resources/js/spa/main.js',
93
+            '/src/Application.php',
94
+            '/src/helpers.php',
95
+            '/src/Support/Facades/Config.php',
96
+            '/src/Support/Facades/Route.php',
97
+            '/src/Http/Kernel.php',
98
+            '/src/Http/Events/RequestHandler.php',
99
+            '/src/Exceptions/Handler.php',
100
+            '/app/User.php',
101
+            '/app/Post.php',
102
+            '/app/Http/Controllers/ProductController.php',
103
+            '/app/Http/Middleware/AuthMiddleware.php',
104
+            '/app/Http/Middleware/VerifyCsrfToken.php',
105
+            '/app/Http/Kernel.php',
106
+            '/app/Exceptions/Handler.php',
107
+        );
108 108
 
109
-		foreach ( $files as $file ) {
110
-			$file = $root . $file;
111
-			if ( file_exists( $file ) ) {
112
-				$contents = get_contents( $file );
113
-				$contents = str_replace( 'wpb_', $snake_case . '_', $contents );
114
-				$contents = str_replace( 'wpb', $vendor_name, $contents );
115
-				$contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents );
116
-				$contents = str_replace( 'WPB_FILE', strtoupper( $camel_case ) . '_FILE', $contents );
117
-				$contents = str_replace( 'WPB_PATH', strtoupper( $camel_case ) . '_PATH', $contents );
118
-				$contents = str_replace( 'WPB_INCLUDES', strtoupper( $camel_case ) . '_INCLUDES', $contents );
119
-				$contents = str_replace( 'WPB_URL', strtoupper( $camel_case ) . '_URL', $contents );
120
-				$contents = str_replace( 'WPB_ASSETS', strtoupper( $camel_case ) . '_ASSETS', $contents );
121
-				$contents = str_replace( 'WPB_VERSION', strtoupper( $camel_case ) . '_VERSION', $contents );
122
-				$contents = str_replace( 'WPB', $camel_case, $contents );
123
-				put_contents(
124
-					$file,
125
-					$contents
126
-				);
109
+        foreach ( $files as $file ) {
110
+            $file = $root . $file;
111
+            if ( file_exists( $file ) ) {
112
+                $contents = get_contents( $file );
113
+                $contents = str_replace( 'wpb_', $snake_case . '_', $contents );
114
+                $contents = str_replace( 'wpb', $vendor_name, $contents );
115
+                $contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents );
116
+                $contents = str_replace( 'WPB_FILE', strtoupper( $camel_case ) . '_FILE', $contents );
117
+                $contents = str_replace( 'WPB_PATH', strtoupper( $camel_case ) . '_PATH', $contents );
118
+                $contents = str_replace( 'WPB_INCLUDES', strtoupper( $camel_case ) . '_INCLUDES', $contents );
119
+                $contents = str_replace( 'WPB_URL', strtoupper( $camel_case ) . '_URL', $contents );
120
+                $contents = str_replace( 'WPB_ASSETS', strtoupper( $camel_case ) . '_ASSETS', $contents );
121
+                $contents = str_replace( 'WPB_VERSION', strtoupper( $camel_case ) . '_VERSION', $contents );
122
+                $contents = str_replace( 'WPB', $camel_case, $contents );
123
+                put_contents(
124
+                    $file,
125
+                    $contents
126
+                );
127 127
 
128
-				$dir           = dirname( $file );
129
-				$file_name     = basename( $file );
130
-				$new_file_name = str_replace( 'wpb', $vendor_name, $file_name );
128
+                $dir           = dirname( $file );
129
+                $file_name     = basename( $file );
130
+                $new_file_name = str_replace( 'wpb', $vendor_name, $file_name );
131 131
 
132
-				if ( $file_name !== $new_file_name ) {
133
-					rename( $file, $dir . '/' . $new_file_name );
134
-				}
135
-			}
136
-		}
132
+                if ( $file_name !== $new_file_name ) {
133
+                    rename( $file, $dir . '/' . $new_file_name );
134
+                }
135
+            }
136
+        }
137 137
 
138
-		static::update_bootstrap( $root, $camel_case );
139
-	}
138
+        static::update_bootstrap( $root, $camel_case );
139
+    }
140 140
 
141
-	/**
142
-	 * Replace bootstrap file.
143
-	 *
144
-	 * @since    1.0.0
145
-	 * @access   public
146
-	 *
147
-	 * @param string $root The string is unique root path for each plugin.
148
-	 * @param string $camel_case This string is camel case of project name.
149
-	 *
150
-	 * @return void
151
-	 */
152
-	protected static function update_bootstrap( $root, $camel_case ) {
153
-		$file = $root . '/bootstrap/app.php';
154
-		if ( file_exists( $file ) ) {
155
-			$contents = get_contents( $file );
156
-			$contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents );
157
-			put_contents(
158
-				$file,
159
-				$contents
160
-			);
141
+    /**
142
+     * Replace bootstrap file.
143
+     *
144
+     * @since    1.0.0
145
+     * @access   public
146
+     *
147
+     * @param string $root The string is unique root path for each plugin.
148
+     * @param string $camel_case This string is camel case of project name.
149
+     *
150
+     * @return void
151
+     */
152
+    protected static function update_bootstrap( $root, $camel_case ) {
153
+        $file = $root . '/bootstrap/app.php';
154
+        if ( file_exists( $file ) ) {
155
+            $contents = get_contents( $file );
156
+            $contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents );
157
+            put_contents(
158
+                $file,
159
+                $contents
160
+            );
161 161
 
162
-		}
163
-	}
162
+        }
163
+    }
164 164
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	 * @param  \Composer\Script\Event $event The composer event.
33 33
 	 * @return void
34 34
 	 */
35
-	public static function post_install( Event $event ) {
36
-		require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
35
+	public static function post_install(Event $event) {
36
+		require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
37 37
 	}
38 38
 
39 39
 	/**
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param  \Composer\Script\Event $event The composer event.
43 43
 	 * @return void
44 44
 	 */
45
-	public static function post_update( Event $event ) {
46
-		require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
45
+	public static function post_update(Event $event) {
46
+		require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
47 47
 	}
48 48
 
49 49
 	/**
@@ -52,20 +52,20 @@  discard block
 block discarded – undo
52 52
 	 * @param  \Composer\Script\Event $event The composer event.
53 53
 	 * @return void
54 54
 	 */
55
-	public static function post_autoload_dump( Event $event ) {
56
-		require_once $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/autoload.php';
55
+	public static function post_autoload_dump(Event $event) {
56
+		require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
57 57
 
58
-		$dir  = $event->getComposer()->getConfig()->get( 'vendor-dir' ) . '/../';
59
-		$root = dirname( $event->getComposer()->getConfig()->get( 'vendor-dir' ) );
58
+		$dir  = $event->getComposer()->getConfig()->get('vendor-dir').'/../';
59
+		$root = dirname($event->getComposer()->getConfig()->get('vendor-dir'));
60 60
 
61
-		$vendor_name         = strtolower( basename( $root ) );
62
-		$partials            = explode( '-', $vendor_name );
61
+		$vendor_name         = strtolower(basename($root));
62
+		$partials            = explode('-', $vendor_name);
63 63
 		$camel_case_partials = array();
64
-		foreach ( $partials as $partial ) {
65
-			$camel_case_partials[] = ucfirst( strtolower( $partial ) );
64
+		foreach ($partials as $partial) {
65
+			$camel_case_partials[] = ucfirst(strtolower($partial));
66 66
 		}
67
-		$camel_case = implode( '_', $camel_case_partials );
68
-		$snake_case = implode( '_', $partials );
67
+		$camel_case = implode('_', $camel_case_partials);
68
+		$snake_case = implode('_', $partials);
69 69
 
70 70
 		$files = array(
71 71
 			'/wpb.php',
@@ -106,36 +106,36 @@  discard block
 block discarded – undo
106 106
 			'/app/Exceptions/Handler.php',
107 107
 		);
108 108
 
109
-		foreach ( $files as $file ) {
110
-			$file = $root . $file;
111
-			if ( file_exists( $file ) ) {
112
-				$contents = get_contents( $file );
113
-				$contents = str_replace( 'wpb_', $snake_case . '_', $contents );
114
-				$contents = str_replace( 'wpb', $vendor_name, $contents );
115
-				$contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents );
116
-				$contents = str_replace( 'WPB_FILE', strtoupper( $camel_case ) . '_FILE', $contents );
117
-				$contents = str_replace( 'WPB_PATH', strtoupper( $camel_case ) . '_PATH', $contents );
118
-				$contents = str_replace( 'WPB_INCLUDES', strtoupper( $camel_case ) . '_INCLUDES', $contents );
119
-				$contents = str_replace( 'WPB_URL', strtoupper( $camel_case ) . '_URL', $contents );
120
-				$contents = str_replace( 'WPB_ASSETS', strtoupper( $camel_case ) . '_ASSETS', $contents );
121
-				$contents = str_replace( 'WPB_VERSION', strtoupper( $camel_case ) . '_VERSION', $contents );
122
-				$contents = str_replace( 'WPB', $camel_case, $contents );
109
+		foreach ($files as $file) {
110
+			$file = $root.$file;
111
+			if (file_exists($file)) {
112
+				$contents = get_contents($file);
113
+				$contents = str_replace('wpb_', $snake_case.'_', $contents);
114
+				$contents = str_replace('wpb', $vendor_name, $contents);
115
+				$contents = str_replace('WPB_APP_ROOT', strtoupper($camel_case).'_APP_ROOT', $contents);
116
+				$contents = str_replace('WPB_FILE', strtoupper($camel_case).'_FILE', $contents);
117
+				$contents = str_replace('WPB_PATH', strtoupper($camel_case).'_PATH', $contents);
118
+				$contents = str_replace('WPB_INCLUDES', strtoupper($camel_case).'_INCLUDES', $contents);
119
+				$contents = str_replace('WPB_URL', strtoupper($camel_case).'_URL', $contents);
120
+				$contents = str_replace('WPB_ASSETS', strtoupper($camel_case).'_ASSETS', $contents);
121
+				$contents = str_replace('WPB_VERSION', strtoupper($camel_case).'_VERSION', $contents);
122
+				$contents = str_replace('WPB', $camel_case, $contents);
123 123
 				put_contents(
124 124
 					$file,
125 125
 					$contents
126 126
 				);
127 127
 
128
-				$dir           = dirname( $file );
129
-				$file_name     = basename( $file );
130
-				$new_file_name = str_replace( 'wpb', $vendor_name, $file_name );
128
+				$dir           = dirname($file);
129
+				$file_name     = basename($file);
130
+				$new_file_name = str_replace('wpb', $vendor_name, $file_name);
131 131
 
132
-				if ( $file_name !== $new_file_name ) {
133
-					rename( $file, $dir . '/' . $new_file_name );
132
+				if ($file_name !== $new_file_name) {
133
+					rename($file, $dir.'/'.$new_file_name);
134 134
 				}
135 135
 			}
136 136
 		}
137 137
 
138
-		static::update_bootstrap( $root, $camel_case );
138
+		static::update_bootstrap($root, $camel_case);
139 139
 	}
140 140
 
141 141
 	/**
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @return void
151 151
 	 */
152
-	protected static function update_bootstrap( $root, $camel_case ) {
153
-		$file = $root . '/bootstrap/app.php';
154
-		if ( file_exists( $file ) ) {
155
-			$contents = get_contents( $file );
156
-			$contents = str_replace( 'WPB_APP_ROOT', strtoupper( $camel_case ) . '_APP_ROOT', $contents );
152
+	protected static function update_bootstrap($root, $camel_case) {
153
+		$file = $root.'/bootstrap/app.php';
154
+		if (file_exists($file)) {
155
+			$contents = get_contents($file);
156
+			$contents = str_replace('WPB_APP_ROOT', strtoupper($camel_case).'_APP_ROOT', $contents);
157 157
 			put_contents(
158 158
 				$file,
159 159
 				$contents
Please login to merge, or discard this patch.
bootstrap/app.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,35 +16,35 @@
 block discarded – undo
16 16
 use WPB\Application;
17 17
 
18 18
 $app = ( new Application(
19
-	array(
20
-		'paths' => array(
21
-			'root' => WPB_APP_ROOT,
22
-		),
23
-	)
19
+    array(
20
+        'paths' => array(
21
+            'root' => WPB_APP_ROOT,
22
+        ),
23
+    )
24 24
 ) );
25 25
 
26 26
 $container = $app->getInstance();
27 27
 
28 28
 $container->singleton(
29
-	Illuminate\Contracts\Http\Kernel::class,
30
-	\WPB\App\Http\Kernel::class
29
+    Illuminate\Contracts\Http\Kernel::class,
30
+    \WPB\App\Http\Kernel::class
31 31
 );
32 32
 $container->singleton(
33
-	\Illuminate\Contracts\Debug\ExceptionHandler::class,
34
-	\WPB\App\Exceptions\Handler::class
33
+    \Illuminate\Contracts\Debug\ExceptionHandler::class,
34
+    \WPB\App\Exceptions\Handler::class
35 35
 );
36 36
 
37 37
 try {
38 38
 
39
-	$kernel = $container->make( \Illuminate\Contracts\Http\Kernel::class );
39
+    $kernel = $container->make( \Illuminate\Contracts\Http\Kernel::class );
40 40
 
41
-	$response = $kernel->handle( \Illuminate\Http\Request::capture() );
41
+    $response = $kernel->handle( \Illuminate\Http\Request::capture() );
42 42
 
43
-	$response->send();
43
+    $response->send();
44 44
 
45 45
 } catch ( \Exception $ex ) {
46
-	if ( ! \WPB\Support\Facades\Route::current() ) {
47
-		return true;
48
-	}
49
-	throw new \Exception( $ex, 1 );
46
+    if ( ! \WPB\Support\Facades\Route::current() ) {
47
+        return true;
48
+    }
49
+    throw new \Exception( $ex, 1 );
50 50
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@  discard block
 block discarded – undo
9 9
  * @subpackage WPB/bootstrap
10 10
  */
11 11
 
12
-require_once ABSPATH . 'wp-includes/pluggable.php';
13
-require_once __DIR__ . '/../vendor/autoload.php';
14
-require_once __DIR__ . '/../src/helpers.php';
12
+require_once ABSPATH.'wp-includes/pluggable.php';
13
+require_once __DIR__.'/../vendor/autoload.php';
14
+require_once __DIR__.'/../src/helpers.php';
15 15
 
16 16
 use WPB\Application;
17 17
 
18
-$app = ( new Application(
18
+$app = (new Application(
19 19
 	array(
20 20
 		'paths' => array(
21 21
 			'root' => WPB_APP_ROOT,
22 22
 		),
23 23
 	)
24
-) );
24
+));
25 25
 
26 26
 $container = $app->getInstance();
27 27
 
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
 try {
38 38
 
39
-	$kernel = $container->make( \Illuminate\Contracts\Http\Kernel::class );
39
+	$kernel = $container->make(\Illuminate\Contracts\Http\Kernel::class);
40 40
 
41
-	$response = $kernel->handle( \Illuminate\Http\Request::capture() );
41
+	$response = $kernel->handle(\Illuminate\Http\Request::capture());
42 42
 
43 43
 	$response->send();
44 44
 
45
-} catch ( \Exception $ex ) {
46
-	if ( ! \WPB\Support\Facades\Route::current() ) {
45
+} catch (\Exception $ex) {
46
+	if (!\WPB\Support\Facades\Route::current()) {
47 47
 		return true;
48 48
 	}
49
-	throw new \Exception( $ex, 1 );
49
+	throw new \Exception($ex, 1);
50 50
 }
Please login to merge, or discard this patch.
public/class-wpb-public.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -21,82 +21,82 @@
 block discarded – undo
21 21
  */
22 22
 class WPB_Public {
23 23
 
24
-	/**
25
-	 * The ID of this plugin.
26
-	 *
27
-	 * @since    1.0.0
28
-	 * @access   private
29
-	 * @var      string    $plugin_name    The ID of this plugin.
30
-	 */
31
-	private $plugin_name;
24
+    /**
25
+     * The ID of this plugin.
26
+     *
27
+     * @since    1.0.0
28
+     * @access   private
29
+     * @var      string    $plugin_name    The ID of this plugin.
30
+     */
31
+    private $plugin_name;
32 32
 
33
-	/**
34
-	 * The version of this plugin.
35
-	 *
36
-	 * @since    1.0.0
37
-	 * @access   private
38
-	 * @var      string    $version    The current version of this plugin.
39
-	 */
40
-	private $version;
33
+    /**
34
+     * The version of this plugin.
35
+     *
36
+     * @since    1.0.0
37
+     * @access   private
38
+     * @var      string    $version    The current version of this plugin.
39
+     */
40
+    private $version;
41 41
 
42
-	/**
43
-	 * Initialize the class and set its properties.
44
-	 *
45
-	 * @since    1.0.0
46
-	 * @param      string $plugin_name       The name of the plugin.
47
-	 * @param      string $version    The version of this plugin.
48
-	 */
49
-	public function __construct( $plugin_name, $version ) {
42
+    /**
43
+     * Initialize the class and set its properties.
44
+     *
45
+     * @since    1.0.0
46
+     * @param      string $plugin_name       The name of the plugin.
47
+     * @param      string $version    The version of this plugin.
48
+     */
49
+    public function __construct( $plugin_name, $version ) {
50 50
 
51
-		$this->plugin_name = $plugin_name;
52
-		$this->version     = $version;
51
+        $this->plugin_name = $plugin_name;
52
+        $this->version     = $version;
53 53
 
54
-	}
54
+    }
55 55
 
56
-	/**
57
-	 * Register the stylesheets for the public-facing side of the site.
58
-	 *
59
-	 * @since    1.0.0
60
-	 */
61
-	public function enqueue_styles() {
56
+    /**
57
+     * Register the stylesheets for the public-facing side of the site.
58
+     *
59
+     * @since    1.0.0
60
+     */
61
+    public function enqueue_styles() {
62 62
 
63
-		/**
64
-		 * This function is provided for demonstration purposes only.
65
-		 *
66
-		 * An instance of this class should be passed to the run() function
67
-		 * defined in WPB_Loader as all of the hooks are defined
68
-		 * in that particular class.
69
-		 *
70
-		 * The WPB_Loader will then create the relationship
71
-		 * between the defined hooks and the functions defined in this
72
-		 * class.
73
-		 */
63
+        /**
64
+         * This function is provided for demonstration purposes only.
65
+         *
66
+         * An instance of this class should be passed to the run() function
67
+         * defined in WPB_Loader as all of the hooks are defined
68
+         * in that particular class.
69
+         *
70
+         * The WPB_Loader will then create the relationship
71
+         * between the defined hooks and the functions defined in this
72
+         * class.
73
+         */
74 74
 
75
-		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpb-public.css', array(), $this->version, 'all' );
75
+        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpb-public.css', array(), $this->version, 'all' );
76 76
 
77
-	}
77
+    }
78 78
 
79
-	/**
80
-	 * Register the JavaScript for the public-facing side of the site.
81
-	 *
82
-	 * @since    1.0.0
83
-	 */
84
-	public function enqueue_scripts() {
79
+    /**
80
+     * Register the JavaScript for the public-facing side of the site.
81
+     *
82
+     * @since    1.0.0
83
+     */
84
+    public function enqueue_scripts() {
85 85
 
86
-		/**
87
-		 * This function is provided for demonstration purposes only.
88
-		 *
89
-		 * An instance of this class should be passed to the run() function
90
-		 * defined in WPB_Loader as all of the hooks are defined
91
-		 * in that particular class.
92
-		 *
93
-		 * The WPB_Loader will then create the relationship
94
-		 * between the defined hooks and the functions defined in this
95
-		 * class.
96
-		 */
86
+        /**
87
+         * This function is provided for demonstration purposes only.
88
+         *
89
+         * An instance of this class should be passed to the run() function
90
+         * defined in WPB_Loader as all of the hooks are defined
91
+         * in that particular class.
92
+         *
93
+         * The WPB_Loader will then create the relationship
94
+         * between the defined hooks and the functions defined in this
95
+         * class.
96
+         */
97 97
 
98
-		wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpb-public.js', array( 'jquery' ), $this->version, false );
98
+        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpb-public.js', array( 'jquery' ), $this->version, false );
99 99
 
100
-	}
100
+    }
101 101
 
102 102
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 * @param      string $plugin_name       The name of the plugin.
47 47
 	 * @param      string $version    The version of this plugin.
48 48
 	 */
49
-	public function __construct( $plugin_name, $version ) {
49
+	public function __construct($plugin_name, $version) {
50 50
 
51 51
 		$this->plugin_name = $plugin_name;
52 52
 		$this->version     = $version;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		 * class.
73 73
 		 */
74 74
 
75
-		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpb-public.css', array(), $this->version, 'all' );
75
+		wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/wpb-public.css', array(), $this->version, 'all');
76 76
 
77 77
 	}
78 78
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		 * class.
96 96
 		 */
97 97
 
98
-		wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpb-public.js', array( 'jquery' ), $this->version, false );
98
+		wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/wpb-public.js', array('jquery'), $this->version, false);
99 99
 
100 100
 	}
101 101
 
Please login to merge, or discard this patch.
database/migrations/class-create-customers-table.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -23,32 +23,32 @@
 block discarded – undo
23 23
  */
24 24
 class Create_Customers_Table extends Migration {
25 25
 
26
-	/**
27
-	 * Run the migrations.
28
-	 *
29
-	 * @return void
30
-	 */
31
-	public function up() {
32
-		Schema::create(
33
-			'customers',
34
-			function ( Blueprint $table ) {
35
-				$table->id();
36
-				$table->string( 'name' );
37
-				$table->string( 'email' )->unique();
38
-				$table->timestamp( 'email_verified_at' )->nullable();
39
-				$table->string( 'password' );
40
-				$table->rememberToken();
41
-				$table->timestamps();
42
-			}
43
-		);
44
-	}
26
+    /**
27
+     * Run the migrations.
28
+     *
29
+     * @return void
30
+     */
31
+    public function up() {
32
+        Schema::create(
33
+            'customers',
34
+            function ( Blueprint $table ) {
35
+                $table->id();
36
+                $table->string( 'name' );
37
+                $table->string( 'email' )->unique();
38
+                $table->timestamp( 'email_verified_at' )->nullable();
39
+                $table->string( 'password' );
40
+                $table->rememberToken();
41
+                $table->timestamps();
42
+            }
43
+        );
44
+    }
45 45
 
46
-	/**
47
-	 * Reverse the migrations.
48
-	 *
49
-	 * @return void
50
-	 */
51
-	public function down() {
52
-		Schema::dropIfExists( 'customers' );
53
-	}
46
+    /**
47
+     * Reverse the migrations.
48
+     *
49
+     * @return void
50
+     */
51
+    public function down() {
52
+        Schema::dropIfExists( 'customers' );
53
+    }
54 54
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	public function up() {
32 32
 		Schema::create(
33 33
 			'customers',
34
-			function ( Blueprint $table ) {
34
+			function(Blueprint $table) {
35 35
 				$table->id();
36
-				$table->string( 'name' );
37
-				$table->string( 'email' )->unique();
38
-				$table->timestamp( 'email_verified_at' )->nullable();
39
-				$table->string( 'password' );
36
+				$table->string('name');
37
+				$table->string('email')->unique();
38
+				$table->timestamp('email_verified_at')->nullable();
39
+				$table->string('password');
40 40
 				$table->rememberToken();
41 41
 				$table->timestamps();
42 42
 			}
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function down() {
52
-		Schema::dropIfExists( 'customers' );
52
+		Schema::dropIfExists('customers');
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.