Completed
Push — develop ( 509eab...41e75c )
by Paul
04:07
created
src/Taxonomy/Taxonomy.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	public function init()
37 37
 	{
38
-		if( empty( $this->app->config->taxonomies ))return;
38
+		if( empty( $this->app->config->taxonomies )) {
39
+			return;
40
+		}
39 41
 
40 42
 		$this->normalize();
41 43
 
@@ -50,10 +52,14 @@  discard block
 block discarded – undo
50 52
 	 */
51 53
 	public function filterByTaxonomy( WP_Query $query )
52 54
 	{
53
-		if( !is_admin() || ( new Helper )->getCurrentScreen()->base != 'edit' )return;
55
+		if( !is_admin() || ( new Helper )->getCurrentScreen()->base != 'edit' ) {
56
+			return;
57
+		}
54 58
 		$vars = &$query->query_vars;
55 59
 		foreach( array_keys( $this->taxonomies ) as $taxonomy ) {
56
-			if( !isset( $vars[$taxonomy] ))return;
60
+			if( !isset( $vars[$taxonomy] )) {
61
+				return;
62
+			}
57 63
 			if( $term = get_term_by( 'id', $vars[$taxonomy], $taxonomy )) {
58 64
 				$vars[$taxonomy] = $term->slug;
59 65
 			}
@@ -69,7 +75,9 @@  discard block
 block discarded – undo
69 75
 	{
70 76
 		global $wp_query;
71 77
 		foreach( $this->taxonomies as $taxonomy => $args ) {
72
-			if( !in_array( get_current_screen()->post_type, $args['post_types'] ))continue;
78
+			if( !in_array( get_current_screen()->post_type, $args['post_types'] )) {
79
+				continue;
80
+			}
73 81
 			$selected = isset( $wp_query->query[$taxonomy] )
74 82
 				? $wp_query->query[$taxonomy]
75 83
 				: false;
Please login to merge, or discard this patch.
src/Application.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,7 +100,9 @@  discard block
 block discarded – undo
100 100
 			trailingslashit( dirname( dirname( ABSPATH ))),
101 101
 		]);
102 102
 		foreach( (array) $locations as $location ) {
103
-			if( !file_exists( $location . $filename ))continue;
103
+			if( !file_exists( $location . $filename )) {
104
+				continue;
105
+			}
104 106
 			return $location . $filename;
105 107
 		}
106 108
 		return null;
@@ -140,7 +142,9 @@  discard block
 block discarded – undo
140 142
 			$view,
141 143
 			$data
142 144
 		);
143
-		if( !file_exists( $file ))return;
145
+		if( !file_exists( $file )) {
146
+			return;
147
+		}
144 148
 		extract( $data );
145 149
 		include $file;
146 150
 	}
Please login to merge, or discard this patch.
src/GateKeeper.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,9 @@  discard block
 block discarded – undo
49 49
 	{
50 50
 		if( get_current_screen()->id != sprintf( 'settings_page_%s', pollux_app()->id )
51 51
 			|| filter_input( INPUT_GET, 'action' ) != 'activate'
52
-		)return;
52
+		) {
53
+			return;
54
+		}
53 55
 		$plugin = filter_input( INPUT_GET, 'plugin' );
54 56
 		check_admin_referer( 'activate-plugin_' . $plugin );
55 57
 		$result = activate_plugin( $plugin, null, is_network_admin(), true );
@@ -99,7 +101,9 @@  discard block
 block discarded – undo
99 101
 	public function hasPendingDependencies()
100 102
 	{
101 103
 		foreach( static::DEPENDENCIES as $plugin => $data ) {
102
-			if( !$this->isPluginDependency( $plugin ))continue;
104
+			if( !$this->isPluginDependency( $plugin )) {
105
+				continue;
106
+			}
103 107
 			$this->isPluginActive( $plugin );
104 108
 			$this->isPluginVersionValid( $plugin );
105 109
 		}
@@ -178,7 +182,9 @@  discard block
 block discarded – undo
178 182
 		if( get_current_screen()->id != 'settings_page_pollux'
179 183
 			|| pollux_app()->config->disable_config
180 184
 			|| !$this->hasPendingDependencies()
181
-		)return;
185
+		) {
186
+			return;
187
+		}
182 188
 		$message = sprintf( '<strong>%s:</strong> %s',
183 189
 			__( 'Pollux requires the latest version of the following plugins', 'pollux' ),
184 190
 			$this->getDependencyLinks()
Please login to merge, or discard this patch.
src/PostType/PostType.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,9 @@
 block discarded – undo
44 44
 	 */
45 45
 	public function init()
46 46
 	{
47
-		if( empty( $this->app->config->post_types ))return;
47
+		if( empty( $this->app->config->post_types )) {
48
+			return;
49
+		}
48 50
 
49 51
 		$this->setColumns();
50 52
 		$this->normalize();
Please login to merge, or discard this patch.
src/PostType/Archive.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,7 +129,9 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function registerFeaturedImageMetaBox()
131 131
 	{
132
-		if( !current_user_can( 'upload_files' ))return;
132
+		if( !current_user_can( 'upload_files' )) {
133
+			return;
134
+		}
133 135
 		add_meta_box( 'postimagediv', __( 'Featured Image', 'pollux' ), [$this, 'renderFeaturedImageMetaBox'], null, 'side', 'low' );
134 136
 	}
135 137
 
@@ -205,7 +207,9 @@  discard block
 block discarded – undo
205 207
 	public function renderPage()
206 208
 	{
207 209
 		$type = $this->getPostType();
208
-		if( empty( $type ))return;
210
+		if( empty( $type )) {
211
+			return;
212
+		}
209 213
 		$labels = get_post_type_labels( get_post_type_object( $type ));
210 214
 		$this->app->render( 'archive/index', [
211 215
 			'columns' => get_current_screen()->get_columns(),
Please login to merge, or discard this patch.
src/PostType/DisablePosts.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	public function init()
25 25
 	{
26
-		if( !$this->app->config->disable_posts )return;
26
+		if( !$this->app->config->disable_posts ) {
27
+			return;
28
+		}
27 29
 
28 30
 		remove_action( 'welcome_panel', 'wp_welcome_panel' );
29 31
 
@@ -46,7 +48,9 @@  discard block
 block discarded – undo
46 48
 	{
47 49
 		if( !in_array(( new Helper )->getCurrentScreen()->pagenow, [
48 50
 			'edit.php', 'edit-tags.php', 'post-new.php',
49
-		]))return;
51
+		])) {
52
+			return;
53
+		}
50 54
 
51 55
 		if( !filter_input_array( INPUT_GET, [
52 56
 			'post_type' => FILTER_DEFAULT,
@@ -98,11 +102,15 @@  discard block
 block discarded – undo
98 102
 	 */
99 103
 	public function modifyDashboardWidgets()
100 104
 	{
101
-		if( !is_blog_admin() || !current_user_can( 'edit_posts' ))return;
105
+		if( !is_blog_admin() || !current_user_can( 'edit_posts' )) {
106
+			return;
107
+		}
102 108
 
103 109
 		global $wp_meta_boxes;
104 110
 		$widgets = &$wp_meta_boxes['dashboard']['normal']['core'];
105
-		if( !isset( $widgets['dashboard_right_now']['callback'] ))return;
111
+		if( !isset( $widgets['dashboard_right_now']['callback'] )) {
112
+			return;
113
+		}
106 114
 		$widgets['dashboard_right_now']['callback'] = function() {
107 115
 			ob_start();
108 116
 			wp_dashboard_right_now();
Please login to merge, or discard this patch.
uninstall.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,9 @@
 block discarded – undo
3 3
 defined( 'WP_UNINSTALL_PLUGIN' ) || die;
4 4
 
5 5
 require_once __DIR__.'/pollux.php';
6
-if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() )return;
6
+if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() ) {
7
+	return;
8
+}
7 9
 
8 10
 delete_option( GeminiLabs\Pollux\Config\Config::id() );
9 11
 delete_option( GeminiLabs\Pollux\PostType\Archive::id() );
Please login to merge, or discard this patch.
pollux.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@
 block discarded – undo
21 21
 if( !class_exists( 'GL_Plugin_Check_v3' )) {
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24
-if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return;
24
+if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() ) {
25
+	return;
26
+}
25 27
 require_once __DIR__.'/autoload.php';
26 28
 require_once __DIR__.'/helpers.php';
27 29
 require_once __DIR__.'/thirdparty.php';
Please login to merge, or discard this patch.
autoload.php 1 patch
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@  discard block
 block discarded – undo
5 5
 /**
6 6
  * PSR-4 autoloader
7 7
  */
8
-spl_autoload_register( function( $class )
9
-{
8
+spl_autoload_register( function( $class ) {
10 9
 	$namespaces = [
11 10
 		'GeminiLabs\\Pollux\\' => __DIR__ . '/src/',
12 11
 		'GeminiLabs\\Pollux\\Tests\\' => __DIR__ . '/tests/',
@@ -14,9 +13,13 @@  discard block
 block discarded – undo
14 13
 	];
15 14
 	foreach( $namespaces as $prefix => $base_dir ) {
16 15
 		$len = strlen( $prefix );
17
-		if( strncmp( $prefix, $class, $len ) !== 0 )continue;
16
+		if( strncmp( $prefix, $class, $len ) !== 0 ) {
17
+			continue;
18
+		}
18 19
 		$file = $base_dir . str_replace( '\\', '/', substr( $class, $len ) ) . '.php';
19
-		if( !file_exists( $file ) )continue;
20
+		if( !file_exists( $file ) ) {
21
+			continue;
22
+		}
20 23
 		require $file;
21 24
 		break;
22 25
 	}
Please login to merge, or discard this patch.