Storage::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 4
nop 1
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 12
rs 10
c 0
b 0
f 0
1
<?php
2
namespace SpareParts\Pillar\Mapper\Annotation;
3
4
use Doctrine\Common\Annotations\Annotation\Required;
5
6
/**
7
 * @Annotation
8
 */
9
class Storage implements IPillarAnnotation
10
{
11
	/**
12
	 * @var string
13
	 * @Required()
14
	 */
15
	protected $type;
16
17
	public function __construct($values)
18
	{
19
		if (isset($values['value'])) {
20
			$this->type = $values['value'];
21
		}
22
		if (isset($values['type'])) {
23
			$this->type = $values['type'];
24
		}
25
	}
26
27
	/**
28
	 * @return string
29
	 */
30
	public function getType()
31
	{
32
		return $this->type;
33
	}
34
}
35