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

Current_User_Capability_Condition::get_user_id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
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
}