Passed
Push — master ( e1cb7f...06feff )
by Paul
03:05
created
src/SettingsMetaBox.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 	{
14 14
 		parent::__construct( $metabox );
15 15
 
16
-		remove_action( 'add_meta_boxes', [$this, 'add_meta_boxes'] );
16
+		remove_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] );
17 17
 
18
-		add_filter( 'rwmb_field_meta',      [$this, '_get_field_meta'], 10, 3 );
19
-		add_action( 'pollux/settings/init', [$this, 'add_meta_boxes'] );
18
+		add_filter( 'rwmb_field_meta', [ $this, '_get_field_meta' ], 10, 3 );
19
+		add_action( 'pollux/settings/init', [ $this, 'add_meta_boxes' ] );
20 20
 	}
21 21
 
22 22
 	/**
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function _get_field_meta( $meta, array $field, $saved )
28 28
 	{
29
-		if( !$this->is_edit_screen() || empty( $field['id'] )) {
29
+		if( !$this->is_edit_screen() || empty( $field[ 'id' ] ) ) {
30 30
 			return $meta;
31 31
 		}
32
-		$meta = call_user_func( [RWMB_Field::get_class_name( $field ), 'esc_meta'], ( $saved
33
-			? (new SiteMeta)->get( $this->meta_box['id'], $field['id'] )
34
-			: $field['std']
35
-		));
32
+		$meta = call_user_func( [ RWMB_Field::get_class_name( $field ), 'esc_meta' ], ( $saved
33
+			? ( new SiteMeta )->get( $this->meta_box[ 'id' ], $field[ 'id' ] )
34
+			: $field[ 'std' ]
35
+		) );
36 36
 		return $this->_normalize_field_meta( $meta, $field );
37 37
 	}
38 38
 
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function _normalize_field_meta( $meta, array $field )
44 44
 	{
45
-		if( empty( $meta ) || !is_array( $meta )) {
46
-			if( $field['multiple'] ) {
47
-				$meta = [];
45
+		if( empty( $meta ) || !is_array( $meta ) ) {
46
+			if( $field[ 'multiple' ] ) {
47
+				$meta = [ ];
48 48
 			}
49
-			if( $field['clone'] ) {
50
-				$meta = [''];
49
+			if( $field[ 'clone' ] ) {
50
+				$meta = [ '' ];
51 51
 			}
52 52
 		}
53 53
 		return $meta;
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 	public function add_meta_boxes()
60 60
 	{
61 61
 		add_meta_box(
62
-			$this->meta_box['id'],
63
-			$this->meta_box['title'],
64
-			[$this, 'show'],
62
+			$this->meta_box[ 'id' ],
63
+			$this->meta_box[ 'title' ],
64
+			[ $this, 'show' ],
65 65
 			null,
66
-			$this->meta_box['context'],
67
-			$this->meta_box['priority']
66
+			$this->meta_box[ 'context' ],
67
+			$this->meta_box[ 'priority' ]
68 68
 		);
69 69
 	}
70 70
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	public function is_saved()
83 83
 	{
84 84
 		foreach( array_column( $this->fields, 'id' ) as $field ) {
85
-			if( !is_null( (new SiteMeta)->get( $this->meta_box['id'], $field, null ))) {
85
+			if( !is_null( ( new SiteMeta )->get( $this->meta_box[ 'id' ], $field, null ) ) ) {
86 86
 				return true;
87 87
 			}
88 88
 		}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	public static function normalize( $metabox )
97 97
 	{
98 98
 		$metabox = parent::normalize( $metabox );
99
-		$metabox['post_types'] = [];
99
+		$metabox[ 'post_types' ] = [ ];
100 100
 		return $metabox;
101 101
 	}
102 102
 }
Please login to merge, or discard this patch.