Passed
Push — develop ( 81fb7c...37cea1 )
by Paul
02:40
created
src/MetaBox/PostMetaManager.php 2 patches
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.
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.
src/MetaBox/SiteMetaManager.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.