Passed
Push — master ( 5b5550...0f9b88 )
by Morris
12:37 queued 10s
created

PublicOwnerWrapper::getOwner()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 3
nc 2
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * @copyright Copyright (c) 2020, Roeland Jago Douma <[email protected]>
6
 *
7
 * @author Roeland Jago Douma <[email protected]>
8
 *
9
 * @license GNU AGPL version 3 or any later version
10
 *
11
 * This program is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Affero General Public License as
13
 * published by the Free Software Foundation, either version 3 of the
14
 * License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU Affero General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU Affero General Public License
22
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 *
24
 */
25
26
namespace OCA\DAV\Storage;
27
28
use OC\Files\Storage\Wrapper\Wrapper;
29
30
class PublicOwnerWrapper extends Wrapper {
31
32
	/** @var string */
33
	private $owner;
34
35
	/**
36
	 * @param array $arguments ['storage' => $storage, 'owner' => $owner]
37
	 *
38
	 * $storage: The storage the permissions mask should be applied on
39
	 * $owner: The owner to use in case no owner is found
40
	 */
41
	public function __construct($arguments) {
42
		parent::__construct($arguments);
43
		$this->owner = $arguments['owner'];
44
	}
45
46
	public function getOwner($path) {
47
		$owner = parent::getOwner($path);
48
49
		if ($owner === null || $owner === false) {
0 ignored issues
show
introduced by
The condition $owner === false is always false.
Loading history...
50
			return $this->owner;
51
		}
52
	}
53
}
54