Completed
Push — develop ( 079584...9aa6f3 )
by Paul
02:09
created
src/Helpers/PostMeta.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@  discard block
 block discarded – undo
4 4
 
5 5
 class PostMeta
6 6
 {
7
-	public function get( $value, array $args = [] )
7
+	public function get($value, array $args = [])
8 8
 	{
9
-		if( empty( $value ))return;
9
+		if (empty($value))return;
10 10
 
11
-		$args = $this->normalize( $args );
11
+		$args = $this->normalize($args);
12 12
 
13
-		if( substr( $value, 0, 1 ) == '_' && !empty( $args['prefix'] )) {
14
-			$args['prefix'] = sprintf( '_%s', rtrim( $args['prefix'], '_' ));
13
+		if (substr($value, 0, 1) == '_' && !empty($args['prefix'])) {
14
+			$args['prefix'] = sprintf('_%s', rtrim($args['prefix'], '_'));
15 15
 		}
16 16
 
17
-		$metaValue = get_post_meta( $args['ID'], $args['prefix'] . $value, $args['single'] );
17
+		$metaValue = get_post_meta($args['ID'], $args['prefix'] . $value, $args['single']);
18 18
 
19
-		return empty( $metaValue )
19
+		return empty($metaValue)
20 20
 			? $args['fallback']
21 21
 			: $metaValue;
22 22
 	}
23 23
 
24
-	protected function normalize( array $args )
24
+	protected function normalize(array $args)
25 25
 	{
26 26
 		$defaults = [
27 27
 			'ID'       => get_the_ID(),
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
 			'single'   => true,
30 30
 			'prefix'   => 'pollux_',
31 31
 		];
32
-		return shortcode_atts( $defaults, $args );
32
+		return shortcode_atts($defaults, $args);
33 33
 	}
34 34
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@
 block discarded – undo
6 6
 {
7 7
 	public function get( $value, array $args = [] )
8 8
 	{
9
-		if( empty( $value ))return;
9
+		if( empty( $value )) {
10
+			return;
11
+		}
10 12
 
11 13
 		$args = $this->normalize( $args );
12 14
 
Please login to merge, or discard this patch.