@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | if (isset($params['apiKey'])) { |
| 76 | 76 | $this->client = new Rackspace($params['url'], $params); |
| 77 | - $cacheKey = $this->params['username'] . '@' . $this->params['url'] . '/' . $this->params['bucket']; |
|
| 77 | + $cacheKey = $this->params['username'].'@'.$this->params['url'].'/'.$this->params['bucket']; |
|
| 78 | 78 | } else { |
| 79 | 79 | $this->client = new OpenStack($params['url'], $params); |
| 80 | - $cacheKey = $this->params['username'] . '@' . $this->params['url'] . '/' . $this->params['bucket']; |
|
| 80 | + $cacheKey = $this->params['username'].'@'.$this->params['url'].'/'.$this->params['bucket']; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $cacheFactory = \OC::$server->getMemCacheFactory(); |
| 84 | - $this->memcache = $cacheFactory->create('swift::' . $cacheKey); |
|
| 84 | + $this->memcache = $cacheFactory->create('swift::'.$cacheKey); |
|
| 85 | 85 | |
| 86 | 86 | $this->params = $params; |
| 87 | 87 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | private function exportToken() { |
| 159 | 159 | $export = $this->client->exportCredentials(); |
| 160 | - $export['catalog'] = array_map(function (CatalogItem $item) { |
|
| 160 | + $export['catalog'] = array_map(function(CatalogItem $item) { |
|
| 161 | 161 | return [ |
| 162 | 162 | 'name' => $item->getName(), |
| 163 | 163 | 'endpoints' => $item->getEndpoints(), |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | $cachedTokenString = $this->memcache->get('token'); |
| 172 | 172 | if ($cachedTokenString) { |
| 173 | 173 | $cachedToken = json_decode($cachedTokenString, true); |
| 174 | - $cachedToken['catalog'] = array_map(function (array $item) { |
|
| 174 | + $cachedToken['catalog'] = array_map(function(array $item) { |
|
| 175 | 175 | $itemClass = new \stdClass(); |
| 176 | 176 | $itemClass->name = $item['name']; |
| 177 | - $itemClass->endpoints = array_map(function (array $endpoint) { |
|
| 177 | + $itemClass->endpoints = array_map(function(array $endpoint) { |
|
| 178 | 178 | return (object) $endpoint; |
| 179 | 179 | }, $item['endpoints']); |
| 180 | 180 | $itemClass->type = $item['type']; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - $availableRegions = implode(', ', array_map(function ($endpoint) { |
|
| 216 | + $availableRegions = implode(', ', array_map(function($endpoint) { |
|
| 217 | 217 | return $endpoint->region; |
| 218 | 218 | }, $endPoints)); |
| 219 | 219 | |
@@ -221,9 +221,9 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | private function getAvailableServiceNames(Catalog $catalog) { |
| 224 | - return array_map(function (CatalogItem $item) { |
|
| 224 | + return array_map(function(CatalogItem $item) { |
|
| 225 | 225 | return $item->getName(); |
| 226 | - }, array_filter($catalog->getItems(), function (CatalogItem $item) { |
|
| 226 | + }, array_filter($catalog->getItems(), function(CatalogItem $item) { |
|
| 227 | 227 | return $item->hasType(Service::DEFAULT_TYPE); |
| 228 | 228 | })); |
| 229 | 229 | } |