Passed
Push — develop ( 3d135a...646156 )
by Paul
02:56
created
src/MetaBox/Instruction.php 1 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->make( 'Helper' )->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.