Completed
Push — try/capabilities ( 1eedd1...45f305 )
by
unknown
06:43
created

JetpackActiveRule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 7 2
1
<?php
2
/**
3
 * A rule which evaluates a filter and compares the output with a required value
4
 *
5
 * @package automattic/jetpack-capabilities
6
 */
7
8
namespace Automattic\Jetpack\Capabilities;
9
10
// phpcs:ignore Squiz.Commenting.ClassComment.Missing
11
class JetpackActiveRule implements Rule {
12
	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
13
	public function check( ...$args ) {
14
		return \Jetpack::is_active() ?
15
			new PermissionGranted() :
16
			new PermissionDenied(
17
				sprintf( __( 'Jetpack must be connected', 'jetpack' ) )
18
			);
19
	}
20
}
21