Passed
Push — v5.x ( 8eee51...080647 )
by Thierry
10:22
created

AttrGet::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
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 JsonSerializable;
6
7
class AttrGet implements JsonSerializable
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AttrGet
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 constructor.
18
     *
19
     * @param string $sAttrName    The attribute name
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 4 found
Loading history...
20
     */
21
    public function __construct(string $sAttrName)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
22
    {
23
        $this->sAttrName = $sAttrName;
24
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
25
26
    /**
27
     * Convert this call to array, when converting the response into json.
28
     *
29
     * @return array
30
     */
31
    public function jsonSerialize(): array
32
    {
33
        return [
34
            '_type' => 'attr',
35
            '_name' => $this->sAttrName,
36
        ];
37
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
38
}
39