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

AttrGet   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 5
c 0
b 0
f 0
dl 0
loc 37
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 3 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
class AttrGet
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AttrGet
Loading history...
6
{
7
    /**
8
     * The attribute name
9
     *
10
     * @var string
11
     */
12
    private $sAttrName;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line(s) before first member var; 0 found
Loading history...
13
14
    /**
15
     * The constructor.
16
     *
17
     * @param string $sAttrName    The attribute name
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 4 found
Loading history...
18
     */
19
    public function __construct(string $sAttrName)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
20
    {
21
        $this->sAttrName = $sAttrName;
22
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
23
24
    /**
25
     * Returns a string representation of the script output (javascript) from this call
26
     *
27
     * @return string
28
     */
29
    public function getScript(): string
30
    {
31
        return $this->sAttrName;
32
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
33
34
    /**
35
     * Convert this call to string
36
     *
37
     * @return string
38
     */
39
    public function __toString()
40
    {
41
        return $this->getScript();
42
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
43
}
44