Completed
Push — try/capabilities ( 5ae69f )
by
unknown
53:59 queued 47:44
created

WPRoleRule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Automattic\Jetpack\Capabilities;
4
5
class WPRoleRule {
6
	private $wp_role;
7
8
	function __construct( $wp_role ) {
9
		$this->wp_role = $wp_role;
10
	}
11
12
	function check() {
13
		$user = wp_get_current_user();
14
		return in_array( $this->wp_role, $user->roles );
15
	}
16
}
17