Completed
Push — master ( 24da9e...18bd75 )
by Josh
05:16
created

DiffList::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 8
rs 9.4286
cc 1
eloc 6
nc 1
nop 5
1
<?php
2
3
namespace Caxy\HtmlDiff\ListDiff;
4
5
class DiffList
6
{
7
    protected $listType;
8
9
    protected $listItems = array();
10
11
    protected $attributes = array();
12
13
    protected $startTag;
14
15
    protected $endTag;
16
17
    public function __construct($listType, $startTag, $endTag, $listItems = array(), $attributes = array())
18
    {
19
        $this->listType = $listType;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
20
        $this->startTag = $startTag;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
21
        $this->endTag = $endTag;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
22
        $this->listItems = $listItems;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
23
        $this->attributes = $attributes;
24
    }
25
26
    /**
27
     * @return mixed
28
     */
29
    public function getListType()
30
    {
31
        return $this->listType;
32
    }
33
34
    /**
35
     * @param mixed $listType
36
     *
37
     * @return DiffList
38
     */
39
    public function setListType($listType)
40
    {
41
        $this->listType = $listType;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return mixed
48
     */
49
    public function getStartTag()
50
    {
51
        return $this->startTag;
52
    }
53
54
    public function getStartTagWithDiffClass($class = 'diff-list')
55
    {
56
        return str_replace('>', ' class="'.$class.'">', $this->startTag);
57
    }
58
59
    /**
60
     * @param mixed $startTag
61
     */
62
    public function setStartTag($startTag)
63
    {
64
        $this->startTag = $startTag;
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70
    public function getEndTag()
71
    {
72
        return $this->endTag;
73
    }
74
75
    /**
76
     * @param mixed $endTag
77
     */
78
    public function setEndTag($endTag)
79
    {
80
        $this->endTag = $endTag;
81
    }
82
83
    /**
84
     * @return mixed
85
     */
86
    public function getListItems()
87
    {
88
        return $this->listItems;
89
    }
90
91
    /**
92
     * @param mixed $listItems
93
     *
94
     * @return DiffList
95
     */
96
    public function setListItems($listItems)
97
    {
98
        $this->listItems = $listItems;
0 ignored issues
show
Documentation Bug introduced by
It seems like $listItems of type * is incompatible with the declared type array of property $listItems.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
99
100
        return $this;
101
    }
102
}