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

FileReportList   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 37
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addFileReport() 0 4 1
A getFileReports() 0 4 1
A hasMagicNumbers() 0 10 3
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