StorageStructure::addFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
3
/**
4
 * @copyright Copyright (c) 2018 Matthias Held <[email protected]>
5
 * @author Matthias Held <[email protected]>
6
 * @license GNU AGPL version 3 or any later version
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License as
10
 * published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
 */
21
22
namespace OCA\RansomwareDetection\Scanner;
23
24
class StorageStructure {
25
26
    /** @var integer */
27
    protected $numberOfFiles = 0;
28
29
    /** @var array */
30
    protected $files = array();
31
32
    /**
33
     * @param integer $numberOfFiles
34
     * @param array $files
35
     */
36
    public function __construct(
37
        $numberOfFiles = 0,
38
        $files = array()
39
    ) {
40
        $this->numberOfFiles = $numberOfFiles;
41
        $this->files = $files;
42
    }
43
44
    /**
45
     * Get number of files.
46
     *
47
     * @return integer
48
     */
49
    public function getNumberOfFiles() {
50
        return $this->numberOfFiles;
51
    }
52
53
    /**
54
     * Set number of files.
55
     *
56
     * @param integer $numberOfFiles
57
     */
58
    public function setNumberOfFiles($numberOfFiles) {
59
        $this->numberOfFiles = $numberOfFiles;
60
    }
61
62
    /**
63
     * Increase the number of files.
64
     *
65
     * @return integer
66
     */
67
    public function increaseNumberOfFiles() {
68
        return $this->numberOfFiles++;
69
    }
70
71
    /**
72
     * Get files.
73
     *
74
     * @return Files[]
75
     */
76
    public function getFiles() {
77
        return $this->files;
78
    }
79
80
    /**
81
     * Set files.
82
     *
83
     * @param Files[] $files
84
     */
85
    public function setFiles($files) {
86
        $this->files = $files;
87
    }
88
89
    /**
90
     * Add a file.
91
     *
92
     * @param File $file
0 ignored issues
show
Bug introduced by
The type OCA\RansomwareDetection\Scanner\File was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
93
     */
94
    public function addFile($file) {
95
        array_push($this->files, $file);
96
    }
97
}
98