From dee6f7f61f0f0d1827ed0555f199d7bce67e67b6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 Feb 2019 16:04:15 +0100 Subject: [PATCH] Fix doc blocks Signed-off-by: Joas Schilling --- .../CollaborationResourcesController.php | 6 ++-- .../Collaboration/Resources/Collection.php | 12 ++++---- .../Collaboration/Resources/Manager.php | 28 ++++++++++--------- .../Collaboration/Resources/Resource.php | 12 ++++---- .../Resources/CollectionException.php | 4 ++- .../Collaboration/Resources/ICollection.php | 14 +++++----- .../Collaboration/Resources/IManager.php | 10 +++---- .../Collaboration/Resources/IProvider.php | 13 +++++---- .../Collaboration/Resources/IResource.php | 16 +++++------ .../Resources/ResourceException.php | 3 ++ 10 files changed, 64 insertions(+), 54 deletions(-) diff --git a/core/Controller/CollaborationResourcesController.php b/core/Controller/CollaborationResourcesController.php index 3c9937aade2..ae306d8aea8 100644 --- a/core/Controller/CollaborationResourcesController.php +++ b/core/Controller/CollaborationResourcesController.php @@ -87,7 +87,7 @@ class CollaborationResourcesController extends OCSController { /** * @NoAdminRequired * - * @param int $collectionId + * @param string $filter * @return DataResponse */ public function searchCollections(string $filter): DataResponse { @@ -179,8 +179,8 @@ class CollaborationResourcesController extends OCSController { /** * @NoAdminRequired * - * @param string $resourceType - * @param string $resourceId + * @param string $baseResourceType + * @param string $baseResourceId * @param string $name * @return DataResponse */ diff --git a/lib/private/Collaboration/Resources/Collection.php b/lib/private/Collaboration/Resources/Collection.php index 54c009b917c..5770e8918fd 100644 --- a/lib/private/Collaboration/Resources/Collection.php +++ b/lib/private/Collaboration/Resources/Collection.php @@ -64,7 +64,7 @@ class Collection implements ICollection { /** * @return int - * @since 15.0.0 + * @since 16.0.0 */ public function getId(): int { return $this->id; @@ -72,7 +72,7 @@ class Collection implements ICollection { /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getName(): string { return $this->name; @@ -80,7 +80,7 @@ class Collection implements ICollection { /** * @return IResource[] - * @since 15.0.0 + * @since 16.0.0 */ public function getResources(): array { if (empty($this->resources)) { @@ -104,7 +104,7 @@ class Collection implements ICollection { * * @param IResource $resource * @throws ResourceException when the resource is already part of the collection - * @since 15.0.0 + * @since 16.0.0 */ public function addResource(IResource $resource) { array_map(function(IResource $r) use ($resource) { @@ -134,7 +134,7 @@ class Collection implements ICollection { * Removes a resource from a collection * * @param IResource $resource - * @since 15.0.0 + * @since 16.0.0 */ public function removeResource(IResource $resource) { $this->resources = array_filter($this->resources, function(IResource $r) use ($resource) { @@ -158,7 +158,7 @@ class Collection implements ICollection { * * @param IUser $user * @return bool - * @since 15.0.0 + * @since 16.0.0 */ public function canAccess(IUser $user = null): bool { foreach ($this->getResources() as $resource) { diff --git a/lib/private/Collaboration/Resources/Manager.php b/lib/private/Collaboration/Resources/Manager.php index 9f083b3c676..55274432d76 100644 --- a/lib/private/Collaboration/Resources/Manager.php +++ b/lib/private/Collaboration/Resources/Manager.php @@ -49,7 +49,7 @@ class Manager implements IManager { * @param int $id * @return ICollection * @throws CollectionException when the collection could not be found - * @since 15.0.0 + * @since 16.0.0 */ public function getCollection(int $id): ICollection { $query = $this->connection->getQueryBuilder(); @@ -68,10 +68,12 @@ class Manager implements IManager { } /** - * @param int $id - * @return ICollection - * @throws CollectionException when the collection could not be found - * @since 15.0.0 + * @param IUser $user + * @param string $filter + * @param int $limit + * @param int $start + * @return ICollection[] + * @since 16.0.0 */ public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array { $query = $this->connection->getQueryBuilder(); @@ -99,7 +101,7 @@ class Manager implements IManager { /** * @param string $name * @return ICollection - * @since 15.0.0 + * @since 16.0.0 */ public function newCollection(string $name): ICollection { $query = $this->connection->getQueryBuilder(); @@ -116,7 +118,7 @@ class Manager implements IManager { * @param string $type * @param string $id * @return IResource - * @since 15.0.0 + * @since 16.0.0 */ public function getResource(string $type, string $id): IResource { return new Resource($this, $this->connection, $type, $id); @@ -124,7 +126,7 @@ class Manager implements IManager { /** * @return IProvider[] - * @since 15.0.0 + * @since 16.0.0 */ public function getProviders(): array { return $this->providers; @@ -135,7 +137,7 @@ class Manager implements IManager { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getName(IResource $resource): string { foreach ($this->getProviders() as $provider) { @@ -174,7 +176,7 @@ class Manager implements IManager { * @param IResource $resource * @param IUser $user * @return bool - * @since 15.0.0 + * @since 16.0.0 */ public function canAccess(IResource $resource, IUser $user = null): bool { foreach ($this->getProviders() as $provider) { @@ -203,7 +205,7 @@ class Manager implements IManager { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getType(): string { return ''; @@ -214,7 +216,7 @@ class Manager implements IManager { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getLink(IResource $resource): string { foreach ($this->getProviders() as $provider) { @@ -232,7 +234,7 @@ class Manager implements IManager { /** * @param string $name * @return ICollection - * @since 15.0.0 + * @since 16.0.0 */ public function renameCollection(int $id, string $name): ICollection { $query = $this->connection->getQueryBuilder(); diff --git a/lib/private/Collaboration/Resources/Resource.php b/lib/private/Collaboration/Resources/Resource.php index eafba8555e8..c31843bdd06 100644 --- a/lib/private/Collaboration/Resources/Resource.php +++ b/lib/private/Collaboration/Resources/Resource.php @@ -67,7 +67,7 @@ class Resource implements IResource { /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getType(): string { return $this->type; @@ -75,7 +75,7 @@ class Resource implements IResource { /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getId(): string { return $this->id; @@ -83,7 +83,7 @@ class Resource implements IResource { /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getName(): string { if ($this->name === null) { @@ -95,7 +95,7 @@ class Resource implements IResource { /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getIconClass(): string { if ($this->iconClass === null) { @@ -119,7 +119,7 @@ class Resource implements IResource { * * @param IUser $user * @return bool - * @since 15.0.0 + * @since 16.0.0 */ public function canAccess(IUser $user = null): bool { return $this->manager->canAccess($this, $user); @@ -127,7 +127,7 @@ class Resource implements IResource { /** * @return ICollection[] - * @since 15.0.0 + * @since 16.0.0 */ public function getCollections(): array { $collections = []; diff --git a/lib/public/Collaboration/Resources/CollectionException.php b/lib/public/Collaboration/Resources/CollectionException.php index f5130d37d60..b68fe5bff8e 100644 --- a/lib/public/Collaboration/Resources/CollectionException.php +++ b/lib/public/Collaboration/Resources/CollectionException.php @@ -22,7 +22,9 @@ declare(strict_types=1); namespace OCP\Collaboration\Resources; - +/** + * @since 16.0.0 + */ class CollectionException extends \RuntimeException { } diff --git a/lib/public/Collaboration/Resources/ICollection.php b/lib/public/Collaboration/Resources/ICollection.php index d5864466491..cd59a7d3e5a 100644 --- a/lib/public/Collaboration/Resources/ICollection.php +++ b/lib/public/Collaboration/Resources/ICollection.php @@ -25,25 +25,25 @@ namespace OCP\Collaboration\Resources; use OCP\IUser; /** - * @since 15.0.0 + * @since 16.0.0 */ interface ICollection { /** * @return int - * @since 15.0.0 + * @since 16.0.0 */ public function getId(): int; /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getName(): string; /** * @return IResource[] - * @since 15.0.0 + * @since 16.0.0 */ public function getResources(): array; @@ -52,7 +52,7 @@ interface ICollection { * * @param IResource $resource * @throws ResourceException when the resource is already part of the collection - * @since 15.0.0 + * @since 16.0.0 */ public function addResource(IResource $resource); @@ -60,7 +60,7 @@ interface ICollection { * Removes a resource from a collection * * @param IResource $resource - * @since 15.0.0 + * @since 16.0.0 */ public function removeResource(IResource $resource); @@ -69,7 +69,7 @@ interface ICollection { * * @param IUser $user * @return bool - * @since 15.0.0 + * @since 16.0.0 */ public function canAccess(IUser $user = null): bool; } diff --git a/lib/public/Collaboration/Resources/IManager.php b/lib/public/Collaboration/Resources/IManager.php index cac13812fee..77f958e513a 100644 --- a/lib/public/Collaboration/Resources/IManager.php +++ b/lib/public/Collaboration/Resources/IManager.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace OCP\Collaboration\Resources; /** - * @since 15.0.0 + * @since 16.0.0 */ interface IManager extends IProvider { @@ -31,14 +31,14 @@ interface IManager extends IProvider { * @param int $id * @return ICollection * @throws CollectionException when the collection could not be found - * @since 15.0.0 + * @since 16.0.0 */ public function getCollection(int $id): ICollection; /** * @param string $name * @return ICollection - * @since 15.0.0 + * @since 16.0.0 */ public function newCollection(string $name): ICollection; @@ -46,7 +46,7 @@ interface IManager extends IProvider { /** * @param string $name * @return ICollection - * @since 15.0.0 + * @since 16.0.0 */ public function renameCollection(int $id, string $name): ICollection; @@ -54,7 +54,7 @@ interface IManager extends IProvider { * @param string $type * @param string $id * @return IResource - * @since 15.0.0 + * @since 16.0.0 */ public function getResource(string $type, string $id): IResource; diff --git a/lib/public/Collaboration/Resources/IProvider.php b/lib/public/Collaboration/Resources/IProvider.php index 9ffc5f4324b..52ad2305cfe 100644 --- a/lib/public/Collaboration/Resources/IProvider.php +++ b/lib/public/Collaboration/Resources/IProvider.php @@ -24,6 +24,9 @@ namespace OCP\Collaboration\Resources; use OCP\IUser; +/** + * @since 16.0.0 + */ interface IProvider { /** @@ -31,7 +34,7 @@ interface IProvider { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getType(): string; @@ -40,7 +43,7 @@ interface IProvider { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getName(IResource $resource): string; @@ -49,7 +52,7 @@ interface IProvider { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getIconClass(IResource $resource): string; @@ -58,7 +61,7 @@ interface IProvider { * * @param IResource $resource * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getLink(IResource $resource): string; @@ -68,7 +71,7 @@ interface IProvider { * @param IResource $resource * @param IUser $user * @return bool - * @since 15.0.0 + * @since 16.0.0 */ public function canAccess(IResource $resource, IUser $user = null): bool; diff --git a/lib/public/Collaboration/Resources/IResource.php b/lib/public/Collaboration/Resources/IResource.php index d16b4c131d8..34969dabd0d 100644 --- a/lib/public/Collaboration/Resources/IResource.php +++ b/lib/public/Collaboration/Resources/IResource.php @@ -25,37 +25,37 @@ namespace OCP\Collaboration\Resources; use OCP\IUser; /** - * @since 15.0.0 + * @since 16.0.0 */ interface IResource { /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getType(): string; /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getId(): string; /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getName(): string; /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getIconClass(): string; /** * @return string - * @since 15.0.0 + * @since 16.0.0 */ public function getLink(): string; @@ -64,13 +64,13 @@ interface IResource { * * @param IUser $user * @return bool - * @since 15.0.0 + * @since 16.0.0 */ public function canAccess(IUser $user = null): bool; /** * @return ICollection[] - * @since 15.0.0 + * @since 16.0.0 */ public function getCollections(): array; } diff --git a/lib/public/Collaboration/Resources/ResourceException.php b/lib/public/Collaboration/Resources/ResourceException.php index d03264bcef9..235622fcff9 100644 --- a/lib/public/Collaboration/Resources/ResourceException.php +++ b/lib/public/Collaboration/Resources/ResourceException.php @@ -23,6 +23,9 @@ declare(strict_types=1); namespace OCP\Collaboration\Resources; +/** + * @since 16.0.0 + */ class ResourceException extends \RuntimeException { } -- 2.39.5