Sniff   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 32
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addFile() 0 4 1
A getFiles() 0 4 1
A jsonSerialize() 0 6 1
1
<?php
2
3
namespace SnifferReport\Model;
4
5
class Sniff implements \JsonSerializable
6
{
7
    private $files = [];
8
9
    /**
10
     * Adds a file to the Sniff
11
     *
12
     * @param File $file
13
     */
14
    public function addFile(File $file)
15
    {
16
        $this->files[] = $file;
17
    }
18
19
    /**
20
     * @return File[]
21
     */
22
    public function getFiles()
23
    {
24
        return $this->files;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function jsonSerialize()
31
    {
32
        return [
33
            'files' => $this->getFiles()
34
        ];
35
    }
36
}
37