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

WPCapabilityRule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A check() 0 3 1
1
<?php
2
3
namespace Automattic\Jetpack\Capabilities;
4
5
class WPCapabilityRule {
6
	private $wp_capability;
7
8
	function __construct( $wp_capability ) {
9
		$this->wp_capability = $wp_capability;
10
	}
11
12
	function check( $object_id = null ) {
13
		return current_user_can( $this->wp_capability, $object_id );
14
	}
15
}
16