diff options
Diffstat (limited to 'lib')
5 files changed, 34 insertions, 6 deletions
diff --git a/lib/private/Collaboration/Resources/Resource.php b/lib/private/Collaboration/Resources/Resource.php index f82ceff5596..0eda8ba55c2 100644 --- a/lib/private/Collaboration/Resources/Resource.php +++ b/lib/private/Collaboration/Resources/Resource.php @@ -66,19 +66,18 @@ class Resource implements IResource { } /** - * @param IResource $resource * @return ICollection[] * @since 15.0.0 */ - public function getCollections(IResource $resource): array { + public function getCollections(): array { $collections = []; $query = $this->connection->getQueryBuilder(); $query->select('collection_id') ->from('collres_resources') - ->where($query->expr()->eq('resource_type', $query->createNamedParameter($resource->getType()))) - ->andWhere($query->expr()->eq('resource_id', $query->createNamedParameter($resource->getId()))); + ->where($query->expr()->eq('resource_type', $query->createNamedParameter($this->getType()))) + ->andWhere($query->expr()->eq('resource_id', $query->createNamedParameter($this->getId()))); $result = $query->execute(); while ($row = $result->fetch()) { diff --git a/lib/public/Collaboration/Resources/CollectionException.php b/lib/public/Collaboration/Resources/CollectionException.php new file mode 100644 index 00000000000..f5130d37d60 --- /dev/null +++ b/lib/public/Collaboration/Resources/CollectionException.php @@ -0,0 +1,28 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\Collaboration\Resources; + + +class CollectionException extends \RuntimeException { + +} diff --git a/lib/public/Collaboration/Resources/IProvider.php b/lib/public/Collaboration/Resources/IProvider.php index 06e2a6a81ee..eac92733dea 100644 --- a/lib/public/Collaboration/Resources/IProvider.php +++ b/lib/public/Collaboration/Resources/IProvider.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com> * diff --git a/lib/public/Collaboration/Resources/IResource.php b/lib/public/Collaboration/Resources/IResource.php index 42631bc27a8..9f8628c0d48 100644 --- a/lib/public/Collaboration/Resources/IResource.php +++ b/lib/public/Collaboration/Resources/IResource.php @@ -40,9 +40,8 @@ interface IResource { public function getId(): string; /** - * @param IResource $resource * @return ICollection[] * @since 15.0.0 */ - public function getCollections(IResource $resource): array; + public function getCollections(): array; } diff --git a/lib/public/Collaboration/Resources/ResourceException.php b/lib/public/Collaboration/Resources/ResourceException.php index f31b2031a89..d03264bcef9 100644 --- a/lib/public/Collaboration/Resources/ResourceException.php +++ b/lib/public/Collaboration/Resources/ResourceException.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com> * |