@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $result = []; |
117 | 117 | foreach ($storagesByMountpoint as $storageList) { |
118 | - $storage = array_reduce($storageList, function ($carry, $item) { |
|
118 | + $storage = array_reduce($storageList, function($carry, $item) { |
|
119 | 119 | if (isset($carry)) { |
120 | 120 | $carryPriorityType = $this->getPriorityType($carry); |
121 | 121 | $itemPriorityType = $this->getPriorityType($item); |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $groupIds = $this->groupManager->getUserGroupIds($user); |
192 | 192 | $mounts = $this->dbConfig->getMountsForUser($user->getUID(), $groupIds); |
193 | 193 | $configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts); |
194 | - $configs = array_filter($configs, function ($config) { |
|
194 | + $configs = array_filter($configs, function($config) { |
|
195 | 195 | return $config instanceof StorageConfig; |
196 | 196 | }); |
197 | 197 | |
198 | - $keys = array_map(function (StorageConfig $config) { |
|
198 | + $keys = array_map(function(StorageConfig $config) { |
|
199 | 199 | return $config->getId(); |
200 | 200 | }, $configs); |
201 | 201 |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $jsTrans = []; |
107 | 107 | foreach ($translations as $id => $val) { |
108 | 108 | if (is_array($val)) { |
109 | - $val = '[ ' . implode(',', $val) . ']'; |
|
109 | + $val = '[ '.implode(',', $val).']'; |
|
110 | 110 | } |
111 | 111 | $jsTrans[] = "\"$id\" : \"$val\""; |
112 | 112 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | $providers = $this->registry->getProviderStates($user); |
76 | - $state2fa = array_reduce($providers, function (bool $carry, bool $state) { |
|
76 | + $state2fa = array_reduce($providers, function(bool $carry, bool $state) { |
|
77 | 77 | return $carry || $state; |
78 | 78 | }, false); |
79 | 79 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function discover(string $remote, string $service, bool $skipCache = false): array { |
70 | 70 | // Check the cache first |
71 | 71 | if ($skipCache === false) { |
72 | - $cacheData = $this->cache->get($remote . '#' . $service); |
|
72 | + $cacheData = $this->cache->get($remote.'#'.$service); |
|
73 | 73 | if ($cacheData) { |
74 | 74 | $data = json_decode($cacheData, true); |
75 | 75 | if (\is_array($data)) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | // query the remote server for available services |
84 | 84 | try { |
85 | - $response = $this->client->get($remote . '/ocs-provider/', [ |
|
85 | + $response = $this->client->get($remote.'/ocs-provider/', [ |
|
86 | 86 | 'timeout' => 10, |
87 | 87 | 'connect_timeout' => 10, |
88 | 88 | ]); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | // Write into cache |
100 | - $this->cache->set($remote . '#' . $service, json_encode($discoveredServices), 60 * 60 * 24); |
|
100 | + $this->cache->set($remote.'#'.$service, json_encode($discoveredServices), 60 * 60 * 24); |
|
101 | 101 | return $discoveredServices; |
102 | 102 | } |
103 | 103 | |
@@ -130,6 +130,6 @@ discard block |
||
130 | 130 | * @return bool |
131 | 131 | */ |
132 | 132 | protected function isSafeUrl(string $url): bool { |
133 | - return (bool)preg_match('/^[\/\.\-A-Za-z0-9]+$/', $url); |
|
133 | + return (bool) preg_match('/^[\/\.\-A-Za-z0-9]+$/', $url); |
|
134 | 134 | } |
135 | 135 | } |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * actions that user backends can define |
41 | 41 | */ |
42 | - public const CREATE_USER = 1; // 1 << 0 |
|
43 | - public const SET_PASSWORD = 16; // 1 << 4 |
|
44 | - public const CHECK_PASSWORD = 256; // 1 << 8 |
|
45 | - public const GET_HOME = 4096; // 1 << 12 |
|
46 | - public const GET_DISPLAYNAME = 65536; // 1 << 16 |
|
47 | - public const SET_DISPLAYNAME = 1048576; // 1 << 20 |
|
48 | - public const PROVIDE_AVATAR = 16777216; // 1 << 24 |
|
49 | - public const COUNT_USERS = 268435456; // 1 << 28 |
|
42 | + public const CREATE_USER = 1; // 1 << 0 |
|
43 | + public const SET_PASSWORD = 16; // 1 << 4 |
|
44 | + public const CHECK_PASSWORD = 256; // 1 << 8 |
|
45 | + public const GET_HOME = 4096; // 1 << 12 |
|
46 | + public const GET_DISPLAYNAME = 65536; // 1 << 16 |
|
47 | + public const SET_DISPLAYNAME = 1048576; // 1 << 20 |
|
48 | + public const PROVIDE_AVATAR = 16777216; // 1 << 24 |
|
49 | + public const COUNT_USERS = 268435456; // 1 << 28 |
|
50 | 50 | |
51 | 51 | protected $possibleActions = [ |
52 | 52 | self::CREATE_USER => 'createUser', |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * compared with self::CREATE_USER etc. |
87 | 87 | */ |
88 | 88 | public function implementsActions($actions) { |
89 | - return (bool)($this->getSupportedActions() & $actions); |
|
89 | + return (bool) ($this->getSupportedActions() & $actions); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -95,7 +95,7 @@ |
||
95 | 95 | foreach ($policies as $policy) { |
96 | 96 | header( |
97 | 97 | sprintf( |
98 | - 'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;' . $secureCookie . 'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s', |
|
98 | + 'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;'.$secureCookie.'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s', |
|
99 | 99 | $cookiePrefix, |
100 | 100 | $policy, |
101 | 101 | $cookieParams['path'], |
@@ -125,7 +125,7 @@ |
||
125 | 125 | $status = self::STATUS_FOUND; |
126 | 126 | } |
127 | 127 | |
128 | - return $this->protocolVersion . ' ' . $status . ' ' . |
|
128 | + return $this->protocolVersion.' '.$status.' '. |
|
129 | 129 | $this->headers[$status]; |
130 | 130 | } |
131 | 131 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $result = ['wide' => [], 'exact' => []]; |
64 | 64 | |
65 | 65 | $groups = $this->groupManager->search($search, $limit, $offset); |
66 | - $groupIds = array_map(function (IGroup $group) { |
|
66 | + $groupIds = array_map(function(IGroup $group) { |
|
67 | 67 | return $group->getGID(); |
68 | 68 | }, $groups); |
69 | 69 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if (!empty($groups) && ($this->shareWithGroupOnly || $this->shareeEnumerationInGroupOnly)) { |
76 | 76 | // Intersect all the groups that match with the groups this user is a member of |
77 | 77 | $userGroups = $this->groupManager->getUserGroups($this->userSession->getUser()); |
78 | - $userGroups = array_map(function (IGroup $group) { |
|
78 | + $userGroups = array_map(function(IGroup $group) { |
|
79 | 79 | return $group->getGID(); |
80 | 80 | }, $userGroups); |
81 | 81 | $groupIds = array_intersect($groupIds, $userGroups); |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $response = new Response(); |
87 | 87 | $response->addHeader('Access-Control-Allow-Origin', $origin); |
88 | 88 | $response->addHeader('Access-Control-Allow-Methods', $this->corsMethods); |
89 | - $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge); |
|
89 | + $response->addHeader('Access-Control-Max-Age', (string) $this->corsMaxAge); |
|
90 | 90 | $response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders); |
91 | 91 | $response->addHeader('Access-Control-Allow-Credentials', 'false'); |
92 | 92 | return $response; |