Completed
Push — milestone/2_0/container-condit... ( c41f81...3ee472 )
by
unknown
04:49
created

Current_User_Capability_Condition::is_fulfilled()   B

Complexity

Conditions 5
Paths 5

Size

Total Lines 22
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 18
nc 5
nop 1
dl 0
loc 22
rs 8.6737
c 0
b 0
f 0
1
<?php
2
3
namespace Carbon_Fields\Container\Condition;
4
5
/**
6
 * Check if user has a specific capability
7
 * 
8
 * Operator "CUSTOM" is passed the user id
9
 */
10
class Current_User_Capability_Condition extends User_Capability_Condition {
11
12
	/**
13
	 * Get user id from environment
14
	 * 
15
	 * @param  array         $environment
16
	 * @return array<string>
17
	 */
18
	protected function get_user_id( $environment ) {
19
		return get_current_user_id();
20
	}
21
}