Table   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Test Coverage

Coverage 94.12%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 57
ccs 16
cts 17
cp 0.9412
rs 10
c 0
b 0
f 0
wmc 8

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 3 1
A getName() 0 3 1
A getCode() 0 3 1
A __construct() 0 14 5
1
<?php
2
namespace SpareParts\Pillar\Mapper\Annotation;
3
4
use Doctrine\Common\Annotations\Annotation\Required;
5
6
/**
7
 * @Annotation
8
 * @Target("CLASS")
9
 */
10
class Table implements IPillarAnnotation
11
{
12
	/**
13
	 * @var string
14
	 * @Required()
15
	 */
16
	protected $name;
17
18
	/**
19
	 * @var string
20
	 */
21
	protected $identifier;
22
23
	/**
24
	 * @var string
25
	 */
26
	protected $code;
27
28 6
	public function __construct($values)
29
	{
30 6
		if (isset($values['value'])) {
31
			$this->name = $values['value'];
32
		}
33 6
		if (isset($values['name'])) {
34 6
			$this->name = $values['name'];
35
		}
36 6
		$this->identifier = $this->name;
37 6
		if (isset($values['identifier'])) {
38 6
			$this->identifier = $values['identifier'];
39
		}
40 6
		if (isset($values['code'])) {
41 6
			$this->code = $values['code'];
42
		}
43 6
	}
44
45
	/**
46
	 * @return string
47
	 */
48 6
	public function getName()
49
	{
50 6
		return $this->name;
51
	}
52
53
	/**
54
	 * @return string
55
	 */
56 6
	public function getIdentifier()
57
	{
58 6
		return $this->identifier;
59
	}
60
61
	/**
62
	 * @return string
63
	 */
64 6
	public function getCode()
65
	{
66 6
		return $this->code;
67
	}
68
}
69