@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | ->from(self::TAG_TABLE); |
137 | 137 | |
138 | 138 | if (!is_null($visibilityFilter)) { |
139 | - $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter))); |
|
139 | + $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int) $visibilityFilter))); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | if (!empty($nameSearchPattern)) { |
143 | 143 | $query->andWhere( |
144 | 144 | $query->expr()->like( |
145 | 145 | 'name', |
146 | - $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') |
|
146 | + $query->createNamedParameter('%'.$this->connection->escapeLikeParameter($nameSearchPattern).'%') |
|
147 | 147 | ) |
148 | 148 | ); |
149 | 149 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | * {@inheritdoc} |
168 | 168 | */ |
169 | 169 | public function getTag($tagName, $userVisible, $userAssignable) { |
170 | - $userVisible = (int)$userVisible; |
|
171 | - $userAssignable = (int)$userAssignable; |
|
170 | + $userVisible = (int) $userVisible; |
|
171 | + $userAssignable = (int) $userAssignable; |
|
172 | 172 | |
173 | 173 | $result = $this->selectTagQuery |
174 | 174 | ->setParameter('name', $tagName) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $result->closeCursor(); |
181 | 181 | if (!$row) { |
182 | 182 | throw new TagNotFoundException( |
183 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist' |
|
183 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') does not exist' |
|
184 | 184 | ); |
185 | 185 | } |
186 | 186 | |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | * {@inheritdoc} |
192 | 192 | */ |
193 | 193 | public function createTag($tagName, $userVisible, $userAssignable) { |
194 | - $userVisible = (int)$userVisible; |
|
195 | - $userAssignable = (int)$userAssignable; |
|
194 | + $userVisible = (int) $userVisible; |
|
195 | + $userAssignable = (int) $userAssignable; |
|
196 | 196 | |
197 | 197 | $query = $this->connection->getQueryBuilder(); |
198 | 198 | $query->insert(self::TAG_TABLE) |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $query->execute(); |
207 | 207 | } catch (UniqueConstraintViolationException $e) { |
208 | 208 | throw new TagAlreadyExistsException( |
209 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', |
|
209 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists', |
|
210 | 210 | 0, |
211 | 211 | $e |
212 | 212 | ); |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | $tagId = $query->getLastInsertId(); |
216 | 216 | |
217 | 217 | $tag = new SystemTag( |
218 | - (int)$tagId, |
|
218 | + (int) $tagId, |
|
219 | 219 | $tagName, |
220 | - (bool)$userVisible, |
|
221 | - (bool)$userAssignable |
|
220 | + (bool) $userVisible, |
|
221 | + (bool) $userAssignable |
|
222 | 222 | ); |
223 | 223 | |
224 | 224 | $this->dispatcher->dispatch(ManagerEvent::EVENT_CREATE, new ManagerEvent( |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | * {@inheritdoc} |
233 | 233 | */ |
234 | 234 | public function updateTag($tagId, $tagName, $userVisible, $userAssignable) { |
235 | - $userVisible = (int)$userVisible; |
|
236 | - $userAssignable = (int)$userAssignable; |
|
235 | + $userVisible = (int) $userVisible; |
|
236 | + $userAssignable = (int) $userAssignable; |
|
237 | 237 | |
238 | 238 | try { |
239 | 239 | $tags = $this->getTagsByIds($tagId); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | } catch (UniqueConstraintViolationException $e) { |
272 | 272 | throw new TagAlreadyExistsException( |
273 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', |
|
273 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists', |
|
274 | 274 | 0, |
275 | 275 | $e |
276 | 276 | ); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | private function createSystemTagFromRow($row) { |
380 | - return new SystemTag((int)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']); |
|
380 | + return new SystemTag((int) $row['id'], $row['name'], (bool) $row['visibility'], (bool) $row['editable']); |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
@@ -222,8 +222,8 @@ |
||
222 | 222 | public function count($search = '') { |
223 | 223 | $users = false; |
224 | 224 | foreach ($this->backends as $backend) { |
225 | - if($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { |
|
226 | - if($users === false) { |
|
225 | + if ($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { |
|
226 | + if ($users === false) { |
|
227 | 227 | //we could directly add to a bool variable, but this would |
228 | 228 | //be ugly |
229 | 229 | $users = 0; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | IUserSession $userSession |
61 | 61 | ) { |
62 | 62 | $this->user = $user; |
63 | - $this->isAdmin = (bool)$isAdmin; |
|
63 | + $this->isAdmin = (bool) $isAdmin; |
|
64 | 64 | $this->groupManager = $groupManager; |
65 | 65 | $this->userSession = $userSession; |
66 | 66 | } |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | * @return array |
77 | 77 | */ |
78 | 78 | public function get($groupSearch = '', $userSearch = '') { |
79 | - $key = $groupSearch . '::' . $userSearch; |
|
80 | - if(isset($this->metaData[$key])) { |
|
79 | + $key = $groupSearch.'::'.$userSearch; |
|
80 | + if (isset($this->metaData[$key])) { |
|
81 | 81 | return $this->metaData[$key]; |
82 | 82 | } |
83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $sortAdminGroupsIndex = 0; |
89 | 89 | $sortAdminGroupsKeys = array(); |
90 | 90 | |
91 | - foreach($this->getGroups($groupSearch) as $group) { |
|
91 | + foreach ($this->getGroups($groupSearch) as $group) { |
|
92 | 92 | $groupMetaData = $this->generateGroupMetaData($group, $userSearch); |
93 | 93 | if (strtolower($group->getGID()) !== 'admin') { |
94 | 94 | $this->addEntry( |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | * @return \OCP\IGroup[] |
186 | 186 | */ |
187 | 187 | protected function getGroups($search = '') { |
188 | - if($this->isAdmin) { |
|
188 | + if ($this->isAdmin) { |
|
189 | 189 | return $this->groupManager->search($search); |
190 | 190 | } else { |
191 | 191 | $userObject = $this->userSession->getUser(); |
192 | - if($userObject !== null) { |
|
192 | + if ($userObject !== null) { |
|
193 | 193 | $groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($userObject); |
194 | 194 | } else { |
195 | 195 | $groups = []; |
@@ -85,20 +85,20 @@ discard block |
||
85 | 85 | $this->userManager = $userManager; |
86 | 86 | $cachedGroups = & $this->cachedGroups; |
87 | 87 | $cachedUserGroups = & $this->cachedUserGroups; |
88 | - $this->listen('\OC\Group', 'postDelete', function ($group) use (&$cachedGroups, &$cachedUserGroups) { |
|
88 | + $this->listen('\OC\Group', 'postDelete', function($group) use (&$cachedGroups, &$cachedUserGroups) { |
|
89 | 89 | /** |
90 | 90 | * @var \OC\Group\Group $group |
91 | 91 | */ |
92 | 92 | unset($cachedGroups[$group->getGID()]); |
93 | 93 | $cachedUserGroups = array(); |
94 | 94 | }); |
95 | - $this->listen('\OC\Group', 'postAddUser', function ($group) use (&$cachedUserGroups) { |
|
95 | + $this->listen('\OC\Group', 'postAddUser', function($group) use (&$cachedUserGroups) { |
|
96 | 96 | /** |
97 | 97 | * @var \OC\Group\Group $group |
98 | 98 | */ |
99 | 99 | $cachedUserGroups = array(); |
100 | 100 | }); |
101 | - $this->listen('\OC\Group', 'postRemoveUser', function ($group) use (&$cachedUserGroups) { |
|
101 | + $this->listen('\OC\Group', 'postRemoveUser', function($group) use (&$cachedUserGroups) { |
|
102 | 102 | /** |
103 | 103 | * @var \OC\Group\Group $group |
104 | 104 | */ |
@@ -304,32 +304,32 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { |
306 | 306 | $group = $this->get($gid); |
307 | - if(is_null($group)) { |
|
307 | + if (is_null($group)) { |
|
308 | 308 | return array(); |
309 | 309 | } |
310 | 310 | |
311 | 311 | $search = trim($search); |
312 | 312 | $groupUsers = array(); |
313 | 313 | |
314 | - if(!empty($search)) { |
|
314 | + if (!empty($search)) { |
|
315 | 315 | // only user backends have the capability to do a complex search for users |
316 | 316 | $searchOffset = 0; |
317 | 317 | $searchLimit = $limit * 100; |
318 | - if($limit === -1) { |
|
318 | + if ($limit === -1) { |
|
319 | 319 | $searchLimit = 500; |
320 | 320 | } |
321 | 321 | |
322 | 322 | do { |
323 | 323 | $filteredUsers = $this->userManager->searchDisplayName($search, $searchLimit, $searchOffset); |
324 | - foreach($filteredUsers as $filteredUser) { |
|
325 | - if($group->inGroup($filteredUser)) { |
|
326 | - $groupUsers[]= $filteredUser; |
|
324 | + foreach ($filteredUsers as $filteredUser) { |
|
325 | + if ($group->inGroup($filteredUser)) { |
|
326 | + $groupUsers[] = $filteredUser; |
|
327 | 327 | } |
328 | 328 | } |
329 | 329 | $searchOffset += $searchLimit; |
330 | - } while(count($groupUsers) < $searchLimit+$offset && count($filteredUsers) >= $searchLimit); |
|
330 | + } while (count($groupUsers) < $searchLimit + $offset && count($filteredUsers) >= $searchLimit); |
|
331 | 331 | |
332 | - if($limit === -1) { |
|
332 | + if ($limit === -1) { |
|
333 | 333 | $groupUsers = array_slice($groupUsers, $offset); |
334 | 334 | } else { |
335 | 335 | $groupUsers = array_slice($groupUsers, $offset, $limit); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | $matchingUsers = array(); |
342 | - foreach($groupUsers as $groupUser) { |
|
342 | + foreach ($groupUsers as $groupUser) { |
|
343 | 343 | $matchingUsers[$groupUser->getUID()] = $groupUser->getDisplayName(); |
344 | 344 | } |
345 | 345 | return $matchingUsers; |
@@ -99,31 +99,31 @@ discard block |
||
99 | 99 | * Remove "apps/" from inclusion path for smooth migration to multi app dir |
100 | 100 | */ |
101 | 101 | if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) { |
102 | - \OCP\Util::writeLog('core', 'include path for class "' . $class . '" starts with "apps/"', \OCP\Util::DEBUG); |
|
102 | + \OCP\Util::writeLog('core', 'include path for class "'.$class.'" starts with "apps/"', \OCP\Util::DEBUG); |
|
103 | 103 | $paths[] = str_replace('apps/', '', \OC::$CLASSPATH[$class]); |
104 | 104 | } |
105 | 105 | } elseif (strpos($class, 'OC_') === 0) { |
106 | - $paths[] = \OC::$SERVERROOT . '/lib/private/legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); |
|
106 | + $paths[] = \OC::$SERVERROOT.'/lib/private/legacy/'.strtolower(str_replace('_', '/', substr($class, 3)).'.php'); |
|
107 | 107 | } elseif (strpos($class, 'OCA\\') === 0) { |
108 | 108 | list(, $app, $rest) = explode('\\', $class, 3); |
109 | 109 | $app = strtolower($app); |
110 | 110 | $appPath = \OC_App::getAppPath($app); |
111 | 111 | if ($appPath && stream_resolve_include_path($appPath)) { |
112 | - $paths[] = $appPath . '/' . strtolower(str_replace('\\', '/', $rest) . '.php'); |
|
112 | + $paths[] = $appPath.'/'.strtolower(str_replace('\\', '/', $rest).'.php'); |
|
113 | 113 | // If not found in the root of the app directory, insert '/lib' after app id and try again. |
114 | - $paths[] = $appPath . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php'); |
|
114 | + $paths[] = $appPath.'/lib/'.strtolower(str_replace('\\', '/', $rest).'.php'); |
|
115 | 115 | } |
116 | 116 | } elseif ($class === 'Test\\TestCase') { |
117 | 117 | // This File is considered public API, so we make sure that the class |
118 | 118 | // can still be loaded, although the PSR-4 paths have not been loaded. |
119 | - $paths[] = \OC::$SERVERROOT . '/tests/lib/TestCase.php'; |
|
119 | + $paths[] = \OC::$SERVERROOT.'/tests/lib/TestCase.php'; |
|
120 | 120 | |
121 | 121 | } elseif ($class === 'Test\\TestCasePhpUnitCompatibility') { |
122 | - $paths[] = \OC::$SERVERROOT . '/tests/lib/TestCasePhpUnitCompatibility.php'; |
|
122 | + $paths[] = \OC::$SERVERROOT.'/tests/lib/TestCasePhpUnitCompatibility.php'; |
|
123 | 123 | } elseif ($class === 'Test\\TestCasePhpUnit5') { |
124 | - $paths[] = \OC::$SERVERROOT . '/tests/lib/TestCasePhpUnit5.php'; |
|
124 | + $paths[] = \OC::$SERVERROOT.'/tests/lib/TestCasePhpUnit5.php'; |
|
125 | 125 | } elseif ($class === 'Test\\TestCasePhpUnit4') { |
126 | - $paths[] = \OC::$SERVERROOT . '/tests/lib/TestCasePhpUnit4.php'; |
|
126 | + $paths[] = \OC::$SERVERROOT.'/tests/lib/TestCasePhpUnit4.php'; |
|
127 | 127 | } |
128 | 128 | return $paths; |
129 | 129 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function isValidPath($fullPath) { |
136 | 136 | foreach ($this->validRoots as $root => $true) { |
137 | - if (substr($fullPath, 0, strlen($root) + 1) === $root . '/') { |
|
137 | + if (substr($fullPath, 0, strlen($root) + 1) === $root.'/') { |
|
138 | 138 | return true; |
139 | 139 | } |
140 | 140 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $pathsToRequire = $this->memoryCache->get($class); |
154 | 154 | } |
155 | 155 | |
156 | - if(class_exists($class, false)) { |
|
156 | + if (class_exists($class, false)) { |
|
157 | 157 | return false; |
158 | 158 | } |
159 | 159 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | try { |
31 | 31 | |
32 | - require_once __DIR__ . '/lib/base.php'; |
|
32 | + require_once __DIR__.'/lib/base.php'; |
|
33 | 33 | if (\OCP\Util::needUpgrade()) { |
34 | 34 | // since the behavior of apps or remotes are unpredictable during |
35 | 35 | // an upgrade, return a 503 directly |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $pathInfo = trim($pathInfo, '/'); |
53 | 53 | list($service) = explode('/', $pathInfo); |
54 | 54 | } |
55 | - $file = OCP\Config::getAppValue('core', 'public_' . strip_tags($service)); |
|
55 | + $file = OCP\Config::getAppValue('core', 'public_'.strip_tags($service)); |
|
56 | 56 | if (is_null($file)) { |
57 | 57 | header('HTTP/1.0 404 Not Found'); |
58 | 58 | exit; |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | OC_App::loadApps(array('filesystem', 'logging')); |
68 | 68 | |
69 | 69 | if (!\OC::$server->getAppManager()->isInstalled($app)) { |
70 | - throw new Exception('App not installed: ' . $app); |
|
70 | + throw new Exception('App not installed: '.$app); |
|
71 | 71 | } |
72 | 72 | OC_App::loadApp($app); |
73 | 73 | OC_User::setIncognitoMode(true); |
74 | 74 | |
75 | - $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; |
|
75 | + $baseuri = OC::$WEBROOT.'/public.php/'.$service.'/'; |
|
76 | 76 | |
77 | - require_once OC_App::getAppPath($app) . '/' . $parts[1]; |
|
77 | + require_once OC_App::getAppPath($app).'/'.$parts[1]; |
|
78 | 78 | |
79 | 79 | } catch (Exception $ex) { |
80 | 80 | if ($ex instanceof \OC\ServiceUnavailableException) { |
@@ -23,17 +23,17 @@ |
||
23 | 23 | * |
24 | 24 | */ |
25 | 25 | |
26 | -require_once __DIR__ . '/../lib/base.php'; |
|
26 | +require_once __DIR__.'/../lib/base.php'; |
|
27 | 27 | |
28 | 28 | header('Content-type: application/xml'); |
29 | 29 | |
30 | 30 | $request = \OC::$server->getRequest(); |
31 | 31 | |
32 | -$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17).'ocs/v1.php/'; |
|
32 | +$url = $request->getServerProtocol().'://'.substr($request->getServerHost().$request->getRequestUri(), 0, -17).'ocs/v1.php/'; |
|
33 | 33 | |
34 | 34 | $writer = new XMLWriter(); |
35 | 35 | $writer->openURI('php://output'); |
36 | -$writer->startDocument('1.0','UTF-8'); |
|
36 | +$writer->startDocument('1.0', 'UTF-8'); |
|
37 | 37 | $writer->setIndent(4); |
38 | 38 | $writer->startElement('providers'); |
39 | 39 | $writer->startElement('provider'); |
@@ -20,4 +20,4 @@ |
||
20 | 20 | * |
21 | 21 | */ |
22 | 22 | |
23 | -require_once __DIR__ . '/v1.php'; |
|
23 | +require_once __DIR__.'/v1.php'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | */ |
31 | 31 | |
32 | -require_once __DIR__ . '/../lib/base.php'; |
|
32 | +require_once __DIR__.'/../lib/base.php'; |
|
33 | 33 | |
34 | 34 | if (\OCP\Util::needUpgrade() |
35 | 35 | || \OC::$server->getSystemConfig()->getValue('maintenance', false) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * Try the appframework routes |
76 | 76 | */ |
77 | 77 | try { |
78 | - if(!\OC::$server->getUserSession()->isLoggedIn()) { |
|
78 | + if (!\OC::$server->getUserSession()->isLoggedIn()) { |
|
79 | 79 | OC::handleLogin(\OC::$server->getRequest()); |
80 | 80 | } |
81 | 81 | OC::$server->getRouter()->match('/ocsapp'.\OC::$server->getRequest()->getRawPathInfo()); |