Completed
Pull Request — master (#72)
by Thibaud
08:29
created

Technical   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 88.24%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 8
c 4
b 0
f 0
lcom 0
cbo 0
dl 0
loc 69
ccs 15
cts 17
cp 0.8824
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A fromList() 0 10 2
A fromValue() 0 4 1
A __construct() 0 4 1
A getRawData() 0 4 1
A getSource() 0 4 1
A getName() 0 4 1
A getValue() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Phraseanet SDK.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PhraseanetSDK\Entity;
13
14
class Technical
15
{
16
17 6
    public static function fromList(array $values)
18
    {
19 6
        $technical = array();
20
21 6
        foreach ($values as $value) {
22 6
            $technical[] = self::fromValue($value);
23 6
        }
24
25 6
        return $technical;
26
    }
27
28 6
    public static function fromValue(\stdClass $value)
29
    {
30 6
        return new self($value);
31
    }
32
33
    /**
34
     * @var \stdClass
35
     */
36
    protected $source;
37
38
    /**
39
     * @param \stdClass $source
40
     */
41 6
    public function __construct(\stdClass $source)
42
    {
43 6
        $this->source = $source;
44 6
    }
45
46
    /**
47
     * @return \stdClass
48
     */
49
    public function getRawData()
50
    {
51
        return $this->source;
52
    }
53
54
    /**
55
     * @return \stdClass
56
     * @deprecated Use getRawData() instead
57
     */
58
    public function getSource()
59 6
    {
60
        return $this->source;
61 6
    }
62
63
    /**
64
     * Get the technical information name
65
     *
66
     * @return string
67
     */
68
    public function getName()
69 6
    {
70
        return $this->source->name;
71 6
    }
72
73
    /**
74
     * Get the technical value
75
     *
76
     * @return string
77
     */
78
    public function getValue()
79
    {
80
        return $this->source->value;
81
    }
82
}
83