Completed
Push — try/capabilities ( 7f65a9...672273 )
by
unknown
19:16 queued 12:21
created

PermissionDenied::message()   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 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * A convenience class representing a permission which has been denied, along with an error message
4
 *
5
 * @package automattic/jetpack-capabilities
6
 */
7
8
namespace Automattic\Jetpack\Capabilities;
9
10
// phpcs:ignore Squiz.Commenting.ClassComment.Missing
11
class PermissionDenied implements Permission {
12
	/**
13
	 * A user-facing error message
14
	 *
15
	 * @var string error_message
16
	 */
17
	private $error_message;
18
19
	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
20
	public function __construct( $error_message ) {
21
		$this->error_message = $error_message;
22
	}
23
24
	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
25
	public function granted() {
26
		return false;
27
	}
28
29
	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
30
	public function message() {
31
		return $this->error_message;
32
	}
33
34
	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
35
	public function data() {
36
		return null;
37
	}
38
}
39