Completed
Push — master ( 8ccc11...1c9ae4 )
by Povilas
9s
created

FileReportList::addFileReport()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Povils\PHPMND;
4
5
/**
6
 * Class FileReportList
7
 *
8
 * @package Povils\PHPMND
9
 */
10
class FileReportList
11
{
12
    /**
13
     * @var FileReport[]
14
     */
15
    private $fileReports = [];
16
17
    /**
18
     * @param FileReport $fileReport
19
     */
20
    public function addFileReport(FileReport $fileReport)
21
    {
22
        $this->fileReports[] = $fileReport;
23
    }
24
25
    /**
26
     * @return FileReport[]
27
     */
28
    public function getFileReports()
29
    {
30
        return $this->fileReports;
31
    }
32
33
    /**
34
     * @return bool
35
     */
36
    public function hasMagicNumbers()
37
    {
38
        foreach ($this->fileReports as $fileReport) {
39
            if ($fileReport->hasMagicNumbers()) {
40
                return true;
41
            }
42
        }
43
44
        return false;
45
    }
46
}
47