Completed
Push — release/1.0 ( 82bfa1...74ea79 )
by Johnny
512:54 queued 510:54
created

AbstractReport::__unset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
namespace Redbox\Scan\Report;
3
4
// TODO: Make this class inevitable on the items so we can make the codebase in ScanService its scan() smaller
5
6
/**
7
 * This AbstractReport report class contains all the base tools
8
 * needed for Redbox\Scan\Report\Report.
9
 *
10
 * @package Redbox\Scan\Report
11
 */
12
abstract class AbstractReport
13
{
14
    /**
15
     * Return the items
16
     *
17
     * @var array
18
     */
19
    protected $items = [];
20
21
    /**
22
     * @var array
23
     */
24
    protected $newfiles = [];
25
    /**
26
     * @var array
27
     */
28
    protected $modifiedFiles = [];
29
30
    /**
31
     * Report title
32
     *
33
     * @var string
34
     */
35
    protected $name = null;
36
37
    /**
38
     * Report path
39
     *
40
     * @var string
41
     */
42
    protected $path = null;
43
44
    /**
45
     * Report data
46
     *
47
     * @var \DateTime
48
     */
49
    protected $date = null;
50
51
52 4
53
    /**
54 4
     * @param array $items
55 4
     */
56
    public function setItems($items)
57
    {
58
        $this->items = $items;
59
    }
60
61
    /**
62
     * @param array $newfiles
63
     */
64
    public function setNewfiles($newfiles)
65
    {
66
        $this->newfiles = $newfiles;
67
    }
68
69
    /**
70
     * @param array $modifiedFiles
71
     */
72
    public function setModifiedFiles($modifiedFiles)
73
    {
74
        $this->modifiedFiles = $modifiedFiles;
75
    }
76 4
77
    /**
78
     * @param string $name
79
     */
80 4
    public function setName($name)
81
    {
82
        $this->name = $name;
83
    }
84
85
    /**
86
     * @param \DateTime $date
87
     */
88
    public function setDate($date)
89
    {
90 2
        $this->date = $date;
91 4
    }
92 4
93
    /**
94
     * @param string $path
95
     */
96
    public function setPath($path)
97 4
    {
98
        $this->path = $path;
99 4
    }
100 4
101
    /**
102
     * @return array
103
     */
104
    public function getItems()
105
    {
106
        return $this->items;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getName()
113
    {
114
        return $this->name;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function getPath()
121 4
    {
122
        return $this->path;
123 4
    }
124 4
125
    /**
126
     * @return array
127
     */
128
    public function getNewfiles()
129 4
    {
130
        return $this->newfiles;
131 4
    }
132 4
133
    /**
134
     * @return array
135
     */
136
    public function getModifiedFiles()
137 4
    {
138
        return $this->modifiedFiles;
139 4
    }
140 4
141
    /**
142
     * @return \DateTime
143
     */
144
    public function getDate()
145 4
    {
146
        return $this->date;
147 4
    }
148
149
    /**
150
     * This function will convert our report into an array. This array
151
     * could later be converted into any output the adaptor wishes.
152
     *
153 4
     * @return array
154
     */
155
    abstract public function toArray();
156
}