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

Wordlift_Double_Property_Service   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 2
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
}