Attribute   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 70%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 58
ccs 7
cts 10
cp 0.7
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A getName() 0 3 1
A __construct() 0 4 1
A setValue() 0 3 1
1
<?php
2
/**
3
 * DronePHP (http://www.dronephp.com)
4
 *
5
 * @link      http://github.com/Pleets/DronePHP
6
 * @copyright Copyright (c) 2016-2018 Pleets. (http://www.pleets.org)
7
 * @license   http://www.dronephp.com/license
8
 * @author    Darío Rivera <[email protected]>
9
 */
10
11
namespace Drone\Dom;
12
13
/**
14
 * Attribute class
15
 *
16
 * To represent html attribute
17
 */
18
class Attribute
19
{
20
    /**
21
     * The name of the attribute
22
     *
23
     * @var string
24
     */
25
    protected $name;
26
27
    /**
28
     * The value of the attribute
29
     *
30
     * @var mixed
31
     */
32
    protected $value;
33
34
    /**
35
     * Gets the name attribute
36
     *
37
     * @return string
38
     */
39 8
    public function getName()
40
    {
41 8
        return $this->name;
42
    }
43
44
    /**
45
     * Gets the value attribute
46
     *
47
     * @return array
48
     */
49 8
    public function getValue()
50
    {
51 8
        return $this->value;
52
    }
53
54
    /**
55
     * Sets the value attribute
56
     *
57
     * @param mixed $value
58
     *
59
     * @return null
60
     */
61
    public function setValue($value)
62
    {
63
        $this->value = $value;
64
    }
65
66
    /**
67
     * Constructor
68
     *
69
     * @param string $name
70
     * @param mixed  $value
71
     */
72 8
    public function __construct($name, $value = null)
73
    {
74 8
        $this->name = $name;
75 8
        $this->value = $value;
76 8
    }
77
}
78