@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // default responders |
79 | 79 | $this->responders = array( |
80 | - 'json' => function ($data) { |
|
80 | + 'json' => function($data) { |
|
81 | 81 | if ($data instanceof DataResponse) { |
82 | 82 | $response = new JSONResponse( |
83 | 83 | $data->getData(), |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @since 7.0.0 |
107 | 107 | * @since 9.1.0 Added default parameter |
108 | 108 | */ |
109 | - public function getResponderByHTTPHeader($acceptHeader, $default='json') { |
|
109 | + public function getResponderByHTTPHeader($acceptHeader, $default = 'json') { |
|
110 | 110 | $headers = explode(',', $acceptHeader); |
111 | 111 | |
112 | 112 | // return the first matching responder |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | * @return Response |
146 | 146 | * @since 7.0.0 |
147 | 147 | */ |
148 | - public function buildResponse($response, $format='json') { |
|
149 | - if(array_key_exists($format, $this->responders)) { |
|
148 | + public function buildResponse($response, $format = 'json') { |
|
149 | + if (array_key_exists($format, $this->responders)) { |
|
150 | 150 | |
151 | 151 | $responder = $this->responders[$format]; |
152 | 152 | |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | |
155 | 155 | } |
156 | 156 | throw new \DomainException('No responder registered for format '. |
157 | - $format . '!'); |
|
157 | + $format.'!'); |
|
158 | 158 | } |
159 | 159 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $linkCheckPlugin = new \OCA\DAV\Files\Sharing\PublicLinkCheckPlugin(); |
61 | 61 | $filesDropPlugin = new \OCA\DAV\Files\Sharing\FilesDropPlugin(); |
62 | 62 | |
63 | -$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function (\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) { |
|
63 | +$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function(\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) { |
|
64 | 64 | $isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'); |
65 | 65 | $federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application(); |
66 | 66 | $federatedShareProvider = $federatedSharingApp->getFederatedShareProvider(); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | // FIXME: should not add storage wrappers outside of preSetup, need to find a better way |
78 | 78 | $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false); |
79 | - \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) { |
|
79 | + \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function($mountPoint, $storage) use ($share) { |
|
80 | 80 | return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE)); |
81 | 81 | }); |
82 | 82 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | OC_Util::tearDownFS(); |
86 | 86 | OC_Util::setupFS($owner); |
87 | - $ownerView = new \OC\Files\View('/'. $owner . '/files'); |
|
87 | + $ownerView = new \OC\Files\View('/'.$owner.'/files'); |
|
88 | 88 | $path = $ownerView->getPath($fileId); |
89 | 89 | $fileInfo = $ownerView->getFileInfo($path); |
90 | 90 | $linkCheckPlugin->setFileInfo($fileInfo); |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | $params = []; |
192 | 192 | foreach ($this->getParameters() as $placeholder => $value) { |
193 | 193 | if (is_array($value)) { |
194 | - $params[] = $placeholder . ' => (\'' . implode('\', \'', $value) . '\')'; |
|
194 | + $params[] = $placeholder.' => (\''.implode('\', \'', $value).'\')'; |
|
195 | 195 | } else { |
196 | - $params[] = $placeholder . ' => \'' . $value . '\''; |
|
196 | + $params[] = $placeholder.' => \''.$value.'\''; |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | if (empty($params)) { |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | public function selectAlias($select, $alias) { |
411 | 411 | |
412 | 412 | $this->queryBuilder->addSelect( |
413 | - $this->helper->quoteColumnName($select) . ' AS ' . $this->helper->quoteColumnName($alias) |
|
413 | + $this->helper->quoteColumnName($select).' AS '.$this->helper->quoteColumnName($alias) |
|
414 | 414 | ); |
415 | 415 | |
416 | 416 | return $this; |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | public function selectDistinct($select) { |
433 | 433 | |
434 | 434 | $this->queryBuilder->addSelect( |
435 | - 'DISTINCT ' . $this->helper->quoteColumnName($select) |
|
435 | + 'DISTINCT '.$this->helper->quoteColumnName($select) |
|
436 | 436 | ); |
437 | 437 | |
438 | 438 | return $this; |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | * @return IParameter |
1110 | 1110 | */ |
1111 | 1111 | public function createParameter($name) { |
1112 | - return new Parameter(':' . $name); |
|
1112 | + return new Parameter(':'.$name); |
|
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | /** |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | return $table; |
1177 | 1177 | } |
1178 | 1178 | |
1179 | - return '*PREFIX*' . $table; |
|
1179 | + return '*PREFIX*'.$table; |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | /** |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | $tableAlias .= '.'; |
1192 | 1192 | } |
1193 | 1193 | |
1194 | - return $this->helper->quoteColumnName($tableAlias . $column); |
|
1194 | + return $this->helper->quoteColumnName($tableAlias.$column); |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | /** |
@@ -70,12 +70,12 @@ |
||
70 | 70 | list($alias, $columnName) = explode('.', $string, 2); |
71 | 71 | |
72 | 72 | if ($columnName === '*') { |
73 | - return '`' . $alias . '`.*'; |
|
73 | + return '`'.$alias.'`.*'; |
|
74 | 74 | } |
75 | 75 | |
76 | - return '`' . $alias . '`.`' . $columnName . '`'; |
|
76 | + return '`'.$alias.'`.`'.$columnName.'`'; |
|
77 | 77 | } |
78 | 78 | |
79 | - return '`' . $string . '`'; |
|
79 | + return '`'.$string.'`'; |
|
80 | 80 | } |
81 | 81 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function __construct(ILogger $logger) { |
73 | 73 | $this->logger = $logger; |
74 | 74 | $baseUrl = \OC::$WEBROOT; |
75 | - if(!(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) { |
|
75 | + if (!(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) { |
|
76 | 76 | $baseUrl = \OC::$server->getURLGenerator()->linkTo('', 'index.php'); |
77 | 77 | } |
78 | 78 | if (!\OC::$CLI && isset($_SERVER['REQUEST_METHOD'])) { |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | $this->routingFiles = []; |
99 | 99 | foreach (\OC_APP::getEnabledApps() as $app) { |
100 | 100 | $appPath = \OC_App::getAppPath($app); |
101 | - if($appPath !== false) { |
|
102 | - $file = $appPath . '/appinfo/routes.php'; |
|
101 | + if ($appPath !== false) { |
|
102 | + $file = $appPath.'/appinfo/routes.php'; |
|
103 | 103 | if (file_exists($file)) { |
104 | 104 | $this->routingFiles[$app] = $file; |
105 | 105 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param null|string $app |
116 | 116 | */ |
117 | 117 | public function loadRoutes($app = null) { |
118 | - if(is_string($app)) { |
|
118 | + if (is_string($app)) { |
|
119 | 119 | $app = \OC_App::cleanAppId($app); |
120 | 120 | } |
121 | 121 | |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | if (isset($this->loadedApps[$app])) { |
131 | 131 | return; |
132 | 132 | } |
133 | - $file = \OC_App::getAppPath($app) . '/appinfo/routes.php'; |
|
133 | + $file = \OC_App::getAppPath($app).'/appinfo/routes.php'; |
|
134 | 134 | if ($file !== false && file_exists($file)) { |
135 | 135 | $routingFiles = [$app => $file]; |
136 | 136 | } else { |
137 | 137 | $routingFiles = []; |
138 | 138 | } |
139 | 139 | } |
140 | - \OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes'); |
|
140 | + \OC::$server->getEventLogger()->start('loadroutes'.$requestedApp, 'Loading Routes'); |
|
141 | 141 | foreach ($routingFiles as $app => $file) { |
142 | 142 | if (!isset($this->loadedApps[$app])) { |
143 | 143 | if (!\OC_App::isAppLoaded($app)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->useCollection($app); |
151 | 151 | $this->requireRouteFile($file, $app); |
152 | 152 | $collection = $this->getCollection($app); |
153 | - $collection->addPrefix('/apps/' . $app); |
|
153 | + $collection->addPrefix('/apps/'.$app); |
|
154 | 154 | $this->root->addCollection($collection); |
155 | 155 | |
156 | 156 | // Also add the OCS collection |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | if (!isset($this->loadedApps['core'])) { |
163 | 163 | $this->loadedApps['core'] = true; |
164 | 164 | $this->useCollection('root'); |
165 | - require_once __DIR__ . '/../../../settings/routes.php'; |
|
166 | - require_once __DIR__ . '/../../../core/routes.php'; |
|
165 | + require_once __DIR__.'/../../../settings/routes.php'; |
|
166 | + require_once __DIR__.'/../../../core/routes.php'; |
|
167 | 167 | |
168 | 168 | // Also add the OCS collection |
169 | 169 | $collection = $this->getCollection('root.ocs'); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $collection->addPrefix('/ocs'); |
176 | 176 | $this->root->addCollection($collection); |
177 | 177 | } |
178 | - \OC::$server->getEventLogger()->end('loadroutes' . $requestedApp); |
|
178 | + \OC::$server->getEventLogger()->end('loadroutes'.$requestedApp); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | public function match($url) { |
247 | 247 | if (substr($url, 0, 6) === '/apps/') { |
248 | 248 | // empty string / 'apps' / $app / rest of the route |
249 | - list(, , $app,) = explode('/', $url, 4); |
|
249 | + list(,, $app,) = explode('/', $url, 4); |
|
250 | 250 | |
251 | 251 | $app = \OC_App::cleanAppId($app); |
252 | 252 | \OC::$REQUESTEDAPP = $app; |
253 | 253 | $this->loadRoutes($app); |
254 | 254 | } else if (substr($url, 0, 13) === '/ocsapp/apps/') { |
255 | 255 | // empty string / 'ocsapp' / 'apps' / $app / rest of the route |
256 | - list(, , , $app,) = explode('/', $url, 5); |
|
256 | + list(,,, $app,) = explode('/', $url, 5); |
|
257 | 257 | |
258 | 258 | $app = \OC_App::cleanAppId($app); |
259 | 259 | \OC::$REQUESTEDAPP = $app; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | // However, since Symfony does not allow empty route names, the route |
278 | 278 | // we need to match is '/', so we need to append the '/' here. |
279 | 279 | try { |
280 | - $parameters = $matcher->match($url . '/'); |
|
280 | + $parameters = $matcher->match($url.'/'); |
|
281 | 281 | } catch (ResourceNotFoundException $newException) { |
282 | 282 | // If we still didn't match a route, we throw the original exception |
283 | 283 | throw $e; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | if (is_array($routes)) { |
368 | 368 | $appNameSpace = App::buildAppNamespace($appName); |
369 | 369 | |
370 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
370 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
371 | 371 | |
372 | 372 | if (class_exists($applicationClassName)) { |
373 | 373 | $application = new $applicationClassName(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return new DataResponse(); |
85 | 85 | } |
86 | 86 | |
87 | - $this->logger->error('Could not accept federated share with id: ' . $id, |
|
87 | + $this->logger->error('Could not accept federated share with id: '.$id, |
|
88 | 88 | ['app' => 'files_sharing']); |
89 | 89 | |
90 | 90 | throw new OCSNotFoundException('wrong share ID, share doesn\'t exist.'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @return array enriched share info with data from the filecache |
116 | 116 | */ |
117 | 117 | private static function extendShareInfo($share) { |
118 | - $view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/'); |
|
118 | + $view = new \OC\Files\View('/'.\OC_User::getUser().'/files/'); |
|
119 | 119 | $info = $view->getFileInfo($share['mountpoint']); |
120 | 120 | |
121 | 121 | $share['mimetype'] = $info->getMimetype(); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | throw new OCSNotFoundException('Share does not exist'); |
179 | 179 | } |
180 | 180 | |
181 | - $mountPoint = '/' . \OC_User::getUser() . '/files' . $shareInfo['mountpoint']; |
|
181 | + $mountPoint = '/'.\OC_User::getUser().'/files'.$shareInfo['mountpoint']; |
|
182 | 182 | |
183 | 183 | if ($this->externalManager->removeShare($mountPoint) === true) { |
184 | 184 | return new DataResponse(); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | use OCA\Testing\AlternativeHomeUserBackend; |
26 | 26 | |
27 | 27 | class Application extends App { |
28 | - public function __construct (array $urlParams = array()) { |
|
28 | + public function __construct(array $urlParams = array()) { |
|
29 | 29 | $appName = 'testing'; |
30 | 30 | parent::__construct($appName, $urlParams); |
31 | 31 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function getPath($user, $path) { |
100 | 100 | $node = $this->rootFolder->getUserFolder($user)->get($path); |
101 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
101 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | try { |
136 | 136 | $lockingProvider->acquireLock($path, $type); |
137 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
137 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
138 | 138 | return new DataResponse(); |
139 | 139 | } catch (LockedException $e) { |
140 | 140 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | try { |
163 | 163 | $lockingProvider->changeLock($path, $type); |
164 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
164 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
165 | 165 | return new DataResponse(); |
166 | 166 | } catch (LockedException $e) { |
167 | 167 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | try { |
190 | 190 | $lockingProvider->releaseLock($path, $type); |
191 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
191 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
192 | 192 | return new DataResponse(); |
193 | 193 | } catch (LockedException $e) { |
194 | 194 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | if (strpos($lock, 'locking_') === 0) { |
232 | 232 | $path = substr($lock, strlen('locking_')); |
233 | 233 | |
234 | - if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
234 | + if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
235 | 235 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
236 | - } else if ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
236 | + } else if ($type === ILockingProvider::LOCK_SHARED && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
237 | 237 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
238 | 238 | } else { |
239 | 239 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | * @param array $headers additional key value based headers |
47 | 47 | * @since 8.1.0 |
48 | 48 | */ |
49 | - public function __construct($data='', $statusCode=Http::STATUS_OK, |
|
50 | - $headers=[]) { |
|
49 | + public function __construct($data = '', $statusCode = Http::STATUS_OK, |
|
50 | + $headers = []) { |
|
51 | 51 | $this->data = $data; |
52 | 52 | $this->setStatus($statusCode); |
53 | 53 | $this->setHeaders(array_merge($this->getHeaders(), $headers)); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @return DataDisplayResponse Reference to this object |
71 | 71 | * @since 8.1.0 |
72 | 72 | */ |
73 | - public function setData($data){ |
|
73 | + public function setData($data) { |
|
74 | 74 | $this->data = $data; |
75 | 75 | |
76 | 76 | return $this; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return string the data |
83 | 83 | * @since 8.1.0 |
84 | 84 | */ |
85 | - public function getData(){ |
|
85 | + public function getData() { |
|
86 | 86 | return $this->data; |
87 | 87 | } |
88 | 88 |