Completed
Pull Request — master (#362)
by Maxence
01:46
created

Mount::removeMount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
4
/**
5
 * Circles - Bring cloud-users closer together.
6
 *
7
 * This file is licensed under the Affero General Public License version 3 or
8
 * later. See the COPYING file.
9
 *
10
 * @author Maxence Lange <[email protected]>
11
 * @copyright 2020
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
30
namespace OCA\Circles\GlobalScale\GSMount;
31
32
33
use OC\Files\Mount\MountPoint;
34
use OC\Files\Mount\MoveableMount;
35
36
37
class Mount extends MountPoint implements MoveableMount {
38
39
	/**
40
	 * @var MountManager
41
	 */
42
	protected $manager;
43
44
45
	public function __construct($storage, string $mountPoint, array $options, MountManager $manager, $loader = null) {
46
		parent::__construct($storage, $mountPoint, $options, $loader);
47
		$this->manager = $manager;
48
	}
49
50
51
	/**
52
	 * Move the mount point to $target
53
	 *
54
	 * @param string $target the target mount point
55
	 *
56
	 * @return bool
57
	 */
58
	public function moveMount($target) {
59
//		$result = $this->manager->setMountPoint($this->mountPoint, $target);
60
//		$this->setMountPoint($target);
61
return true;
62
//		return $result;
63
	}
64
65
	/**
66
	 * Remove the mount points
67
	 *
68
	 * @return mixed
69
	 * @return bool
70
	 */
71
	public function removeMount() {
72
		return $this->manager->removeShare($this->mountPoint);
0 ignored issues
show
Bug introduced by
The method removeShare() does not seem to exist on object<OCA\Circles\Globa...e\GSMount\MountManager>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
	}
74
75
76
	/**
77
	 * Get the type of mount point, used to distinguish things like shares and external storages
78
	 * in the web interface
79
	 *
80
	 * @return string
81
	 */
82
	public function getMountType() {
83
		return 'shared';
84
	}
85
}
86
87