Passed
Push — master ( c3a4dd...869277 )
by Roeland
11:01 queued 11s
created

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