Completed
Push — milestone/2_0/container-condit... ( af96ef...c41f81 )
by
unknown
03:01
created

Current_User_ID_Condition::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A Current_User_ID_Condition::is_fulfilled() 0 8 1
1
<?php
2
3
namespace Carbon_Fields\Container\Condition;
4
5
/**
6
 * Check if the currently logged in user has a specific id
7
 */
8
class Current_User_ID_Condition extends Condition {
9
	
10
	/**
11
	 * Check if the condition is fulfilled
12
	 * 
13
	 * @param  array $environment
14
	 * @return bool
15
	 */
16
	public function is_fulfilled( $environment ) {
17
		$user_id = get_current_user_id();
18
		return $this->first_supported_comparer_is_correct(
19
			$user_id,
20
			$this->get_comparison_operator(),
21
			$this->get_value()
22
		);
23
	}
24
}