Completed
Push — master ( 71be25...1c4b64 )
by Paul
04:21
created
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( 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.
src/MetaBox/Condition.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,9 @@  discard block
 block discarded – undo
68 68
 	protected function isAbsoluteConditionValid( $method, array $values )
69 69
 	{
70 70
 		foreach( $values as $value ) {
71
-			if( $this->$method( $value ))continue;
71
+			if( $this->$method( $value )) {
72
+				continue;
73
+			}
72 74
 			return false;
73 75
 		}
74 76
 		return true;
@@ -98,7 +100,9 @@  discard block
 block discarded – undo
98 100
 	protected function isLooseConditionValid( $method, array $values )
99 101
 	{
100 102
 		foreach( $values as $value ) {
101
-			if( !$this->$method( $value ))continue;
103
+			if( !$this->$method( $value )) {
104
+				continue;
105
+			}
102 106
 			return true;
103 107
 		}
104 108
 		return false;
Please login to merge, or discard this patch.
src/MetaBox/MetaBox.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public function init()
34 34
 	{
35
-		if( empty( $this->app->config->{static::ID} ))return;
35
+		if( empty( $this->app->config->{static::ID} )) {
36
+			return;
37
+		}
36 38
 		$this->normalize( $this->app->config->{static::ID}, [
37 39
 			'post_types' => [],
38 40
 		]);
@@ -260,7 +262,9 @@  discard block
 block discarded – undo
260 262
 	protected function normalizeValidation( array $validation, array $data, $parentId )
261 263
 	{
262 264
 		foreach( ['messages', 'rules'] as $key ) {
263
-			if( empty( $validation[$key] ))continue;
265
+			if( empty( $validation[$key] )) {
266
+				continue;
267
+			}
264 268
 			foreach( $validation[$key] as $id => $value ) {
265 269
 				$validation[$key][$this->normalizeFieldName( $id, ['slug' => $id], $parentId )] = $value;
266 270
 				unset( $validation[$key][$id] );
@@ -277,7 +281,9 @@  discard block
 block discarded – undo
277 281
 		$fields = &$metabox['fields'];
278 282
 		$depends = array_column( $fields, 'depends' );
279 283
 		array_walk( $depends, function( $value, $index ) use( &$fields, $metabox ) {
280
-			if( empty( $value ))return;
284
+			if( empty( $value )) {
285
+				return;
286
+			}
281 287
 			$dependency = array_search( $value, array_column( $fields, 'id' ));
282 288
 			$fields[$index]['attributes']['data-depends'] = $value;
283 289
 			if( !$this->getMetaValue( $fields[$dependency]['slug'], '', $metabox['slug'] )) {
Please login to merge, or discard this patch.
src/Settings/Settings.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	public function init()
40 40
 	{
41
-		if( !$this->canProceed() )return;
41
+		if( !$this->canProceed() ) {
42
+			return;
43
+		}
42 44
 
43 45
 		$this->normalize( $this->app->config->{static::ID} );
44 46
 
@@ -124,7 +126,9 @@  discard block
 block discarded – undo
124 126
 	 */
125 127
 	public function register()
126 128
 	{
127
-		if( Helper::getCurrentScreen()->id != $this->hook )return;
129
+		if( Helper::getCurrentScreen()->id != $this->hook ) {
130
+			return;
131
+		}
128 132
 		if( $this->app->gatekeeper->hasDependency( self::DEPENDENCY )) {
129 133
 			foreach( parent::register() as $metabox ) {
130 134
 				new RWMetaBox( $metabox, static::ID, $this );
@@ -169,7 +173,9 @@  discard block
 block discarded – undo
169 173
 	 */
170 174
 	public function renderFooterScript()
171 175
 	{
172
-		if( Helper::getCurrentScreen()->id != $this->hook )return;
176
+		if( Helper::getCurrentScreen()->id != $this->hook ) {
177
+			return;
178
+		}
173 179
 		$this->app->render( 'settings/script', [
174 180
 			'confirm' => __( 'Are you sure want to do this?', 'pollux' ),
175 181
 			'hook' => $this->hook,
@@ -217,7 +223,9 @@  discard block
 block discarded – undo
217 223
 	{
218 224
 		if( filter_input( INPUT_GET, 'page' ) !== static::id()
219 225
 			|| filter_input( INPUT_GET, 'action' ) !== 'reset'
220
-		)return;
226
+		) {
227
+			return;
228
+		}
221 229
 		if( wp_verify_nonce( filter_input( INPUT_GET, '_wpnonce' ), $this->hook )) {
222 230
 			update_option( static::id(), $this->getDefaults() );
223 231
 			add_settings_error( static::id(), 'reset', __( 'Reset successful.', 'pollux' ), 'updated' );
Please login to merge, or discard this patch.
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() || Helper::getCurrentScreen()->base != 'edit' )return;
55
+		if( !is_admin() || 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.