From 85976b72937eae0e99d974551baf3aa96fa8d041 Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <rullzer@owncloud.com>
Date: Tue, 24 Nov 2015 09:58:37 +0100
Subject: [PATCH] [Sharing 2.0] Fix phpdoc etc

---
 apps/files_sharing/api/share20ocs.php        | 12 ++---
 lib/private/share20/defaultshareprovider.php | 53 +++++++++++---------
 lib/private/share20/ishare.php               |  2 +-
 lib/private/share20/ishareprovider.php       | 12 ++---
 lib/private/share20/manager.php              | 16 +++---
 lib/private/share20/share.php                |  4 +-
 6 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index 788cbe8586..1f27168c70 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -54,12 +54,12 @@ class Share20OCS {
 
 	public function __construct(
 			\OC\Share20\Manager $shareManager,
-			\OCP\IGroupManager $groupManager,
-			\OCP\IUserManager $userManager,
-			\OCP\IRequest $request,
-			\OCP\Files\Folder $userFolder,
-			\OCP\IURLGenerator $urlGenerator,
-			\OCP\IUser $currentUser
+			IGroupManager $groupManager,
+			IUserManager $userManager,
+			IRequest $request,
+			Folder $userFolder,
+			IURLGenerator $urlGenerator,
+			IUser $currentUser
 	) {
 		$this->shareManager = $shareManager;
 		$this->userManager = $userManager;
diff --git a/lib/private/share20/defaultshareprovider.php b/lib/private/share20/defaultshareprovider.php
index 15add93ce6..bc3bc0ce9e 100644
--- a/lib/private/share20/defaultshareprovider.php
+++ b/lib/private/share20/defaultshareprovider.php
@@ -23,25 +23,39 @@ namespace OC\Share20;
 use OC\Share20\Exception\ShareNotFound;
 use OC\Share20\Exception\BackendError;
 use OCP\IUser;
+use OCP\IGroupManager;
+use OCP\IUserManager;
+use OCP\Files\IRootFolder;
+use OCP\IDBConnection;
+use OCP\Files\Node;
 
 class DefaultShareProvider implements IShareProvider {
 
-	/** @var \OCP\IDBConnection */
+	/** @var IDBConnection */
 	private $dbConn;
 
-	/** @var \OCP\IUserManager */
+	/** @var IUserManager */
 	private $userManager;
 
-	/** @var \OCP\IGroupManager */
+	/** @var IGroupManager */
 	private $groupManager;
 
-	/** @var \OCP\Files\IRootFolder */
+	/** @var IRootFolder */
 	private $rootFolder;
 
-	public function __construct(\OCP\IDBConnection $connection,
-								\OCP\IUserManager $userManager,
-								\OCP\IGroupManager $groupManager,
-								\OCP\Files\IRootFolder $rootFolder) {
+	/**
+	 * DefaultShareProvider constructor.
+	 *
+	 * @param IDBConnection $connection
+	 * @param IUserManager $userManager
+	 * @param IGroupManager $groupManager
+	 * @param IRootFolder $rootFolder
+	 */
+	public function __construct(
+			IDBConnection $connection,
+			IUserManager $userManager,
+			IGroupManager $groupManager,
+			IRootFolder $rootFolder) {
 		$this->dbConn = $connection;
 		$this->userManager = $userManager;
 		$this->groupManager = $groupManager;
@@ -51,21 +65,19 @@ class DefaultShareProvider implements IShareProvider {
 	/**
 	 * Share a path
 	 * 
-	 * @param Share $share
-	 * @return Share The share object
+	 * @param IShare $share
+	 * @return IShare The share object
 	 */
-	public function create(Share $share) {
-		throw new \Exception();
+	public function create(IShare $share) {
 	}
 
 	/**
 	 * Update a share
 	 *
-	 * @param Share $share
-	 * @return Share The share object
+	 * @param IShare $share
+	 * @return IShare The share object
 	 */
-	public function update(Share $share) {
-		throw new \Exception();
+	public function update(IShare $share) {
 	}
 
 	/**
@@ -125,7 +137,6 @@ class DefaultShareProvider implements IShareProvider {
 	 * @return Share[]
 	 */
 	public function getShares(IUser $user, $shareType, $offset, $limit) {
-		throw new \Exception();
 	}
 
 	/**
@@ -163,8 +174,7 @@ class DefaultShareProvider implements IShareProvider {
 	 * @param \OCP\Files\Node $path
 	 * @return IShare[]
 	 */
-	public function getSharesByPath(\OCP\IUser $user, \OCP\Files\Node $path) {
-		throw new \Exception();
+	public function getSharesByPath(IUser $user, Node $path) {
 	}
 
 	/**
@@ -175,7 +185,6 @@ class DefaultShareProvider implements IShareProvider {
 	 * @param Share
 	 */
 	public function getSharedWithMe(IUser $user, $shareType = null) {
-		throw new \Exception();
 	}
 
 	/**
@@ -186,7 +195,6 @@ class DefaultShareProvider implements IShareProvider {
 	 * @param Share
 	 */
 	public function getShareByToken($token, $password = null) {
-		throw new \Exception();
 	}
 	
 	/**
@@ -235,5 +243,4 @@ class DefaultShareProvider implements IShareProvider {
 		return $share;
 	}
 
-
-}
+}
\ No newline at end of file
diff --git a/lib/private/share20/ishare.php b/lib/private/share20/ishare.php
index a80abebd71..2e54da7a02 100644
--- a/lib/private/share20/ishare.php
+++ b/lib/private/share20/ishare.php
@@ -38,7 +38,7 @@ interface IShare {
 	/**
 	 * Set the path of this share
 	 *
-	 * @param File|Folder $path
+	 * @param Node $path
 	 * @return Share The modified object
 	 */
 	public function setPath(Node $path);
diff --git a/lib/private/share20/ishareprovider.php b/lib/private/share20/ishareprovider.php
index 833de1b58f..56a550acf7 100644
--- a/lib/private/share20/ishareprovider.php
+++ b/lib/private/share20/ishareprovider.php
@@ -29,18 +29,18 @@ interface IShareProvider {
 	/**
 	 * Share a path
 	 * 
-	 * @param Share $share
-	 * @return Share The share object
+	 * @param IShare $share
+	 * @return IShare The share object
 	 */
-	public function create(Share $share);
+	public function create(IShare $share);
 
 	/**
 	 * Update a share
 	 *
-	 * @param Share $share
-	 * @return Share The share object
+	 * @param IShare $share
+	 * @return IShare The share object
 	 */
-	public function update(Share $share);
+	public function update(IShare $share);
 
 	/**
 	 * Delete a share
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php
index e58110b40d..882b281c49 100644
--- a/lib/private/share20/manager.php
+++ b/lib/private/share20/manager.php
@@ -42,6 +42,13 @@ class Manager {
 	/** @var IAppConfig */
 	private $appConfig;
 
+	/**
+	 * Manager constructor.
+	 *
+	 * @param ILogger $logger
+	 * @param IAppConfig $appConfig
+	 * @param IShareProvider $defaultProvider
+	 */
 	public function __construct(
 			ILogger $logger,
 			IAppConfig $appConfig,
@@ -56,12 +63,11 @@ class Manager {
 
 	/**
 	 * Share a path
-	 * 
+	 *
 	 * @param Share $share
 	 * @return Share The share object
 	 */
 	public function createShare(Share $share) {
-		throw new \Exception();
 	}
 
 	/**
@@ -71,7 +77,6 @@ class Manager {
 	 * @return Share The share object
 	 */
 	public function updateShare(Share $share) {
-		throw new \Exception();
 	}
 
 	/**
@@ -163,7 +168,6 @@ class Manager {
 	 * @return Share[]
 	 */
 	public function getShares($page=0, $perPage=50) {
-		throw new \Exception();
 	}
 
 	/**
@@ -194,7 +198,6 @@ class Manager {
 	 * @return Share[]
 	 */
 	public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) {
-		throw new \Exception();
 	}
 
 	/**
@@ -207,7 +210,6 @@ class Manager {
 	 * @return Share[]
 	 */
 	public function getSharedWithMe($shareType = null, $page=0, $perPage=50) {
-		throw new \Exception();
 	}
 
 	/**
@@ -221,7 +223,6 @@ class Manager {
 	 * @throws ShareNotFound
 	 */
 	public function getShareByToken($token, $password=null) {
-		throw new \Exception();
 	}
 
 	/**
@@ -249,6 +250,5 @@ class Manager {
 	 * @param \OCP\Files\Node $path
 	 */
 	public function getAccessList(\OCP\Files\Node $path) {
-		throw new \Exception();
 	}
 }
diff --git a/lib/private/share20/share.php b/lib/private/share20/share.php
index 4200816799..b7ce38ac61 100644
--- a/lib/private/share20/share.php
+++ b/lib/private/share20/share.php
@@ -58,7 +58,7 @@ class Share implements IShare {
 	/**
 	 * Set the id of the share
 	 *
-	 * @param int id
+	 * @param string $id
 	 * @return Share The modified object
 	 */
 	public function setId($id) {
@@ -292,7 +292,7 @@ class Share implements IShare {
 	/**
 	 * Set the target of this share
 	 *
-	 * @param string target
+	 * @param string $target
 	 * @return Share The modified object
 	 */
 	public function setTarget($target) {
-- 
GitLab