Fix doc blocks
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
31340b8be9
commit
dee6f7f61f
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -22,7 +22,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCP\Collaboration\Resources;
|
||||
|
||||
|
||||
/**
|
||||
* @since 16.0.0
|
||||
*/
|
||||
class CollectionException extends \RuntimeException {
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@ declare(strict_types=1);
|
|||
namespace OCP\Collaboration\Resources;
|
||||
|
||||
|
||||
/**
|
||||
* @since 16.0.0
|
||||
*/
|
||||
class ResourceException extends \RuntimeException {
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue