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

Current_User_Capability_Condition   A

Complexity

Total Complexity 1

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 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_user_id() 0 3 1
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
}