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

AttrSet::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
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