From e251b34a8c5ba0c06ff8eecf73374895180f7d03 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 13 Jun 2018 14:34:03 +0200 Subject: cleanup variable naming, it is actually a resource type Signed-off-by: Bjoern Schiessle --- .../Federation/CloudFederationProviderManager.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'lib/private') diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php index 5c26afe13f8..2776ad8cac8 100644 --- a/lib/private/Federation/CloudFederationProviderManager.php +++ b/lib/private/Federation/CloudFederationProviderManager.php @@ -82,15 +82,13 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager /** * Registers an callback function which must return an cloud federation provider * - * @param string $shareType which share type does the provider handles + * @param string $resourceType which resource type does the provider handles * @param string $displayName user facing name of the federated share provider * @param callable $callback */ - public function addCloudFederationProvider($shareType, $displayName, callable $callback) { - \OC::$server->getRemoteApiFactory(); - - $this->cloudFederationProvider[$shareType] = [ - 'shareType' => $shareType, + public function addCloudFederationProvider($resourceType, $displayName, callable $callback) { + $this->cloudFederationProvider[$resourceType] = [ + 'resourceType' => $resourceType, 'displayName' => $displayName, 'callback' => $callback, ]; @@ -109,7 +107,7 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager /** * get a list of all cloudFederationProviders * - * @return array [id => ['id' => $id, 'displayName' => $displayName, 'callback' => callback]] + * @return array [resourceType => ['resourceType' => $resourceType, 'displayName' => $displayName, 'callback' => callback]] */ public function getAllCloudFederationProviders() { return $this->cloudFederationProvider; @@ -118,15 +116,15 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager /** * get a specific cloud federation provider * - * @param string $shareType + * @param string $resourceType * @return ICloudFederationProvider * @throws ProviderDoesNotExistsException */ - public function getCloudFederationProvider($shareType) { - if (isset($this->cloudFederationProvider[$shareType])) { - return call_user_func($this->cloudFederationProvider[$shareType]['callback']); + public function getCloudFederationProvider($resourceType) { + if (isset($this->cloudFederationProvider[$resourceType])) { + return call_user_func($this->cloudFederationProvider[$resourceType]['callback']); } else { - throw new ProviderDoesNotExistsException($shareType); + throw new ProviderDoesNotExistsException($resourceType); } } -- cgit v1.2.3