Completed
Push — master ( 228e92...6a576a )
by David
02:49
created

Wordlift_Double_Property_Service::get()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 1
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
class Wordlift_Double_Property_Service extends Wordlift_Simple_Property_Service {
4
5
	function get( $post_id, $meta_key ) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
6
7
		// Map the result to a numeric value when possible.
8
		return array_map( function ( $value ) {
9
			return is_numeric( $value ) ? (double) $value : $value;
10
		}, parent::get( $post_id, $meta_key ) );
11
	}
12
13
14
}