Passed
Push — master ( a61c37...c45dc5 )
by Roeland
24:45 queued 11:01
created

AbstractCacheEvent::setPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright Copyright (c) 2019 Robin Appelman <[email protected]>
7
 *
8
 * @author Joas Schilling <[email protected]>
9
 * @author Robin Appelman <[email protected]>
10
 * @author Roeland Jago Douma <[email protected]>
11
 *
12
 * @license GNU AGPL version 3 or any later version
13
 *
14
 * This program is free software: you can redistribute it and/or modify
15
 * it under the terms of the GNU Affero General Public License as
16
 * published by the Free Software Foundation, either version 3 of the
17
 * License, or (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU Affero General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU Affero General Public License
25
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26
 *
27
 */
28
29
namespace OCP\Files\Cache;
30
31
use OCP\EventDispatcher\Event;
32
use OCP\Files\Storage\IStorage;
33
34
/**
35
 * @since 22.0.0
36
 */
37
class AbstractCacheEvent extends Event implements ICacheEvent {
38
	protected $storage;
39
	protected $path;
40
	protected $fileId;
41
	protected $storageId;
42
43
	/**
44
	 * @param IStorage $storage
45
	 * @param string $path
46
	 * @param int $fileId
47
	 * @since 22.0.0
48
	 */
49
	public function __construct(IStorage $storage, string $path, int $fileId, int $storageId) {
50
		$this->storage = $storage;
51
		$this->path = $path;
52
		$this->fileId = $fileId;
53
		$this->storageId = $storageId;
54
	}
55
56
	/**
57
	 * @return IStorage
58
	 * @since 22.0.0
59
	 */
60
	public function getStorage(): IStorage {
61
		return $this->storage;
62
	}
63
64
	/**
65
	 * @return string
66
	 * @since 22.0.0
67
	 */
68
	public function getPath(): string {
69
		return $this->path;
70
	}
71
72
	/**
73
	 * @param string $path
74
	 * @since 22.0.0
75
	 */
76
	public function setPath(string $path): void {
77
		$this->path = $path;
78
	}
79
80
	/**
81
	 * @return int
82
	 * @since 22.0.0
83
	 */
84
	public function getFileId(): int {
85
		return $this->fileId;
86
	}
87
88
	/**
89
	 * @return int
90
	 * @since 22.0.0
91
	 */
92
	public function getStorageId(): int {
93
		return $this->storageId;
94
	}
95
}
96