Completed
Pull Request — master (#54)
by Jamie
03:26
created

FrmFieldFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create_field_value_selector() 0 13 3
1
<?php
2
3
/**
4
 * @since 2.03.05
5
 */
6
class FrmFieldFactory {
7
8
	/**
9
	 * Create an instance of an FrmFieldValueSelector object
10
	 *
11
	 * @since 2.03.05
12
	 *
13
	 * @param int $field_id
14
	 * @param array $args
15
	 *
16
	 * @return FrmFieldValueSelector
17
	 */
18
	public static function create_field_value_selector( $field_id, $args ) {
19
		$selector = null;
20
21
		if ( $field_id > 0 ) {
22
			$selector = apply_filters( 'frm_create_field_value_selector', $selector, $field_id, $args );
23
		}
24
25
		if ( ! is_object( $selector ) ) {
26
			$selector = new FrmFieldValueSelector( $field_id, $args );
27
		}
28
29
		return $selector;
30
	}
31
32
}