@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
118 | 118 | // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
119 | 119 | // we do not provide locking we emulate it using a fake locking plugin. |
120 | - if($this->request->isUserAgent([ |
|
120 | + if ($this->request->isUserAgent([ |
|
121 | 121 | '/WebDAVFS/', |
122 | 122 | '/Microsoft Office OneNote 2013/', |
123 | 123 | '/Microsoft-WebDAV-MiniRedir/', |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | // wait with registering these until auth is handled and the filesystem is setup |
133 | - $server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) { |
|
133 | + $server->on('beforeMethod', function() use ($server, $objectTree, $viewCallBack) { |
|
134 | 134 | // ensure the skeleton is copied |
135 | 135 | $userFolder = \OC::$server->getUserFolder(); |
136 | 136 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | ); |
163 | 163 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view)); |
164 | 164 | |
165 | - if($this->userSession->isLoggedIn()) { |
|
165 | + if ($this->userSession->isLoggedIn()) { |
|
166 | 166 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager)); |
167 | 167 | $server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( |
168 | 168 | $objectTree, |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // we catch the exception to prevent breaking the whole list with a 404 |
112 | 112 | // (soft fail) |
113 | 113 | \OC::$server->getLogger()->warning( |
114 | - 'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(), |
|
114 | + 'Could not get node for path: \"'.$path.'\" : '.$e->getMessage(), |
|
115 | 115 | array('app' => 'files') |
116 | 116 | ); |
117 | 117 | return; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $statement = $this->connection->prepare( |
171 | 171 | 'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?' |
172 | 172 | ); |
173 | - $statement->execute(array($this->user, '/' . $path)); |
|
173 | + $statement->execute(array($this->user, '/'.$path)); |
|
174 | 174 | $statement->closeCursor(); |
175 | 175 | |
176 | 176 | unset($this->cache[$path]); |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function move($source, $destination) { |
188 | 188 | $statement = $this->connection->prepare( |
189 | - 'UPDATE `*PREFIX*properties` SET `propertypath` = ?' . |
|
189 | + 'UPDATE `*PREFIX*properties` SET `propertypath` = ?'. |
|
190 | 190 | ' WHERE `userid` = ? AND `propertypath` = ?' |
191 | 191 | ); |
192 | - $statement->execute(array('/' . $destination, $this->user, '/' . $source)); |
|
192 | + $statement->execute(array('/'.$destination, $this->user, '/'.$source)); |
|
193 | 193 | $statement->closeCursor(); |
194 | 194 | } |
195 | 195 | |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | private function updateProperties($node, $properties) { |
251 | 251 | $path = $node->getPath(); |
252 | 252 | |
253 | - $deleteStatement = 'DELETE FROM `*PREFIX*properties`' . |
|
253 | + $deleteStatement = 'DELETE FROM `*PREFIX*properties`'. |
|
254 | 254 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
255 | 255 | |
256 | - $insertStatement = 'INSERT INTO `*PREFIX*properties`' . |
|
256 | + $insertStatement = 'INSERT INTO `*PREFIX*properties`'. |
|
257 | 257 | ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)'; |
258 | 258 | |
259 | - $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' . |
|
259 | + $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?'. |
|
260 | 260 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
261 | 261 | |
262 | 262 | // TODO: use "insert or update" strategy ? |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | $result = $this->connection->executeQuery( |
331 | 331 | $sql, |
332 | - array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties), |
|
332 | + array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')).'/%', $requestedProperties), |
|
333 | 333 | array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY) |
334 | 334 | ); |
335 | 335 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | // verify path of the target |
131 | 131 | $this->verifyPath(); |
132 | 132 | |
133 | - $newPath = $parentPath . '/' . $newName; |
|
133 | + $newPath = $parentPath.'/'.$newName; |
|
134 | 134 | |
135 | 135 | $this->fileView->rename($this->path, $newPath); |
136 | 136 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function getLastModified() { |
152 | 152 | $timestamp = $this->info->getMtime(); |
153 | 153 | if (!empty($timestamp)) { |
154 | - return (int)$timestamp; |
|
154 | + return (int) $timestamp; |
|
155 | 155 | } |
156 | 156 | return $timestamp; |
157 | 157 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @return string |
179 | 179 | */ |
180 | 180 | public function getETag() { |
181 | - return '"' . $this->info->getEtag() . '"'; |
|
181 | + return '"'.$this->info->getEtag().'"'; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | if ($this->info->getId()) { |
218 | 218 | $instanceId = \OC_Util::getInstanceId(); |
219 | 219 | $id = sprintf('%08d', $this->info->getId()); |
220 | - return $id . $instanceId; |
|
220 | + return $id.$instanceId; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | return null; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) { |
254 | 254 | /** @var \OCA\Files_Sharing\SharedStorage $storage */ |
255 | - $permissions = (int)$storage->getShare()->getPermissions(); |
|
255 | + $permissions = (int) $storage->getShare()->getPermissions(); |
|
256 | 256 | } else { |
257 | 257 | $permissions = $storage->getPermissions($path); |
258 | 258 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | return null; |
91 | 91 | } |
92 | 92 | foreach ($tree as $elem) { |
93 | - if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') { |
|
93 | + if ($elem['name'] === '{'.self::NS_OWNCLOUD.'}tag') { |
|
94 | 94 | $tags[] = $elem['value']; |
95 | 95 | } |
96 | 96 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | function xmlSerialize(Writer $writer) { |
120 | 120 | |
121 | 121 | foreach ($this->tags as $tag) { |
122 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag); |
|
122 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}tag', $tag); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -114,6 +114,6 @@ |
||
114 | 114 | 'Line' => $ex->getLine(), |
115 | 115 | 'User' => $user, |
116 | 116 | ]; |
117 | - $this->logger->log($level, 'Exception: ' . json_encode($exception), ['app' => $this->appName]); |
|
117 | + $this->logger->log($level, 'Exception: '.json_encode($exception), ['app' => $this->appName]); |
|
118 | 118 | } |
119 | 119 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | $shareTypesByFileId = []; |
150 | 150 | |
151 | - foreach($shares as $fileId => $sharesForFile) { |
|
151 | + foreach ($shares as $fileId => $sharesForFile) { |
|
152 | 152 | $types = array_map(function(IShare $share) { |
153 | 153 | return $share->getShareType(); |
154 | 154 | }, $sharesForFile); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
192 | - $propFind->handle(self::SHARETYPES_PROPERTYNAME, function () use ($sabreNode) { |
|
192 | + $propFind->handle(self::SHARETYPES_PROPERTYNAME, function() use ($sabreNode) { |
|
193 | 193 | if (isset($this->cachedShareTypes[$sabreNode->getId()])) { |
194 | 194 | $shareTypes = $this->cachedShareTypes[$sabreNode->getId()]; |
195 | 195 | } else { |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | |
51 | 51 | function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { |
52 | 52 | $access = parent::checkPrivileges($uri, $privileges, $recursion, false); |
53 | - if($access === false && $throwExceptions) { |
|
53 | + if ($access === false && $throwExceptions) { |
|
54 | 54 | /** @var INode $node */ |
55 | 55 | $node = $this->server->tree->getNodeForPath($uri); |
56 | 56 | |
57 | - switch(get_class($node)) { |
|
57 | + switch (get_class($node)) { |
|
58 | 58 | case 'OCA\DAV\CardDAV\AddressBook': |
59 | 59 | $type = 'Addressbook'; |
60 | 60 | break; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function propFind(PropFind $propFind, INode $node) { |
78 | 78 | // If the node is neither readable nor writable then fail unless its of |
79 | 79 | // the standard user-principal |
80 | - if(!($node instanceof User)) { |
|
80 | + if (!($node instanceof User)) { |
|
81 | 81 | $path = $propFind->getPath(); |
82 | 82 | $readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false); |
83 | 83 | $writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false); |
@@ -60,9 +60,9 @@ |
||
60 | 60 | |
61 | 61 | public function propFind(PropFind $propFind, INode $node) { |
62 | 62 | /* Overload current-user-principal */ |
63 | - $propFind->handle('{DAV:}current-user-principal', function () { |
|
63 | + $propFind->handle('{DAV:}current-user-principal', function() { |
|
64 | 64 | if ($url = parent::getCurrentUserPrincipal()) { |
65 | - return new Principal(Principal::HREF, $url . '/'); |
|
65 | + return new Principal(Principal::HREF, $url.'/'); |
|
66 | 66 | } else { |
67 | 67 | return new Principal(Principal::UNAUTHENTICATED); |
68 | 68 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $dispatcher = $this->getContainer()->getServer()->getEventDispatcher(); |
71 | 71 | |
72 | 72 | // first time login event setup |
73 | - $dispatcher->addListener(IUser::class . '::firstLogin', function ($event) use ($hm) { |
|
73 | + $dispatcher->addListener(IUser::class.'::firstLogin', function($event) use ($hm) { |
|
74 | 74 | if ($event instanceof GenericEvent) { |
75 | 75 | $hm->firstLogin($event->getSubject()); |
76 | 76 | } |