@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $server->on('report', [$this, 'report']); |
80 | 80 | |
81 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
81 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
82 | 82 | CalendarSearchReport::class; |
83 | 83 | } |
84 | 84 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function report($reportName, $report, $path) { |
94 | 94 | switch ($reportName) { |
95 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
95 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
96 | 96 | $this->server->transactionType = 'report-nc-calendar-search'; |
97 | 97 | $this->calendarSearch($report); |
98 | 98 | return false; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $reports = []; |
116 | 116 | if ($node instanceof CalendarHome) { |
117 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
117 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | return $reports; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | foreach ($nodePaths as $path) { |
146 | 146 | list($properties) = $this->server->getPropertiesForPath( |
147 | - $this->server->getRequestUri() . '/' . $path, |
|
147 | + $this->server->getRequestUri().'/'.$path, |
|
148 | 148 | $report->properties); |
149 | 149 | $result[] = $properties; |
150 | 150 | } |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | public function get($key) { |
54 | - $result = self::$cache->get($this->getNameSpace() . $key); |
|
55 | - if ($result === false && !self::$cache->exists($this->getNameSpace() . $key)) { |
|
54 | + $result = self::$cache->get($this->getNameSpace().$key); |
|
55 | + if ($result === false && !self::$cache->exists($this->getNameSpace().$key)) { |
|
56 | 56 | return null; |
57 | 57 | } else { |
58 | 58 | return json_decode($result, true); |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | |
62 | 62 | public function set($key, $value, $ttl = 0) { |
63 | 63 | if ($ttl > 0) { |
64 | - return self::$cache->setex($this->getNameSpace() . $key, $ttl, json_encode($value)); |
|
64 | + return self::$cache->setex($this->getNameSpace().$key, $ttl, json_encode($value)); |
|
65 | 65 | } else { |
66 | - return self::$cache->set($this->getNameSpace() . $key, json_encode($value)); |
|
66 | + return self::$cache->set($this->getNameSpace().$key, json_encode($value)); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | 70 | public function hasKey($key) { |
71 | - return self::$cache->exists($this->getNameSpace() . $key); |
|
71 | + return self::$cache->exists($this->getNameSpace().$key); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function remove($key) { |
75 | - if (self::$cache->del($this->getNameSpace() . $key)) { |
|
75 | + if (self::$cache->del($this->getNameSpace().$key)) { |
|
76 | 76 | return true; |
77 | 77 | } else { |
78 | 78 | return false; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | public function clear($prefix = '') { |
83 | - $prefix = $this->getNameSpace() . $prefix . '*'; |
|
83 | + $prefix = $this->getNameSpace().$prefix.'*'; |
|
84 | 84 | $keys = self::$cache->keys($prefix); |
85 | 85 | $deleted = self::$cache->del($keys); |
86 | 86 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (!is_int($value)) { |
101 | 101 | $value = json_encode($value); |
102 | 102 | } |
103 | - return self::$cache->setnx($this->getPrefix() . $key, $value); |
|
103 | + return self::$cache->setnx($this->getPrefix().$key, $value); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @return int | bool |
112 | 112 | */ |
113 | 113 | public function inc($key, $step = 1) { |
114 | - return self::$cache->incrBy($this->getNameSpace() . $key, $step); |
|
114 | + return self::$cache->incrBy($this->getNameSpace().$key, $step); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if (!$this->hasKey($key)) { |
126 | 126 | return false; |
127 | 127 | } |
128 | - return self::$cache->decrBy($this->getNameSpace() . $key, $step); |
|
128 | + return self::$cache->decrBy($this->getNameSpace().$key, $step); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | if (!is_int($new)) { |
141 | 141 | $new = json_encode($new); |
142 | 142 | } |
143 | - self::$cache->watch($this->getNameSpace() . $key); |
|
143 | + self::$cache->watch($this->getNameSpace().$key); |
|
144 | 144 | if ($this->get($key) === $old) { |
145 | 145 | $result = self::$cache->multi() |
146 | - ->set($this->getNameSpace() . $key, $new) |
|
146 | + ->set($this->getNameSpace().$key, $new) |
|
147 | 147 | ->exec(); |
148 | 148 | return $result !== false; |
149 | 149 | } |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | * @return bool |
160 | 160 | */ |
161 | 161 | public function cad($key, $old) { |
162 | - self::$cache->watch($this->getNameSpace() . $key); |
|
162 | + self::$cache->watch($this->getNameSpace().$key); |
|
163 | 163 | if ($this->get($key) === $old) { |
164 | 164 | $result = self::$cache->multi() |
165 | - ->del($this->getNameSpace() . $key) |
|
165 | + ->del($this->getNameSpace().$key) |
|
166 | 166 | ->exec(); |
167 | 167 | return $result !== false; |
168 | 168 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | public function setTTL($key, $ttl) { |
174 | - self::$cache->expire($this->getNameSpace() . $key, $ttl); |
|
174 | + self::$cache->expire($this->getNameSpace().$key, $ttl); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | static public function isAvailable() { |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | $input = $host; |
63 | 63 | if (strpos($host, '://') === false) { |
64 | 64 | // add a protocol to fix parse_url behavior with ipv6 |
65 | - $host = 'http://' . $host; |
|
65 | + $host = 'http://'.$host; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $parsed = parse_url($host); |
69 | - if(is_array($parsed) && isset($parsed['port'])) { |
|
69 | + if (is_array($parsed) && isset($parsed['port'])) { |
|
70 | 70 | return [$parsed['host'], $parsed['port']]; |
71 | 71 | } else if (is_array($parsed)) { |
72 | 72 | return [$parsed['host'], 22]; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | // Register sftp:// |
83 | 83 | Stream::register(); |
84 | 84 | |
85 | - $parsedHost = $this->splitHost($params['host']); |
|
85 | + $parsedHost = $this->splitHost($params['host']); |
|
86 | 86 | |
87 | 87 | $this->host = $parsedHost[0]; |
88 | 88 | $this->port = $parsedHost[1]; |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | $this->root |
104 | 104 | = isset($params['root']) ? $this->cleanPath($params['root']) : '/'; |
105 | 105 | |
106 | - $this->root = '/' . ltrim($this->root, '/'); |
|
107 | - $this->root = rtrim($this->root, '/') . '/'; |
|
106 | + $this->root = '/'.ltrim($this->root, '/'); |
|
107 | + $this->root = rtrim($this->root, '/').'/'; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -154,15 +154,15 @@ discard block |
||
154 | 154 | /** |
155 | 155 | * {@inheritdoc} |
156 | 156 | */ |
157 | - public function getId(){ |
|
158 | - $id = 'sftp::' . $this->user . '@' . $this->host; |
|
157 | + public function getId() { |
|
158 | + $id = 'sftp::'.$this->user.'@'.$this->host; |
|
159 | 159 | if ($this->port !== 22) { |
160 | - $id .= ':' . $this->port; |
|
160 | + $id .= ':'.$this->port; |
|
161 | 161 | } |
162 | 162 | // note: this will double the root slash, |
163 | 163 | // we should not change it to keep compatible with |
164 | 164 | // old storage ids |
165 | - $id .= '/' . $this->root; |
|
165 | + $id .= '/'.$this->root; |
|
166 | 166 | return $id; |
167 | 167 | } |
168 | 168 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @return string |
193 | 193 | */ |
194 | 194 | private function absPath($path) { |
195 | - return $this->root . $this->cleanPath($path); |
|
195 | + return $this->root.$this->cleanPath($path); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | try { |
203 | 203 | $storage_view = \OCP\Files::getStorage('files_external'); |
204 | 204 | if ($storage_view) { |
205 | - return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . |
|
206 | - $storage_view->getAbsolutePath('') . |
|
205 | + return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'). |
|
206 | + $storage_view->getAbsolutePath(''). |
|
207 | 207 | 'ssh_hostKeys'; |
208 | 208 | } |
209 | 209 | } catch (\Exception $e) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if ($keyPath && file_exists($keyPath)) { |
222 | 222 | $fp = fopen($keyPath, 'w'); |
223 | 223 | foreach ($keys as $host => $key) { |
224 | - fwrite($fp, $host . '::' . $key . "\n"); |
|
224 | + fwrite($fp, $host.'::'.$key."\n"); |
|
225 | 225 | } |
226 | 226 | fclose($fp); |
227 | 227 | return true; |
@@ -293,15 +293,15 @@ discard block |
||
293 | 293 | return false; |
294 | 294 | } |
295 | 295 | |
296 | - $id = md5('sftp:' . $path); |
|
296 | + $id = md5('sftp:'.$path); |
|
297 | 297 | $dirStream = array(); |
298 | - foreach($list as $file) { |
|
298 | + foreach ($list as $file) { |
|
299 | 299 | if ($file !== '.' && $file !== '..') { |
300 | 300 | $dirStream[] = $file; |
301 | 301 | } |
302 | 302 | } |
303 | 303 | return IteratorDirectory::wrap($dirStream); |
304 | - } catch(\Exception $e) { |
|
304 | + } catch (\Exception $e) { |
|
305 | 305 | return false; |
306 | 306 | } |
307 | 307 | } |
@@ -353,10 +353,10 @@ discard block |
||
353 | 353 | public function fopen($path, $mode) { |
354 | 354 | try { |
355 | 355 | $absPath = $this->absPath($path); |
356 | - switch($mode) { |
|
356 | + switch ($mode) { |
|
357 | 357 | case 'r': |
358 | 358 | case 'rb': |
359 | - if ( !$this->file_exists($path)) { |
|
359 | + if (!$this->file_exists($path)) { |
|
360 | 360 | return false; |
361 | 361 | } |
362 | 362 | case 'w': |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | /** |
384 | 384 | * {@inheritdoc} |
385 | 385 | */ |
386 | - public function touch($path, $mtime=null) { |
|
386 | + public function touch($path, $mtime = null) { |
|
387 | 387 | try { |
388 | 388 | if (!is_null($mtime)) { |
389 | 389 | return false; |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | // Do not pass the password here. We want to use the Net_SFTP object |
459 | 459 | // supplied via stream context or fail. We only supply username and |
460 | 460 | // hostname because this might show up in logs (they are not used). |
461 | - $url = 'sftp://' . urlencode($this->user) . '@' . $this->host . ':' . $this->port . $this->root . $path; |
|
461 | + $url = 'sftp://'.urlencode($this->user).'@'.$this->host.':'.$this->port.$this->root.$path; |
|
462 | 462 | return $url; |
463 | 463 | } |
464 | 464 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public static function extendJsConfig($settings) { |
58 | 58 | $appConfig = json_decode($settings['array']['oc_appconfig'], true); |
59 | 59 | |
60 | - $maxChunkSize = (int)\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024); |
|
60 | + $maxChunkSize = (int) \OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024); |
|
61 | 61 | $appConfig['files'] = [ |
62 | 62 | 'max_chunk_size' => $maxChunkSize |
63 | 63 | ]; |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap, GroupPluginManager $groupPluginManager) { |
39 | 39 | parent::__construct($ldap); |
40 | - foreach($serverConfigPrefixes as $configPrefix) { |
|
40 | + foreach ($serverConfigPrefixes as $configPrefix) { |
|
41 | 41 | $this->backends[$configPrefix] = |
42 | 42 | new \OCA\User_LDAP\Group_LDAP($this->getAccess($configPrefix), $groupPluginManager); |
43 | - if(is_null($this->refBackend)) { |
|
43 | + if (is_null($this->refBackend)) { |
|
44 | 44 | $this->refBackend = &$this->backends[$configPrefix]; |
45 | 45 | } |
46 | 46 | } |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function walkBackends($gid, $method, $parameters) { |
57 | 57 | $cacheKey = $this->getGroupCacheKey($gid); |
58 | - foreach($this->backends as $configPrefix => $backend) { |
|
59 | - if($result = call_user_func_array(array($backend, $method), $parameters)) { |
|
58 | + foreach ($this->backends as $configPrefix => $backend) { |
|
59 | + if ($result = call_user_func_array(array($backend, $method), $parameters)) { |
|
60 | 60 | $this->writeToCache($cacheKey, $configPrefix); |
61 | 61 | return $result; |
62 | 62 | } |
@@ -76,17 +76,17 @@ discard block |
||
76 | 76 | $cacheKey = $this->getGroupCacheKey($gid); |
77 | 77 | $prefix = $this->getFromCache($cacheKey); |
78 | 78 | //in case the uid has been found in the past, try this stored connection first |
79 | - if(!is_null($prefix)) { |
|
80 | - if(isset($this->backends[$prefix])) { |
|
79 | + if (!is_null($prefix)) { |
|
80 | + if (isset($this->backends[$prefix])) { |
|
81 | 81 | $result = call_user_func_array(array($this->backends[$prefix], $method), $parameters); |
82 | - if($result === $passOnWhen) { |
|
82 | + if ($result === $passOnWhen) { |
|
83 | 83 | //not found here, reset cache to null if group vanished |
84 | 84 | //because sometimes methods return false with a reason |
85 | 85 | $groupExists = call_user_func_array( |
86 | 86 | array($this->backends[$prefix], 'groupExists'), |
87 | 87 | array($gid) |
88 | 88 | ); |
89 | - if(!$groupExists) { |
|
89 | + if (!$groupExists) { |
|
90 | 90 | $this->writeToCache($cacheKey, null); |
91 | 91 | } |
92 | 92 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function getUserGroups($uid) { |
120 | 120 | $groups = array(); |
121 | 121 | |
122 | - foreach($this->backends as $backend) { |
|
122 | + foreach ($this->backends as $backend) { |
|
123 | 123 | $backendGroups = $backend->getUserGroups($uid); |
124 | 124 | if (is_array($backendGroups)) { |
125 | 125 | $groups = array_merge($groups, $backendGroups); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { |
137 | 137 | $users = array(); |
138 | 138 | |
139 | - foreach($this->backends as $backend) { |
|
139 | + foreach ($this->backends as $backend) { |
|
140 | 140 | $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset); |
141 | 141 | if (is_array($backendUsers)) { |
142 | 142 | $users = array_merge($users, $backendUsers); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | public function getGroups($search = '', $limit = -1, $offset = 0) { |
222 | 222 | $groups = array(); |
223 | 223 | |
224 | - foreach($this->backends as $backend) { |
|
224 | + foreach ($this->backends as $backend) { |
|
225 | 225 | $backendGroups = $backend->getGroups($search, $limit, $offset); |
226 | 226 | if (is_array($backendGroups)) { |
227 | 227 | $groups = array_merge($groups, $backendGroups); |
@@ -56,8 +56,8 @@ |
||
56 | 56 | */ |
57 | 57 | public function postConnect(ConnectionEventArgs $args) { |
58 | 58 | $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; |
59 | - $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); |
|
60 | - $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); |
|
59 | + $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = '.$sensitive); |
|
60 | + $args->getConnection()->executeUpdate('PRAGMA journal_mode = '.$this->journalMode); |
|
61 | 61 | /** @var \PDO $pdo */ |
62 | 62 | $pdo = $args->getConnection()->getWrappedConnection(); |
63 | 63 | $pdo->sqliteCreateFunction('md5', 'md5', 1); |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | $params = array(); |
94 | 94 | if (count($ids) == 1 && isset($uidOwner)) { |
95 | 95 | // FIXME: don't concat $parents, use Docrine's PARAM_INT_ARRAY approach |
96 | - $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' . |
|
97 | - '`item_target`, `file_target`, `parent` ' . |
|
98 | - 'FROM `*PREFIX*share` ' . |
|
96 | + $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, '. |
|
97 | + '`item_target`, `file_target`, `parent` '. |
|
98 | + 'FROM `*PREFIX*share` '. |
|
99 | 99 | 'WHERE `parent` IN ('.$parents.') AND `uid_owner` = ? '; |
100 | 100 | $params[] = $uidOwner; |
101 | 101 | } else { |
102 | - $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' . |
|
103 | - '`item_target`, `file_target`, `parent`, `uid_owner` ' . |
|
102 | + $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, '. |
|
103 | + '`item_target`, `file_target`, `parent`, `uid_owner` '. |
|
104 | 104 | 'FROM `*PREFIX*share` WHERE `parent` IN ('.$parents.') '; |
105 | 105 | } |
106 | 106 | if ($excludeGroupChildren) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'shareWith' => $item['share_with'], |
118 | 118 | 'itemTarget' => $item['item_target'], |
119 | 119 | 'itemType' => $item['item_type'], |
120 | - 'shareType' => (int)$item['share_type'], |
|
120 | + 'shareType' => (int) $item['share_type'], |
|
121 | 121 | ); |
122 | 122 | if (isset($item['file_target'])) { |
123 | 123 | $tmpItem['fileTarget'] = $item['file_target']; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if ($defaultExpireDate === 'yes') { |
169 | 169 | $enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); |
170 | 170 | $defaultExpireSettings['defaultExpireDateSet'] = true; |
171 | - $defaultExpireSettings['expireAfterDays'] = (int)$config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
171 | + $defaultExpireSettings['expireAfterDays'] = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
172 | 172 | $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes'; |
173 | 173 | } |
174 | 174 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @since 9.1.0 |
38 | 38 | */ |
39 | - const KEY_ADMIN_SECTION = 'admin-section'; |
|
39 | + const KEY_ADMIN_SECTION = 'admin-section'; |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * @since 13.0.0 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @since 13.0.0 |
48 | 48 | */ |
49 | - const KEY_PERSONAL_SECTION = 'personal-section'; |
|
49 | + const KEY_PERSONAL_SECTION = 'personal-section'; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @param string $type 'admin' or 'personal' |
@@ -164,7 +164,7 @@ |
||
164 | 164 | * @since 14.0.0 |
165 | 165 | */ |
166 | 166 | public function render(): string { |
167 | - $detailContent = ($this->detail !== '') ? ' <span class="download-size">(' . Util::sanitizeHTML($this->detail) . ')</span>' : ''; |
|
167 | + $detailContent = ($this->detail !== '') ? ' <span class="download-size">('.Util::sanitizeHTML($this->detail).')</span>' : ''; |
|
168 | 168 | return sprintf( |
169 | 169 | '<li id="%s"><a href="%s"><span class="icon %s"></span>%s %s</a></li>', |
170 | 170 | Util::sanitizeHTML($this->id), Util::sanitizeHTML($this->link), Util::sanitizeHTML($this->icon), Util::sanitizeHTML($this->label), $detailContent |