PropertyOperation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 36
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCode() 0 4 1
A getReason() 0 4 1
A getVisibility() 0 4 1
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PhpParser\Node\Stmt;
6
7
abstract class PropertyOperation extends Operation
8
{
9
	/**
10
	 * @var string
11
	 */
12
	protected $context;
13
	/**
14
	 * @var int
15
	 */
16
	protected $visibility;
17
18
	/**
19
	 * @return string
20
	 */
21 4
	public function getCode()
22
	{
23 4
		return $this->code[$this->context][Visibility::get($this->visibility)];
24
	}
25
26
	/**
27
	 * @return string
28
	 */
29 4
	public function getReason()
30
	{
31 4
		return '[' . Visibility::toString($this->visibility) . '] ' . $this->reason;
32
	}
33
34
	/**
35
	 * @param \PhpParser\Node\Stmt $context
36
	 * @return int
37
	 */
38 4
	protected function getVisibility(Stmt $context)
39
	{
40 4
		return Visibility::getForContext($context);
41
	}
42
}
43