Passed
Push — develop ( 0a90cc...87abfc )
by Paul
02:49
created
src/MetaBox/Instruction.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	/**
16 16
 	 * @var array
17 17
 	 */
18
-	public $metaboxes = [];
18
+	public $metaboxes = [ ];
19 19
 
20 20
 	/**
21 21
 	 * @return void
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 	{
25 25
 		if( !count( array_filter( $this->metaboxes, function( $metabox ) {
26 26
 			return $this->show( false, $metabox );
27
-		})))return;
28
-		$this->metaboxes[] = [
27
+		}) ) )return;
28
+		$this->metaboxes[ ] = [
29 29
 			'id' => 'infodiv',
30 30
 			'post_types' => $this->getPostTypes(),
31 31
 			'title' => __( 'How to use in your theme', 'pollux' ),
32 32
 			'context' => 'side',
33 33
 			'priority' => 'low',
34
-			'fields' => [[
34
+			'fields' => [ [
35 35
 				'slug' => '',
36 36
 				'std' => $this->generateInstructions(),
37 37
 				'type' => 'custom_html',
38
-			]],
38
+			] ],
39 39
 		];
40 40
 	}
41 41
 
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 	protected function generateInstructions()
46 46
 	{
47 47
 		return array_reduce( $this->getInstructions(), function( $html, $metabox ) {
48
-			$fields = array_reduce( array_column( $metabox['fields'], 'slug' ), function( $html, $slug ) use( $metabox ) {
49
-				$hook = sprintf( 'pollux/%s/instruction', strtolower(( new Helper )->getClassname( $this )));
50
-				error_log( print_r( $hook, 1 ));
51
-				return $html . apply_filters( $hook, "PostMeta::get('{$slug}');", $slug, $metabox['slug'] ) . PHP_EOL;
48
+			$fields = array_reduce( array_column( $metabox[ 'fields' ], 'slug' ), function( $html, $slug ) use( $metabox ) {
49
+				$hook = sprintf( 'pollux/%s/instruction', strtolower( ( new Helper )->getClassname( $this ) ) );
50
+				error_log( print_r( $hook, 1 ) );
51
+				return $html . apply_filters( $hook, "PostMeta::get('{$slug}');", $slug, $metabox[ 'slug' ] ) . PHP_EOL;
52 52
 			});
53 53
 			return $html . sprintf( '<p><strong>%s</strong></p><pre class="my-sites nav-tab-active misc-pub-section">%s</pre>',
54
-				$metabox['title'],
54
+				$metabox[ 'title' ],
55 55
 				$fields
56 56
 			);
57 57
 		});
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	protected function getInstructions()
64 64
 	{
65 65
 		return array_filter( $this->metaboxes, function( $metabox ) {
66
-			return $this->validate( $metabox['condition'] )
66
+			return $this->validate( $metabox[ 'condition' ] )
67 67
 				&& $this->hasPostType( $metabox );
68 68
 		});
69 69
 	}
Please login to merge, or discard this patch.