Completed
Push — release/1.0 ( 55dfa3...f16ed7 )
by Johnny
01:59
created

AbstractReport::setNewfiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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
     * @param array $items
53
     */
54
    public function setItems($items)
55
    {
56
        $this->items = $items;
57
    }
58
59
    /**
60
     * @param array $newfiles
61
     */
62
    public function setNewfiles($newfiles)
63
    {
64
        $this->newfiles = $newfiles;
65
    }
66
67
    /**
68
     * @param array $modifiedFiles
69
     */
70
    public function setModifiedFiles($modifiedFiles)
71
    {
72
        $this->modifiedFiles = $modifiedFiles;
73
    }
74
75
    /**
76
     * @param string $name
77
     */
78
    public function setName($name)
79
    {
80
        $this->name = $name;
81
    }
82
83
    /**
84
     * @param \DateTime $date
85
     */
86
    public function setDate($date)
87
    {
88
        $this->date = $date;
89
    }
90
91
    /**
92
     * @param string $path
93
     */
94
    public function setPath($path)
95
    {
96
        $this->path = $path;
97
    }
98
99
    /**
100
     * @return array
101
     */
102
    public function getItems()
103
    {
104
        return $this->items;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getName()
111
    {
112
        return $this->name;
113
    }
114
115
    /**
116
     * @return string
117
     */
118
    public function getPath()
119
    {
120
        return $this->path;
121
    }
122
123
    /**
124
     * @return array
125
     */
126
    public function getNewfiles()
127
    {
128
        return $this->newfiles;
129
    }
130
131
    /**
132
     * @return array
133
     */
134
    public function getModifiedFiles()
135
    {
136
        return $this->modifiedFiles;
137
    }
138
139
    /**
140
     * @return \DateTime
141
     */
142
    public function getDate()
143
    {
144
        return $this->date;
145
    }
146
147
    /**
148
     * This function will convert our report into an array. This array
149
     * could later be converted into any output the adaptor wishes.
150
     *
151
     * @return array
152
     */
153
    abstract public function toArray();
154
}