Passed
Branch master (3d135a)
by Paul
02:50
created
src/PostMeta.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function get( $metaKey, array $args = [] )
14 14
 	{
15
-		if( empty( $metaKey ))return;
15
+		if( empty( $metaKey )) {
16
+			return;
17
+		}
16 18
 
17 19
 		$args = $this->normalize( $args );
18 20
 		$metaKey = $this->buildMetaKey( $metaKey, $args['prefix'] );
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
10 10
 	 * @param string $metaKey
11 11
 	 * @return mixed
12 12
 	 */
13
-	public function get( $metaKey, array $args = [] )
13
+	public function get( $metaKey, array $args = [ ] )
14 14
 	{
15
-		if( empty( $metaKey ))return;
15
+		if( empty( $metaKey ) )return;
16 16
 
17 17
 		$args = $this->normalize( $args );
18
-		$metaKey = $this->buildMetaKey( $metaKey, $args['prefix'] );
19
-		$metaValue = get_post_meta( $args['id'], $metaKey, $args['single'] );
18
+		$metaKey = $this->buildMetaKey( $metaKey, $args[ 'prefix' ] );
19
+		$metaValue = get_post_meta( $args[ 'id' ], $metaKey, $args[ 'single' ] );
20 20
 
21
-		if( is_string( $metaValue )) {
21
+		if( is_string( $metaValue ) ) {
22 22
 			$metaValue = trim( $metaValue );
23 23
 		}
24 24
 		return empty( $metaValue )
25
-			? $args['fallback']
25
+			? $args[ 'fallback' ]
26 26
 			: $metaValue;
27 27
 	}
28 28
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	protected function buildMetaKey( $metaKey, $prefix )
35 35
 	{
36
-		return ( substr( $metaKey, 0, 1 ) == '_' && !empty( $prefix ))
36
+		return ( substr( $metaKey, 0, 1 ) == '_' && !empty( $prefix ) )
37 37
 			? sprintf( '_%s%s', rtrim( $prefix, '_' ), $metaKey )
38 38
 			: $prefix . $metaKey;
39 39
 	}
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
 			'single'   => true,
50 50
 			'prefix'   => apply_filters( 'pollux/prefix', Application::PREFIX ),
51 51
 		];
52
-		return shortcode_atts( $defaults, array_change_key_case( $args ));
52
+		return shortcode_atts( $defaults, array_change_key_case( $args ) );
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.
src/SiteMeta.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public function get( $group = null, $key = null, $fallback = null )
16 16
 	{
17
-		$options = get_option( apply_filters( 'pollux/settings/option', Settings::ID ));
18
-		if( empty( $options )) {
17
+		$options = get_option( apply_filters( 'pollux/settings/option', Settings::ID ) );
18
+		if( empty( $options ) ) {
19 19
 			return $fallback;
20 20
 		}
21
-		if( !is_string( $group )) {
21
+		if( !is_string( $group ) ) {
22 22
 			return $options;
23 23
 		}
24 24
 		$group = $this->normalize( $options, $group, $fallback );
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	protected function normalize( array $options, $key, $fallback )
36 36
 	{
37
-		if( !array_key_exists( $key, $options )) {
37
+		if( !array_key_exists( $key, $options ) ) {
38 38
 			return $fallback;
39 39
 		}
40
-		$option = $options[$key];
40
+		$option = $options[ $key ];
41 41
 		$option = is_array( $option )
42 42
 			? array_filter( $option )
43 43
 			: trim( $option );
Please login to merge, or discard this patch.
src/Config/Config.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$configFile = $this->getFile();
30 30
 		$configYaml = $this->getYaml();
31
-		if( $this->shouldGenerate( $configYaml )) {
31
+		if( $this->shouldGenerate( $configYaml ) ) {
32 32
 			file_put_contents( $configFile, sprintf( '<?php // DO NOT MODIFY THIS FILE DIRECTLY!%sreturn %s;',
33 33
 				PHP_EOL,
34 34
 				$this->parseYaml( $configYaml )
35
-			));
35
+			) );
36 36
 		}
37 37
 		return include $configFile;
38 38
 	}
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 	public function getFile( $filename = 'pollux-config.php' )
44 44
 	{
45 45
 		$filename = apply_filters( 'pollux/config/dist/file', $filename );
46
-		$storagePath = trailingslashit( apply_filters( 'pollux/config/dist/location', WP_CONTENT_DIR ));
47
-		if( !is_dir( $storagePath )) {
46
+		$storagePath = trailingslashit( apply_filters( 'pollux/config/dist/location', WP_CONTENT_DIR ) );
47
+		if( !is_dir( $storagePath ) ) {
48 48
 			mkdir( $storagePath, 0775 );
49 49
 		}
50 50
 		return sprintf( '%s%s', $storagePath, $filename );
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 			trailingslashit( trailingslashit( $theme->theme_root ) . $theme->template ),
63 63
 			trailingslashit( WP_CONTENT_DIR ),
64 64
 			trailingslashit( ABSPATH ),
65
-			trailingslashit( dirname( ABSPATH )),
66
-			trailingslashit( dirname( dirname( ABSPATH ))),
67
-		]);
65
+			trailingslashit( dirname( ABSPATH ) ),
66
+			trailingslashit( dirname( dirname( ABSPATH ) ) ),
67
+		] );
68 68
 		foreach( (array) $configLocations as $location ) {
69
-			if( !file_exists( $location . $configYaml ))continue;
69
+			if( !file_exists( $location . $configYaml ) )continue;
70 70
 			return $location . $configYaml;
71 71
 		}
72 72
 		return $this->app->path( 'defaults.yml' );
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
 	public function parseYaml( $yamlFile )
80 80
 	{
81 81
 		$config = wp_parse_args(
82
-			Yaml::parse( file_get_contents( $yamlFile )),
83
-			Yaml::parse( file_get_contents( $this->app->path( 'defaults.yml' )))
82
+			Yaml::parse( file_get_contents( $yamlFile ) ),
83
+			Yaml::parse( file_get_contents( $this->app->path( 'defaults.yml' ) ) )
84 84
 		);
85
-		return $this->parseRawStrings( var_export( $config, true ));
85
+		return $this->parseRawStrings( var_export( $config, true ) );
86 86
 	}
87 87
 
88 88
 	/**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	protected function shouldGenerate( $configYaml )
105 105
 	{
106 106
 		$configFile = $this->getFile();
107
-		if( !file_exists( $configFile )) {
107
+		if( !file_exists( $configFile ) ) {
108 108
 			return true;
109 109
 		}
110 110
 		return filemtime( $configYaml ) >= filemtime( $configFile );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,9 @@
 block discarded – undo
66 66
 			trailingslashit( dirname( dirname( ABSPATH ))),
67 67
 		]);
68 68
 		foreach( (array) $configLocations as $location ) {
69
-			if( !file_exists( $location . $configYaml ))continue;
69
+			if( !file_exists( $location . $configYaml )) {
70
+				continue;
71
+			}
70 72
 			return $location . $configYaml;
71 73
 		}
72 74
 		return $this->app->path( 'defaults.yml' );
Please login to merge, or discard this patch.
src/Settings/Settings.php 3 patches
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$this->normalize();
41 41
 
42
-		add_action( 'admin_menu',                             [$this, 'addPage'] );
43
-		add_action( 'pollux/settings/init',                   [$this, 'addSubmitMetaBox'] );
44
-		add_action( 'current_screen',                         [$this, 'register'] );
45
-		add_action( 'admin_menu',                             [$this, 'registerSetting'] );
46
-		add_action( 'pollux/settings/init',                   [$this, 'reset'] );
47
-		add_action( "admin_footer-toplevel_page_{$this->id}", [$this, 'renderFooterScript'] );
48
-		add_filter( 'pollux/settings/instruction',            [$this, 'filterInstruction'], 10, 3 );
49
-		add_filter( 'wp_redirect',                            [$this, 'filterRedirectOnSave'] );
42
+		add_action( 'admin_menu', [ $this, 'addPage' ] );
43
+		add_action( 'pollux/settings/init', [ $this, 'addSubmitMetaBox' ] );
44
+		add_action( 'current_screen', [ $this, 'register' ] );
45
+		add_action( 'admin_menu', [ $this, 'registerSetting' ] );
46
+		add_action( 'pollux/settings/init', [ $this, 'reset' ] );
47
+		add_action( "admin_footer-toplevel_page_{$this->id}", [ $this, 'renderFooterScript' ] );
48
+		add_filter( 'pollux/settings/instruction', [ $this, 'filterInstruction' ], 10, 3 );
49
+		add_filter( 'wp_redirect', [ $this, 'filterRedirectOnSave' ] );
50 50
 	}
51 51
 
52 52
 	/**
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 			__( 'Site Settings', 'pollux' ),
61 61
 			'edit_theme_options',
62 62
 			$this->id,
63
-			[$this, 'renderPage'],
63
+			[ $this, 'renderPage' ],
64 64
 			'dashicons-screenoptions',
65 65
 			1313
66
-		]));
66
+		] ) );
67 67
 	}
68 68
 
69 69
 	/**
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		call_user_func_array( 'add_meta_box', apply_filters( 'pollux/settings/metabox/submit', [
76 76
 			'submitdiv',
77 77
 			__( 'Save Settings', 'pollux' ),
78
-			[ $this, 'renderSubmitMetaBox'],
78
+			[ $this, 'renderSubmitMetaBox' ],
79 79
 			$this->hook,
80 80
 			'side',
81 81
 			'high',
82
-		]));
82
+		] ) );
83 83
 	}
84 84
 
85 85
 	/**
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
 	public function filterRedirectOnSave( $location )
103 103
 	{
104 104
 		if( strpos( $location, 'settings-updated=true' ) === false
105
-			|| strpos( $location, sprintf( 'page=%s', $this->id )) === false ) {
105
+			|| strpos( $location, sprintf( 'page=%s', $this->id ) ) === false ) {
106 106
 			return $location;
107 107
 		}
108
-		return add_query_arg([
108
+		return add_query_arg( [
109 109
 			'page' => $this->id,
110 110
 			'settings-updated' => 'true',
111
-		], admin_url( 'admin.php' ));
111
+		], admin_url( 'admin.php' ) );
112 112
 	}
113 113
 
114 114
 	/**
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function filterSavedSettings( $settings )
120 120
 	{
121
-		if( is_null( $settings )) {
122
-			$settings = [];
121
+		if( is_null( $settings ) ) {
122
+			$settings = [ ];
123 123
 		}
124 124
 		return apply_filters( 'pollux/settings/save', $settings );
125 125
 	}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		add_screen_option( 'layout_columns', [
138 138
 			'max' => 2,
139 139
 			'default' => 2,
140
-		]);
140
+		] );
141 141
 		do_action( 'pollux/settings/init' );
142 142
 	}
143 143
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function registerSetting()
149 149
 	{
150
-		register_setting( $this->id, $this->id, [$this, 'filterSavedSettings'] );
150
+		register_setting( $this->id, $this->id, [ $this, 'filterSavedSettings' ] );
151 151
 	}
152 152
 
153 153
 	/**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			'confirm' => __( 'Are you sure want to do this?', 'pollux' ),
161 161
 			'hook' => $this->hook,
162 162
 			'id' => $this->id,
163
-		]);
163
+		] );
164 164
 	}
165 165
 
166 166
 	/**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 			'columns' => get_current_screen()->get_columns(),
174 174
 			'id' => $this->id,
175 175
 			'title' => __( 'Site Settings', 'pollux' ),
176
-		]);
176
+		] );
177 177
 	}
178 178
 
179 179
 	/**
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
 		];
190 190
 		$this->render( 'settings/submit', [
191 191
 			'reset' => __( 'Reset Settings', 'pollux' ),
192
-			'reset_url' => esc_url( add_query_arg( $query, admin_url( 'admin.php' ))),
192
+			'reset_url' => esc_url( add_query_arg( $query, admin_url( 'admin.php' ) ) ),
193 193
 			'submit' => get_submit_button( __( 'Save', 'pollux' ), 'primary', 'submit', false ),
194
-		]);
194
+		] );
195 195
 	}
196 196
 
197 197
 	/**
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
 		if( filter_input( INPUT_GET, 'page' ) !== $this->id
204 204
 			|| filter_input( INPUT_GET, 'action' ) !== 'reset'
205 205
 		)return;
206
-		if( wp_verify_nonce( filter_input( INPUT_GET, '_wpnonce' ), $this->hook )) {
206
+		if( wp_verify_nonce( filter_input( INPUT_GET, '_wpnonce' ), $this->hook ) ) {
207 207
 			update_option( $this->id, $this->getDefaults() );
208 208
 			return add_settings_error( $this->id, 'reset', __( 'Settings reset to defaults.', 'pollux' ), 'updated' );
209 209
 		}
210
-		add_settings_error( $this->id, 'reset', __( 'Failed to reset settings. Please refresh the page and try again.', 'pollux' ));
210
+		add_settings_error( $this->id, 'reset', __( 'Failed to reset settings. Please refresh the page and try again.', 'pollux' ) );
211 211
 	}
212 212
 
213 213
 	/**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	protected function filterArrayByKey( array $array, $key )
218 218
 	{
219 219
 		return array_filter( $array, function( $value ) use( $key ) {
220
-			return !empty( $value[$key] );
220
+			return !empty( $value[ $key ] );
221 221
 		});
222 222
 	}
223 223
 
@@ -230,11 +230,11 @@  discard block
 block discarded – undo
230 230
 
231 231
 		array_walk( $metaboxes, function( &$metabox ) {
232 232
 			$fields = array_map( function( $field ) {
233
-				$field = wp_parse_args( $field, ['std' => ''] );
234
-				return [$field['slug'] => $field['std']];
235
-			}, $this->filterArrayByKey( $metabox['fields'], 'slug' ));
233
+				$field = wp_parse_args( $field, [ 'std' => '' ] );
234
+				return [ $field[ 'slug' ] => $field[ 'std' ] ];
235
+			}, $this->filterArrayByKey( $metabox[ 'fields' ], 'slug' ) );
236 236
 			$metabox = [
237
-				$metabox['slug'] => call_user_func_array( 'array_merge', $fields ),
237
+				$metabox[ 'slug' ] => call_user_func_array( 'array_merge', $fields ),
238 238
 			];
239 239
 		});
240 240
 		return call_user_func_array( 'array_merge', $metaboxes );
@@ -245,14 +245,14 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	protected function normalize()
247 247
 	{
248
-		foreach( $this->app->config['settings'] as $id => $metabox ) {
248
+		foreach( $this->app->config[ 'settings' ] as $id => $metabox ) {
249 249
 			$defaults = [
250
-				'condition' => [],
251
-				'fields' => [],
250
+				'condition' => [ ],
251
+				'fields' => [ ],
252 252
 				'id' => $id,
253 253
 				'slug' => $id,
254 254
 			];
255
-			$this->metaboxes[] = $this->setDependencies(
255
+			$this->metaboxes[ ] = $this->setDependencies(
256 256
 				$this->normalizeThis( $metabox, $defaults, $id )
257 257
 			);
258 258
 		}
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	protected function normalizeFieldName( $name, array $data, $parentId )
267 267
 	{
268
-		if( !empty( $name )) {
268
+		if( !empty( $name ) ) {
269 269
 			return $name;
270 270
 		}
271
-		$name = str_replace( sprintf( '%s-%s-', $this->id, $parentId ), '', $data['id'] );
271
+		$name = str_replace( sprintf( '%s-%s-', $this->id, $parentId ), '', $data[ 'id' ] );
272 272
 		return sprintf( '%s[%s][%s]', $this->id, $parentId, $name );
273 273
 	}
274 274
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -133,7 +133,9 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	public function register()
135 135
 	{
136
-		if( $this->app->screen()->id != $this->hook )return;
136
+		if( $this->app->screen()->id != $this->hook ) {
137
+			return;
138
+		}
137 139
 		foreach( parent::register() as $metabox ) {
138 140
 			new RWMetaBox( $metabox );
139 141
 		}
@@ -205,7 +207,9 @@  discard block
 block discarded – undo
205 207
 	{
206 208
 		if( filter_input( INPUT_GET, 'page' ) !== $this->id
207 209
 			|| filter_input( INPUT_GET, 'action' ) !== 'reset'
208
-		)return;
210
+		) {
211
+			return;
212
+		}
209 213
 		if( wp_verify_nonce( filter_input( INPUT_GET, '_wpnonce' ), $this->hook )) {
210 214
 			update_option( $this->id, $this->getDefaults() );
211 215
 			return add_settings_error( $this->id, 'reset', __( 'Settings reset to defaults.', 'pollux' ), 'updated' );
@@ -219,7 +223,8 @@  discard block
 block discarded – undo
219 223
 	 */
220 224
 	protected function filterArrayByKey( array $array, $key )
221 225
 	{
222
-		return array_filter( $array, function( $value ) use( $key ) {
226
+		return array_filter( $array, function( $value ) use( $key )
227
+		{
223 228
 			return !empty( $value[$key] );
224 229
 		});
225 230
 	}
@@ -231,8 +236,10 @@  discard block
 block discarded – undo
231 236
 	{
232 237
 		$metaboxes = $this->filterArrayByKey( $this->metaboxes, 'slug' );
233 238
 
234
-		array_walk( $metaboxes, function( &$metabox ) {
235
-			$fields = array_map( function( $field ) {
239
+		array_walk( $metaboxes, function( &$metabox )
240
+		{
241
+			$fields = array_map( function( $field )
242
+			{
236 243
 				$field = wp_parse_args( $field, ['std' => ''] );
237 244
 				return [$field['slug'] => $field['std']];
238 245
 			}, $this->filterArrayByKey( $metabox['fields'], 'slug' ));
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 	/**
16 16
 	 * @var string
17 17
 	 */
18
-	CONST ID = 'pollux_settings';
18
+	const ID = 'pollux_settings';
19 19
 
20 20
 	/**
21 21
 	 * @var string
Please login to merge, or discard this patch.
src/Taxonomy/Taxonomy.php 2 patches
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 
14 14
 	const TAXONOMY_DEFAULTS = [
15 15
 		'hierarchical'      => true,
16
-		'labels'            => [],
16
+		'labels'            => [ ],
17 17
 		'menu_name'         => '',
18 18
 		'plural'            => '',
19
-		'post_types'        => [],
19
+		'post_types'        => [ ],
20 20
 		'public'            => true,
21 21
 		'rewrite'           => true,
22 22
 		'show_admin_column' => true,
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * @var array
29 29
 	 */
30
-	public $taxonomies = [];
30
+	public $taxonomies = [ ];
31 31
 
32 32
 	/**
33 33
 	 * {@inheritdoc}
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	{
37 37
 		$this->normalize();
38 38
 
39
-		add_action( 'restrict_manage_posts', [ $this, 'printFilters'] );
40
-		add_action( 'init',                  [ $this, 'register'] );
41
-		add_filter( 'parse_query',           [ $this, 'filterByTaxonomy'] );
39
+		add_action( 'restrict_manage_posts', [ $this, 'printFilters' ] );
40
+		add_action( 'init', [ $this, 'register' ] );
41
+		add_filter( 'parse_query', [ $this, 'filterByTaxonomy' ] );
42 42
 	}
43 43
 
44 44
 	/**
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 		if( !is_admin() || $this->app->screen()->base != 'edit' )return;
51 51
 		$vars = &$query->query_vars;
52 52
 		foreach( array_keys( $this->taxonomies ) as $taxonomy ) {
53
-			if( !isset( $vars[$taxonomy] ))return;
54
-			if( $term = get_term_by( 'id', $vars[$taxonomy], $taxonomy )) {
55
-				$vars[$taxonomy] = $term->slug;
53
+			if( !isset( $vars[ $taxonomy ] ) )return;
54
+			if( $term = get_term_by( 'id', $vars[ $taxonomy ], $taxonomy ) ) {
55
+				$vars[ $taxonomy ] = $term->slug;
56 56
 			}
57 57
 		}
58 58
 		return $query;
@@ -66,18 +66,18 @@  discard block
 block discarded – undo
66 66
 	{
67 67
 		global $wp_query;
68 68
 		foreach( $this->taxonomies as $taxonomy => $args ) {
69
-			if( !in_array( get_current_screen()->post_type, $args['post_types'] ))continue;
70
-			$selected = isset( $wp_query->query[$taxonomy] )
71
-				? $wp_query->query[$taxonomy]
69
+			if( !in_array( get_current_screen()->post_type, $args[ 'post_types' ] ) )continue;
70
+			$selected = isset( $wp_query->query[ $taxonomy ] )
71
+				? $wp_query->query[ $taxonomy ]
72 72
 				: false;
73
-			wp_dropdown_categories([
73
+			wp_dropdown_categories( [
74 74
 				'hide_if_empty' => true,
75 75
 				'name' => $taxonomy,
76 76
 				'orderby' => 'name',
77 77
 				'selected' => $selected,
78
-				'show_option_all' => $args['labels']['all_items'],
78
+				'show_option_all' => $args[ 'labels' ][ 'all_items' ],
79 79
 				'taxonomy' => $taxonomy,
80
-			]);
80
+			] );
81 81
 		}
82 82
 	}
83 83
 
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 	public function register()
89 89
 	{
90 90
 		array_walk( $this->taxonomies, function( $args, $taxonomy ) {
91
-			register_taxonomy( $taxonomy, $args['post_types'], array_diff_key( $args, array_flip( static::CUSTOM_KEYS )));
92
-			foreach( $args['post_types'] as $type ) {
91
+			register_taxonomy( $taxonomy, $args[ 'post_types' ], array_diff_key( $args, array_flip( static::CUSTOM_KEYS ) ) );
92
+			foreach( $args[ 'post_types' ] as $type ) {
93 93
 				register_taxonomy_for_object_type( $taxonomy, $type );
94 94
 			}
95 95
 		});
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	protected function normalize()
102 102
 	{
103
-		foreach( $this->app->config['taxonomies'] as $taxonomy => $args ) {
104
-			$this->taxonomies[$taxonomy] = apply_filters( 'pollux/taxonomy/args',
103
+		foreach( $this->app->config[ 'taxonomies' ] as $taxonomy => $args ) {
104
+			$this->taxonomies[ $taxonomy ] = apply_filters( 'pollux/taxonomy/args',
105 105
 				$this->normalizeThis( $args, static::TAXONOMY_DEFAULTS, $taxonomy )
106 106
 			);
107 107
 		}
108 108
 		$this->taxonomies = array_diff_key(
109 109
 			$this->taxonomies,
110
-			get_taxonomies( ['_builtin' => true] )
110
+			get_taxonomies( [ '_builtin' => true ] )
111 111
 		);
112 112
 	}
113 113
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	protected function normalizeLabels( $labels, array $args )
119 119
 	{
120
-		return wp_parse_args( $labels, $this->setLabels( $args ));
120
+		return wp_parse_args( $labels, $this->setLabels( $args ) );
121 121
 	}
122 122
 
123 123
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	protected function normalizeMenuName( $menuname, array $args )
128 128
 	{
129 129
 		return empty( $menuname )
130
-			? $args['plural']
130
+			? $args[ 'plural' ]
131 131
 			: $menuname;
132 132
 	}
133 133
 
@@ -146,17 +146,17 @@  discard block
 block discarded – undo
146 146
 	protected function setLabels( array $args )
147 147
 	{
148 148
 		return apply_filters( 'pollux/taxonomy/labels', [
149
-			'add_new_item' => sprintf( _x( 'Add New %s', 'Add new taxonomy', 'pollux' ), $args['single'] ),
150
-			'all_items' => sprintf( _x( 'All %s', 'All taxonomies', 'pollux' ), $args['plural'] ),
151
-			'edit_item' => sprintf( _x( 'Edit %s', 'Edit taxonomy', 'pollux' ), $args['single'] ),
152
-			'menu_name' => $this->normalizeMenuName( $args['menu_name'], $args ),
153
-			'name' => $args['plural'],
154
-			'new_item_name' => sprintf( _x( 'New %s Name', 'New taxonomy name', 'pollux' ), $args['single'] ),
155
-			'not_found' => sprintf( _x( 'No %s found', 'No taxonomies found', 'pollux' ), $args['plural'] ),
156
-			'search_items' => sprintf( _x( 'Search %s', 'Search taxonomies', 'pollux' ), $args['plural'] ),
157
-			'singular_name' => $args['single'],
158
-			'update_item' => sprintf( _x( 'Update %s', 'Update taxonomy', 'pollux' ), $args['single'] ),
159
-			'view_item' => sprintf( _x( 'View %s', 'View taxonomy', 'pollux' ), $args['single'] ),
149
+			'add_new_item' => sprintf( _x( 'Add New %s', 'Add new taxonomy', 'pollux' ), $args[ 'single' ] ),
150
+			'all_items' => sprintf( _x( 'All %s', 'All taxonomies', 'pollux' ), $args[ 'plural' ] ),
151
+			'edit_item' => sprintf( _x( 'Edit %s', 'Edit taxonomy', 'pollux' ), $args[ 'single' ] ),
152
+			'menu_name' => $this->normalizeMenuName( $args[ 'menu_name' ], $args ),
153
+			'name' => $args[ 'plural' ],
154
+			'new_item_name' => sprintf( _x( 'New %s Name', 'New taxonomy name', 'pollux' ), $args[ 'single' ] ),
155
+			'not_found' => sprintf( _x( 'No %s found', 'No taxonomies found', 'pollux' ), $args[ 'plural' ] ),
156
+			'search_items' => sprintf( _x( 'Search %s', 'Search taxonomies', 'pollux' ), $args[ 'plural' ] ),
157
+			'singular_name' => $args[ 'single' ],
158
+			'update_item' => sprintf( _x( 'Update %s', 'Update taxonomy', 'pollux' ), $args[ 'single' ] ),
159
+			'view_item' => sprintf( _x( 'View %s', 'View taxonomy', 'pollux' ), $args[ 'single' ] ),
160 160
 		], $args );
161 161
 	}
162 162
 }
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,10 +47,14 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function filterByTaxonomy( WP_Query $query )
49 49
 	{
50
-		if( !is_admin() || $this->app->screen()->base != 'edit' )return;
50
+		if( !is_admin() || $this->app->screen()->base != 'edit' ) {
51
+			return;
52
+		}
51 53
 		$vars = &$query->query_vars;
52 54
 		foreach( array_keys( $this->taxonomies ) as $taxonomy ) {
53
-			if( !isset( $vars[$taxonomy] ))return;
55
+			if( !isset( $vars[$taxonomy] )) {
56
+				return;
57
+			}
54 58
 			if( $term = get_term_by( 'id', $vars[$taxonomy], $taxonomy )) {
55 59
 				$vars[$taxonomy] = $term->slug;
56 60
 			}
@@ -66,7 +70,9 @@  discard block
 block discarded – undo
66 70
 	{
67 71
 		global $wp_query;
68 72
 		foreach( $this->taxonomies as $taxonomy => $args ) {
69
-			if( !in_array( get_current_screen()->post_type, $args['post_types'] ))continue;
73
+			if( !in_array( get_current_screen()->post_type, $args['post_types'] )) {
74
+				continue;
75
+			}
70 76
 			$selected = isset( $wp_query->query[$taxonomy] )
71 77
 				? $wp_query->query[$taxonomy]
72 78
 				: false;
@@ -87,7 +93,8 @@  discard block
 block discarded – undo
87 93
 	 */
88 94
 	public function register()
89 95
 	{
90
-		array_walk( $this->taxonomies, function( $args, $taxonomy ) {
96
+		array_walk( $this->taxonomies, function( $args, $taxonomy )
97
+		{
91 98
 			register_taxonomy( $taxonomy, $args['post_types'], array_diff_key( $args, array_flip( static::CUSTOM_KEYS )));
92 99
 			foreach( $args['post_types'] as $type ) {
93 100
 				register_taxonomy_for_object_type( $taxonomy, $type );
Please login to merge, or discard this patch.
src/MetaBox/Condition.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	protected function normalizeCondition( $conditions )
31 31
 	{
32 32
 		$conditions = $this->toArray( $conditions );
33
-		if( count( array_filter( array_keys( $conditions ), 'is_string' )) == 0 ) {
33
+		if( count( array_filter( array_keys( $conditions ), 'is_string' ) ) == 0 ) {
34 34
 			foreach( $conditions as $key ) {
35
-				$conditions[str_replace( '!', '', $key )] = substr( $key, 0, 1 ) == '!' ? 0 : 1;
35
+				$conditions[ str_replace( '!', '', $key ) ] = substr( $key, 0, 1 ) == '!' ? 0 : 1;
36 36
 			}
37 37
 			$conditions = array_filter( $conditions, function( $key ) {
38 38
 				return !is_numeric( $key );
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		$hook = sprintf( 'pollux/%s/conditions', $this->getClassname() );
42 42
 		return array_intersect_key(
43 43
 			$conditions,
44
-			array_flip( apply_filters( $hook, static::$conditions ))
44
+			array_flip( apply_filters( $hook, static::$conditions ) )
45 45
 		);
46 46
 	}
47 47
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	protected function validateIsFrontPage( $value )
89 89
 	{
90
-		return $value == ( $this->getPostId() == get_option( 'page_on_front' ));
90
+		return $value == ( $this->getPostId() == get_option( 'page_on_front' ) );
91 91
 	}
92 92
 
93 93
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	protected function validateIsHome( $value )
98 98
 	{
99
-		return $value == ( $this->getPostId() == get_option( 'page_for_posts' ));
99
+		return $value == ( $this->getPostId() == get_option( 'page_for_posts' ) );
100 100
 	}
101 101
 
102 102
 	/**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	protected function validateIsPageTemplate( $value )
107 107
 	{
108
-		return basename( get_page_template_slug( $this->getPostId() )) == $value;
108
+		return basename( get_page_template_slug( $this->getPostId() ) ) == $value;
109 109
 	}
110 110
 
111 111
 	/**
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,8 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public function validate( array $conditions )
16 16
 	{
17
-		array_walk( $conditions, function( &$value, $key ) {
17
+		array_walk( $conditions, function( &$value, $key )
18
+		{
18 19
 			$method = $this->app->buildMethodName( $key, 'validate' );
19 20
 			$value = method_exists( $this, $method )
20 21
 				? $this->$method( $value )
@@ -34,7 +35,8 @@  discard block
 block discarded – undo
34 35
 			foreach( $conditions as $key ) {
35 36
 				$conditions[str_replace( '!', '', $key )] = substr( $key, 0, 1 ) == '!' ? 0 : 1;
36 37
 			}
37
-			$conditions = array_filter( $conditions, function( $key ) {
38
+			$conditions = array_filter( $conditions, function( $key )
39
+			{
38 40
 				return !is_numeric( $key );
39 41
 			}, ARRAY_FILTER_USE_KEY );
40 42
 		}
Please login to merge, or discard this patch.
src/MetaBox/MetaBox.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	/**
18 18
 	 * @var array
19 19
 	 */
20
-	public $metaboxes = [];
20
+	public $metaboxes = [ ];
21 21
 
22 22
 	/**
23 23
 	 * {@inheritdoc}
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		$this->normalize();
28 28
 
29
-		add_filter( 'rwmb_show',       [$this, 'show'], 10, 2 );
30
-		add_filter( 'rwmb_meta_boxes', [$this, 'register'] );
29
+		add_filter( 'rwmb_show', [ $this, 'show' ], 10, 2 );
30
+		add_filter( 'rwmb_meta_boxes', [ $this, 'register' ] );
31 31
 	}
32 32
 
33 33
 	/**
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function register()
38 38
 	{
39
-		if( current_user_can( 'switch_themes' )) {
39
+		if( current_user_can( 'switch_themes' ) ) {
40 40
 			$this->addInstructions();
41 41
 		}
42 42
 		$metaboxes = func_num_args()
43
-			? $this->toArray( func_get_arg(0) )
44
-			: [];
43
+			? $this->toArray( func_get_arg( 0 ) )
44
+			: [ ];
45 45
 		return array_merge( $metaboxes, $this->metaboxes );
46 46
 	}
47 47
 
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 	public function show( $bool, array $metabox )
53 53
 	{
54 54
 		if( defined( 'DOING_AJAX' )
55
-			|| !isset( $metabox['condition'] )
56
-			|| !$this->hasPostType( $metabox )) {
55
+			|| !isset( $metabox[ 'condition' ] )
56
+			|| !$this->hasPostType( $metabox ) ) {
57 57
 			return $bool;
58 58
 		}
59
-		return $this->validate( $metabox['condition'] );
59
+		return $this->validate( $metabox[ 'condition' ] );
60 60
 	}
61 61
 
62 62
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	protected function getPostId()
66 66
 	{
67
-		if( !( $postId = filter_input( INPUT_GET, 'post' ))) {
67
+		if( !( $postId = filter_input( INPUT_GET, 'post' ) ) ) {
68 68
 			$postId = filter_input( INPUT_POST, 'post_ID' );
69 69
 		}
70 70
 		return intval( $postId );
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 	{
78 78
 		return array_unique( iterator_to_array(
79 79
 			new RecursiveIteratorIterator(
80
-				new RecursiveArrayIterator( array_column( $this->metaboxes, 'post_types' ))
80
+				new RecursiveArrayIterator( array_column( $this->metaboxes, 'post_types' ) )
81 81
 			),
82 82
 			false
83
-		));
83
+		) );
84 84
 	}
85 85
 
86 86
 	/**
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	protected function hasPostType( array $metabox )
90 90
 	{
91
-		if( !isset( $metabox['post_types'] )) {
91
+		if( !isset( $metabox[ 'post_types' ] ) ) {
92 92
 			return true;
93 93
 		}
94
-		return in_array( get_post_type( $this->getPostId() ), $metabox['post_types'] );
94
+		return in_array( get_post_type( $this->getPostId() ), $metabox[ 'post_types' ] );
95 95
 	}
96 96
 
97 97
 	/**
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	protected function normalize()
101 101
 	{
102
-		foreach( $this->app->config['meta_boxes'] as $id => $metabox ) {
102
+		foreach( $this->app->config[ 'meta_boxes' ] as $id => $metabox ) {
103 103
 			$defaults = [
104
-				'condition' => [],
105
-				'fields' => [],
104
+				'condition' => [ ],
105
+				'fields' => [ ],
106 106
 				'id' => $id,
107
-				'post_types' => [],
107
+				'post_types' => [ ],
108 108
 				'slug' => $id,
109 109
 			];
110
-			$this->metaboxes[] = $this->setDependencies(
110
+			$this->metaboxes[ ] = $this->setDependencies(
111 111
 				$this->normalizeThis( $metabox, $defaults, $id )
112 112
 			);
113 113
 		}
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 	protected function normalizeFields( array $fields, array $data, $parentId )
132 132
 	{
133 133
 		return array_map( function( $id, $field ) use( $parentId ) {
134
-			$defaults =  [
135
-				'attributes' => [],
134
+			$defaults = [
135
+				'attributes' => [ ],
136 136
 				// 'condition' => [],
137 137
 				'depends' => '',
138 138
 				'id' => $id,
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	protected function setDependencies( array $metabox )
169 169
 	{
170
-		$fields = &$metabox['fields'];
170
+		$fields = &$metabox[ 'fields' ];
171 171
 		$depends = array_column( $fields, 'depends' );
172 172
 		array_walk( $depends, function( $value, $index ) use( &$fields ) {
173
-			if( empty( $value ))return;
174
-			$fields[$index]['attributes']['data-depends'] = $value;
173
+			if( empty( $value ) )return;
174
+			$fields[ $index ][ 'attributes' ][ 'data-depends' ] = $value;
175 175
 		});
176 176
 		return $metabox;
177 177
 	}
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,8 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	protected function normalizeFields( array $fields, array $data, $parentId )
132 132
 	{
133
-		return array_map( function( $id, $field ) use( $parentId ) {
133
+		return array_map( function( $id, $field ) use( $parentId )
134
+		{
134 135
 			$defaults =  [
135 136
 				'attributes' => [],
136 137
 				// 'condition' => [],
@@ -169,8 +170,11 @@  discard block
 block discarded – undo
169 170
 	{
170 171
 		$fields = &$metabox['fields'];
171 172
 		$depends = array_column( $fields, 'depends' );
172
-		array_walk( $depends, function( $value, $index ) use( &$fields ) {
173
-			if( empty( $value ))return;
173
+		array_walk( $depends, function( $value, $index ) use( &$fields )
174
+		{
175
+			if( empty( $value )) {
176
+				return;
177
+			}
174 178
 			$fields[$index]['attributes']['data-depends'] = $value;
175 179
 		});
176 180
 		return $metabox;
Please login to merge, or discard this patch.
src/MetaBox/Instruction.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,9 +16,12 @@  discard block
 block discarded – undo
16 16
 	 */
17 17
 	protected function addInstructions()
18 18
 	{
19
-		if( !count( array_filter( $this->metaboxes, function( $metabox ) {
19
+		if( !count( array_filter( $this->metaboxes, function( $metabox )
20
+		{
20 21
 			return $this->show( false, $metabox );
21
-		})))return;
22
+		}))) {
23
+			return;
24
+		}
22 25
 		$this->metaboxes[] = [
23 26
 			'id' => 'infodiv',
24 27
 			'post_types' => $this->getPostTypes(),
@@ -38,8 +41,10 @@  discard block
 block discarded – undo
38 41
 	 */
39 42
 	protected function generateInstructions()
40 43
 	{
41
-		return array_reduce( $this->getInstructions(), function( $html, $metabox ) {
42
-			$fields = array_reduce( array_column( $metabox['fields'], 'slug' ), function( $html, $slug ) use( $metabox ) {
44
+		return array_reduce( $this->getInstructions(), function( $html, $metabox )
45
+		{
46
+			$fields = array_reduce( array_column( $metabox['fields'], 'slug' ), function( $html, $slug ) use( $metabox )
47
+			{
43 48
 				$hook = sprintf( 'pollux/%s/instruction', $this->getClassname() );
44 49
 				return $html . apply_filters( $hook, "PostMeta::get('{$slug}');", $slug, $metabox['slug'] ) . PHP_EOL;
45 50
 			});
@@ -55,7 +60,8 @@  discard block
 block discarded – undo
55 60
 	 */
56 61
 	protected function getInstructions()
57 62
 	{
58
-		return array_filter( $this->metaboxes, function( $metabox ) {
63
+		return array_filter( $this->metaboxes, function( $metabox )
64
+		{
59 65
 			return $this->validate( $metabox['condition'] )
60 66
 				&& $this->hasPostType( $metabox );
61 67
 		});
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	/**
15 15
 	 * @var array
16 16
 	 */
17
-	public $metaboxes = [];
17
+	public $metaboxes = [ ];
18 18
 
19 19
 	/**
20 20
 	 * @return void
@@ -23,18 +23,18 @@  discard block
 block discarded – undo
23 23
 	{
24 24
 		if( !count( array_filter( $this->metaboxes, function( $metabox ) {
25 25
 			return $this->show( false, $metabox );
26
-		})))return;
27
-		$this->metaboxes[] = [
26
+		}) ) )return;
27
+		$this->metaboxes[ ] = [
28 28
 			'id' => 'infodiv',
29 29
 			'post_types' => $this->getPostTypes(),
30 30
 			'title' => __( 'How to use in your theme', 'pollux' ),
31 31
 			'context' => 'side',
32 32
 			'priority' => 'low',
33
-			'fields' => [[
33
+			'fields' => [ [
34 34
 				'slug' => '',
35 35
 				'std' => $this->generateInstructions(),
36 36
 				'type' => 'custom_html',
37
-			]],
37
+			] ],
38 38
 		];
39 39
 	}
40 40
 
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	protected function generateInstructions()
45 45
 	{
46 46
 		return array_reduce( $this->getInstructions(), function( $html, $metabox ) {
47
-			$fields = array_reduce( array_column( $metabox['fields'], 'slug' ), function( $html, $slug ) use( $metabox ) {
47
+			$fields = array_reduce( array_column( $metabox[ 'fields' ], 'slug' ), function( $html, $slug ) use( $metabox ) {
48 48
 				$hook = sprintf( 'pollux/%s/instruction', $this->getClassname() );
49
-				return $html . apply_filters( $hook, "PostMeta::get('{$slug}');", $slug, $metabox['slug'] ) . PHP_EOL;
49
+				return $html . apply_filters( $hook, "PostMeta::get('{$slug}');", $slug, $metabox[ 'slug' ] ) . PHP_EOL;
50 50
 			});
51 51
 			return $html . sprintf( '<p><strong>%s</strong></p><pre class="my-sites nav-tab-active misc-pub-section">%s</pre>',
52
-				$metabox['title'],
52
+				$metabox[ 'title' ],
53 53
 				$fields
54 54
 			);
55 55
 		});
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	protected function getInstructions()
62 62
 	{
63 63
 		return array_filter( $this->metaboxes, function( $metabox ) {
64
-			return $this->validate( $metabox['condition'] )
64
+			return $this->validate( $metabox[ 'condition' ] )
65 65
 				&& $this->hasPostType( $metabox );
66 66
 		});
67 67
 	}
Please login to merge, or discard this patch.
src/PostType/Columns.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
18 18
 	{
19 19
 		foreach( $this->types as $type => $args ) {
20 20
 			add_action( "manage_{$type}_posts_custom_column", [$this, 'printColumnValue'], 10, 2 );
21
-			add_filter( "manage_{$type}_posts_columns", function( $columns ) use( $args ) {
21
+			add_filter( "manage_{$type}_posts_columns", function( $columns ) use( $args )
22
+			{
22 23
 				return count( $args['columns'] ) > 1
23 24
 					? $args['columns']
24 25
 					: $columns;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 	/**
10 10
 	 * @var array
11 11
 	 */
12
-	public $columns = [];
12
+	public $columns = [ ];
13 13
 
14 14
 	/**
15 15
 	 * @var array
16 16
 	 */
17
-	public $types = [];
17
+	public $types = [ ];
18 18
 
19 19
 	/**
20 20
 	 * @var Application
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 	public function initColumns()
28 28
 	{
29 29
 		foreach( $this->types as $type => $args ) {
30
-			add_action( "manage_{$type}_posts_custom_column", [$this, 'printColumnValue'], 10, 2 );
30
+			add_action( "manage_{$type}_posts_custom_column", [ $this, 'printColumnValue' ], 10, 2 );
31 31
 			add_filter( "manage_{$type}_posts_columns", function( $columns ) use( $args ) {
32
-				return count( $args['columns'] ) > 1
33
-					? $args['columns']
32
+				return count( $args[ 'columns' ] ) > 1
33
+					? $args[ 'columns' ]
34 34
 					: $columns;
35 35
 			});
36 36
 		}
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 	protected function getColumnImage( $postId )
58 58
 	{
59 59
 		if( has_post_thumbnail( $postId ) ) {
60
-			list( $src, $width, $height ) = wp_get_attachment_image_src( get_post_thumbnail_id( $postId ), [96, 48] );
60
+			list( $src, $width, $height ) = wp_get_attachment_image_src( get_post_thumbnail_id( $postId ), [ 96, 48 ] );
61 61
 			$image = sprintf( '<img src="%s" alt="%s" width="%s" height="%s">',
62
-				esc_url( set_url_scheme( $src )),
63
-				esc_attr( get_the_title( $postId )),
62
+				esc_url( set_url_scheme( $src ) ),
63
+				esc_attr( get_the_title( $postId ) ),
64 64
 				$width,
65 65
 				$height
66 66
 			);
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	protected function getColumnMedia()
77 77
 	{
78
-		return count( (new PostMeta)->get( 'media', [
79
-			'fallback' => [],
78
+		return count( ( new PostMeta )->get( 'media', [
79
+			'fallback' => [ ],
80 80
 			'single' => false,
81
-		]));
81
+		] ) );
82 82
 	}
83 83
 
84 84
 	/**
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 	protected function normalizeColumns( array $columns )
97 97
 	{
98 98
 		$columns = array_flip( $columns );
99
-		$columns = array_merge( $columns, array_intersect_key( $this->columns, $columns ));
100
-		return ['cb' => '<input type="checkbox">'] + $columns;
99
+		$columns = array_merge( $columns, array_intersect_key( $this->columns, $columns ) );
100
+		return [ 'cb' => '<input type="checkbox">' ] + $columns;
101 101
 	}
102 102
 
103 103
 	/**
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 	{
108 108
 		$comments = sprintf(
109 109
 			'<span class="vers comment-grey-bubble" title="%1$s"><span class="screen-reader-text">%1$s</span></span>',
110
-			$this->app->config['columns']['comments']
110
+			$this->app->config[ 'columns' ][ 'comments' ]
111 111
 		);
112
-		$columns = wp_parse_args( $this->app->config['columns'], [
112
+		$columns = wp_parse_args( $this->app->config[ 'columns' ], [
113 113
 			'comments' => $comments,
114
-		]);
114
+		] );
115 115
 		$this->columns = apply_filters( 'pollux/post_type/columns', $columns );
116 116
 	}
117 117
 }
Please login to merge, or discard this patch.