From 5453daab03effb4f94a1da73d05fae5896226cf8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 8 Dec 2015 09:11:50 +0100 Subject: [PATCH] More fixes to the docs --- apps/files_sharing/lib/sharedmount.php | 14 ++++++++++++-- apps/files_sharing/tests/api/shareestest.php | 2 ++ apps/provisioning_api/tests/groupstest.php | 10 ++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php index 0581e281518..f205b1e78a5 100644 --- a/apps/files_sharing/lib/sharedmount.php +++ b/apps/files_sharing/lib/sharedmount.php @@ -51,6 +51,7 @@ class SharedMount extends MountPoint implements MoveableMount { /** * @param string $storage * @param string $mountpoint + * @param array|null $arguments * @param \OCP\Files\Storage\IStorageFactory $loader */ public function __construct($storage, $mountpoint, $arguments = null, $loader = null) { @@ -64,6 +65,9 @@ class SharedMount extends MountPoint implements MoveableMount { /** * check if the parent folder exists otherwise move the mount point up + * + * @param array $share + * @return string */ private function verifyMountPoint(&$share) { @@ -126,6 +130,7 @@ class SharedMount extends MountPoint implements MoveableMount { * * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into '/test.txt' + * @throws \OCA\Files_Sharing\Exceptions\BrokenPath */ protected function stripUserFilesPath($path) { $trimmed = ltrim($path, '/'); @@ -188,7 +193,7 @@ class SharedMount extends MountPoint implements MoveableMount { */ public function removeMount() { $mountManager = \OC\Files\Filesystem::getMountManager(); - /** @var \OC\Files\Storage\Shared */ + /** @var $storage \OC\Files\Storage\Shared */ $storage = $this->getStorage(); $result = $storage->unshareStorage(); $mountManager->removeMount($this->mountPoint); @@ -196,7 +201,12 @@ class SharedMount extends MountPoint implements MoveableMount { return $result; } + /** + * @return array + */ public function getShare() { - return $this->getStorage()->getShare(); + /** @var $storage \OC\Files\Storage\Shared */ + $storage = $this->getStorage(); + return $storage->getShare(); } } diff --git a/apps/files_sharing/tests/api/shareestest.php b/apps/files_sharing/tests/api/shareestest.php index 1e49a843ae0..96ffe4682c0 100644 --- a/apps/files_sharing/tests/api/shareestest.php +++ b/apps/files_sharing/tests/api/shareestest.php @@ -91,6 +91,7 @@ class ShareesTest extends TestCase { /** * @param string $uid * @param string $displayName + * @return \OCP\IUser|\PHPUnit_Framework_MockObject_MockObject */ protected function getUserMock($uid, $displayName) { $user = $this->getMockBuilder('OCP\IUser') @@ -110,6 +111,7 @@ class ShareesTest extends TestCase { /** * @param string $gid + * @return \OCP\IGroup|\PHPUnit_Framework_MockObject_MockObject */ protected function getGroupMock($gid) { $group = $this->getMockBuilder('OCP\IGroup') diff --git a/apps/provisioning_api/tests/groupstest.php b/apps/provisioning_api/tests/groupstest.php index f21c217e67e..f4f3b194944 100644 --- a/apps/provisioning_api/tests/groupstest.php +++ b/apps/provisioning_api/tests/groupstest.php @@ -30,13 +30,13 @@ use OCP\IUserSession; use OCP\IRequest; class GroupsTest extends \Test\TestCase { - /** @var IGroupManager */ + /** @var IGroupManager|\PHPUnit_Framework_MockObject_MockObject */ protected $groupManager; - /** @var IUserSession */ + /** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */ protected $userSession; - /** @var IRequest */ + /** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */ protected $request; - /** @var \OC\SubAdmin */ + /** @var \OC\SubAdmin|\PHPUnit_Framework_MockObject_MockObject */ protected $subAdminManager; /** @var \OCA\Provisioning_API\Groups */ protected $api; @@ -60,6 +60,7 @@ class GroupsTest extends \Test\TestCase { /** * @param string $gid + * @return \OCP\IGroup|\PHPUnit_Framework_MockObject_MockObject */ private function createGroup($gid) { $group = $this->getMock('OCP\IGroup'); @@ -71,6 +72,7 @@ class GroupsTest extends \Test\TestCase { /** * @param string $uid + * @return \OCP\IUser|\PHPUnit_Framework_MockObject_MockObject */ private function createUser($uid) { $user = $this->getMock('OCP\IUser'); -- 2.39.5