@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | public function getId() { |
61 | - return (int)$this->data['fileid']; |
|
61 | + return (int) $this->data['fileid']; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | public function getStorageId() { |
@@ -51,8 +51,8 @@ |
||
51 | 51 | } |
52 | 52 | if ($entry && $entry['mimetype'] === 'httpd/unix-directory') { |
53 | 53 | $id = $entry['fileid']; |
54 | - $sql = 'SELECT SUM(`size`) AS f1 ' . |
|
55 | - 'FROM `*PREFIX*filecache` ' . |
|
54 | + $sql = 'SELECT SUM(`size`) AS f1 '. |
|
55 | + 'FROM `*PREFIX*filecache` '. |
|
56 | 56 | 'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0'; |
57 | 57 | $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); |
58 | 58 | if ($row = $result->fetchRow()) { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | if ($sourceEntry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE) { |
68 | 68 | $folderContent = $sourceCache->getFolderContentsById($sourceEntry->getId()); |
69 | 69 | foreach ($folderContent as $subEntry) { |
70 | - $subTargetPath = $targetPath . '/' . $subEntry->getName(); |
|
70 | + $subTargetPath = $targetPath.'/'.$subEntry->getName(); |
|
71 | 71 | $this->copyFromCache($sourceCache, $subEntry, $subTargetPath); |
72 | 72 | } |
73 | 73 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | $query = $this->connection->prepare('SELECT `lock` from `*PREFIX*file_locks` WHERE `key` = ?'); |
138 | 138 | $query->execute([$path]); |
139 | - $lockValue = (int)$query->fetchColumn(); |
|
139 | + $lockValue = (int) $query->fetchColumn(); |
|
140 | 140 | if ($type === self::LOCK_SHARED) { |
141 | 141 | if ($this->isLocallyLocked($path)) { |
142 | 142 | // if we have a shared lock we kept open locally but it's released we always have at least 1 shared lock in the db |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | // since we keep shared locks we need to manually clean those |
263 | 263 | $lockedPaths = array_keys($this->sharedLocks); |
264 | - $lockedPaths = array_filter($lockedPaths, function ($path) { |
|
264 | + $lockedPaths = array_filter($lockedPaths, function($path) { |
|
265 | 265 | return $this->sharedLocks[$path]; |
266 | 266 | }); |
267 | 267 |
@@ -51,19 +51,19 @@ |
||
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | // create audio result |
54 | - if($fileData['mimepart'] === 'audio'){ |
|
54 | + if ($fileData['mimepart'] === 'audio') { |
|
55 | 55 | $result = new \OC\Search\Result\Audio($fileData); |
56 | 56 | } |
57 | 57 | // create image result |
58 | - elseif($fileData['mimepart'] === 'image'){ |
|
58 | + elseif ($fileData['mimepart'] === 'image') { |
|
59 | 59 | $result = new \OC\Search\Result\Image($fileData); |
60 | 60 | } |
61 | 61 | // create folder result |
62 | - elseif($fileData['mimetype'] === 'httpd/unix-directory'){ |
|
62 | + elseif ($fileData['mimetype'] === 'httpd/unix-directory') { |
|
63 | 63 | $result = new \OC\Search\Result\Folder($fileData); |
64 | 64 | } |
65 | 65 | // or create file result |
66 | - else{ |
|
66 | + else { |
|
67 | 67 | $result = new \OC\Search\Result\File($fileData); |
68 | 68 | } |
69 | 69 | // add to results |
@@ -105,7 +105,7 @@ |
||
105 | 105 | * @param string $path |
106 | 106 | * @return string relative path |
107 | 107 | */ |
108 | - protected function getRelativePath ($path) { |
|
108 | + protected function getRelativePath($path) { |
|
109 | 109 | if (!isset(self::$userFolderCache)) { |
110 | 110 | $user = \OC::$server->getUserSession()->getUser()->getUID(); |
111 | 111 | self::$userFolderCache = \OC::$server->getUserFolder($user); |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | * @throws QueryException if the class could not be found or instantiated |
90 | 90 | */ |
91 | 91 | public function resolve($name) { |
92 | - $baseMsg = 'Could not resolve ' . $name . '!'; |
|
92 | + $baseMsg = 'Could not resolve '.$name.'!'; |
|
93 | 93 | try { |
94 | 94 | $class = new ReflectionClass($name); |
95 | 95 | if ($class->isInstantiable()) { |
96 | 96 | return $this->buildClass($class); |
97 | 97 | } else { |
98 | - throw new QueryException($baseMsg . |
|
98 | + throw new QueryException($baseMsg. |
|
99 | 99 | ' Class can not be instantiated'); |
100 | 100 | } |
101 | - } catch(ReflectionException $e) { |
|
102 | - throw new QueryException($baseMsg . ' ' . $e->getMessage()); |
|
101 | + } catch (ReflectionException $e) { |
|
102 | + throw new QueryException($baseMsg.' '.$e->getMessage()); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return $this->offsetGet($name); |
116 | 116 | } else { |
117 | 117 | $object = $this->resolve($name); |
118 | - $this->registerService($name, function () use ($object) { |
|
118 | + $this->registerService($name, function() use ($object) { |
|
119 | 119 | return $object; |
120 | 120 | }); |
121 | 121 | return $object; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function registerService($name, Closure $closure, $shared = true) { |
143 | 143 | $name = $this->sanitizeName($name); |
144 | - if (isset($this[$name])) { |
|
144 | + if (isset($this[$name])) { |
|
145 | 145 | unset($this[$name]); |
146 | 146 | } |
147 | 147 | if ($shared) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param string $target the target that should be resolved instead |
160 | 160 | */ |
161 | 161 | public function registerAlias($alias, $target) { |
162 | - $this->registerService($alias, function (IContainer $container) use ($target) { |
|
162 | + $this->registerService($alias, function(IContainer $container) use ($target) { |
|
163 | 163 | return $container->query($target); |
164 | 164 | }, false); |
165 | 165 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | * @param bool $httpOnly |
93 | 93 | */ |
94 | 94 | public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly) { |
95 | - $path = $this->webRoot ? : '/'; |
|
95 | + $path = $this->webRoot ?: '/'; |
|
96 | 96 | setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly); |
97 | 97 | } |
98 | 98 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | // exception and creates a response. If no response is created, it is |
94 | 94 | // assumed that theres no middleware who can handle it and the error is |
95 | 95 | // thrown again |
96 | - } catch(\Exception $exception){ |
|
96 | + } catch (\Exception $exception) { |
|
97 | 97 | $response = $this->middlewareDispatcher->afterException( |
98 | 98 | $controller, $methodName, $exception); |
99 | 99 | if (is_null($response)) { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | // valid types that will be casted |
132 | 132 | $types = array('int', 'integer', 'bool', 'boolean', 'float'); |
133 | 133 | |
134 | - foreach($this->reflector->getParameters() as $param => $default) { |
|
134 | + foreach ($this->reflector->getParameters() as $param => $default) { |
|
135 | 135 | |
136 | 136 | // try to get the parameter from the request object and cast |
137 | 137 | // it to the type annotated in the @param annotation |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | // if this is submitted using GET or a POST form, 'false' should be |
142 | 142 | // converted to false |
143 | - if(($type === 'bool' || $type === 'boolean') && |
|
143 | + if (($type === 'bool' || $type === 'boolean') && |
|
144 | 144 | $value === 'false' && |
145 | 145 | ( |
146 | 146 | $this->request->method === 'GET' || |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | ) { |
151 | 151 | $value = false; |
152 | 152 | |
153 | - } elseif($value !== null && in_array($type, $types)) { |
|
153 | + } elseif ($value !== null && in_array($type, $types)) { |
|
154 | 154 | settype($value, $type); |
155 | 155 | } |
156 | 156 | |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | $response = call_user_func_array(array($controller, $methodName), $arguments); |
161 | 161 | |
162 | 162 | // format response |
163 | - if($response instanceof DataResponse || !($response instanceof Response)) { |
|
163 | + if ($response instanceof DataResponse || !($response instanceof Response)) { |
|
164 | 164 | |
165 | 165 | // get format from the url format or request format parameter |
166 | 166 | $format = $this->request->getParam('format'); |
167 | 167 | |
168 | 168 | // if none is given try the first Accept header |
169 | - if($format === null) { |
|
169 | + if ($format === null) { |
|
170 | 170 | $headers = $this->request->getHeader('Accept'); |
171 | 171 | $format = $controller->getResponderByHTTPHeader($headers, null); |
172 | 172 | } |