Passed
Push — master ( 82cc9c...6f4d3e )
by Roeland
22:49 queued 11:26
created

AbstractCacheEvent::getStorageId()   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 0
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 OC\Files\Cache;
30
31
use OCP\EventDispatcher\Event;
32
use OCP\Files\Cache\ICacheEvent;
33
use OCP\Files\Storage\IStorage;
34
35
class AbstractCacheEvent extends Event implements ICacheEvent {
36
	protected $storage;
37
	protected $path;
38
	protected $fileId;
39
	protected $storageId;
40
41
	/**
42
	 * @param IStorage $storage
43
	 * @param string $path
44
	 * @param int $fileId
45
	 * @since 16.0.0
46
	 */
47
	public function __construct(IStorage $storage, string $path, int $fileId, int $storageId) {
48
		$this->storage = $storage;
49
		$this->path = $path;
50
		$this->fileId = $fileId;
51
		$this->storageId = $storageId;
52
	}
53
54
	/**
55
	 * @return IStorage
56
	 * @since 16.0.0
57
	 */
58
	public function getStorage(): IStorage {
59
		return $this->storage;
60
	}
61
62
	/**
63
	 * @return string
64
	 * @since 16.0.0
65
	 */
66
	public function getPath(): string {
67
		return $this->path;
68
	}
69
70
	/**
71
	 * @param string $path
72
	 * @since 19.0.0
73
	 */
74
	public function setPath(string $path): void {
75
		$this->path = $path;
76
	}
77
78
	/**
79
	 * @return int
80
	 * @since 16.0.0
81
	 */
82
	public function getFileId(): int {
83
		return $this->fileId;
84
	}
85
86
	/**
87
	 * @return int
88
	 * @since 21.0.0
89
	 */
90
	public function getStorageId(): int {
91
		return $this->storageId;
92
	}
93
}
94