Passed
Push — master ( b34d93...aea763 )
by Thierry
03:02 queued 24s
created

AttrSet   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
c 0
b 0
f 0
dl 0
loc 46
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 4 1
A getScript() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Jaxon\Plugin\Response\JQuery\Call;
4
5
use Jaxon\Request\Call\Parameter;
6
7
class AttrSet
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AttrSet
Loading history...
8
{
9
    /**
10
     * The attribute name
11
     *
12
     * @var string
13
     */
14
    private $sAttrName;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before first member var; 0 found
Loading history...
15
16
    /**
17
     * The attribute value
18
     *
19
     * @var mixed
20
     */
21
    private $xAttrValue;
22
23
    /**
24
     * The constructor.
25
     *
26
     * @param string $sAttrName    The attribute name
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter name; 4 found
Loading history...
27
     * @param mixed $xAttrValue    The attribute value
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter type; 1 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 4 found
Loading history...
28
     */
29
    public function __construct(string $sAttrName, $xAttrValue)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
30
    {
31
        $this->sAttrName = $sAttrName;
32
        $this->xAttrValue = Parameter::make($xAttrValue);
33
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
34
35
    /**
36
     * Returns a string representation of this call
37
     *
38
     * @return string
39
     */
40
    public function getScript(): string
41
    {
42
        return $this->sAttrName . ' = ' . $this->xAttrValue;
43
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
44
45
    /**
46
     * Convert this call to string
47
     *
48
     * @return string
49
     */
50
    public function __toString()
51
    {
52
        return $this->getScript();
53
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
54
}
55