@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | if ($this->config->getSystemValue('installed', false)) { |
| 74 | 74 | $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath(null)); |
| 75 | 75 | } else { |
| 76 | - $this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'); |
|
| 76 | + $this->client->setDefaultOption('verify', \OC::$SERVERROOT.'/resources/config/ca-bundle.crt'); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $proxyUri = ''; |
| 96 | 96 | |
| 97 | 97 | if ($proxyUserPwd !== null) { |
| 98 | - $proxyUri .= $proxyUserPwd . '@'; |
|
| 98 | + $proxyUri .= $proxyUserPwd.'@'; |
|
| 99 | 99 | } |
| 100 | 100 | if ($proxyHost !== null) { |
| 101 | 101 | $proxyUri .= $proxyHost; |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | // FIXME: Required for CI |
| 82 | 82 | if (!defined('PHPUNIT_RUN')) { |
| 83 | 83 | $webRoot = \OC::$WEBROOT; |
| 84 | - if($webRoot === '') { |
|
| 84 | + if ($webRoot === '') { |
|
| 85 | 85 | $webRoot = '/'; |
| 86 | 86 | } |
| 87 | 87 | setcookie(self::COOKIE_NAME, $this->passphrase, 0, $webRoot, '', $secureCookie, true); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * the comments database scheme |
| 52 | 52 | */ |
| 53 | 53 | public function __construct(array $data = null) { |
| 54 | - if(is_array($data)) { |
|
| 54 | + if (is_array($data)) { |
|
| 55 | 55 | $this->fromArray($data); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -84,12 +84,12 @@ discard block |
||
| 84 | 84 | * @since 9.0.0 |
| 85 | 85 | */ |
| 86 | 86 | public function setId($id) { |
| 87 | - if(!is_string($id)) { |
|
| 87 | + if (!is_string($id)) { |
|
| 88 | 88 | throw new \InvalidArgumentException('String expected.'); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $id = trim($id); |
| 92 | - if($this->data['id'] === '' || ($this->data['id'] !== '' && $id === '')) { |
|
| 92 | + if ($this->data['id'] === '' || ($this->data['id'] !== '' && $id === '')) { |
|
| 93 | 93 | $this->data['id'] = $id; |
| 94 | 94 | return $this; |
| 95 | 95 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @since 9.0.0 |
| 116 | 116 | */ |
| 117 | 117 | public function setParentId($parentId) { |
| 118 | - if(!is_string($parentId)) { |
|
| 118 | + if (!is_string($parentId)) { |
|
| 119 | 119 | throw new \InvalidArgumentException('String expected.'); |
| 120 | 120 | } |
| 121 | 121 | $this->data['parentId'] = trim($parentId); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @since 9.0.0 |
| 142 | 142 | */ |
| 143 | 143 | public function setTopmostParentId($id) { |
| 144 | - if(!is_string($id)) { |
|
| 144 | + if (!is_string($id)) { |
|
| 145 | 145 | throw new \InvalidArgumentException('String expected.'); |
| 146 | 146 | } |
| 147 | 147 | $this->data['topmostParentId'] = trim($id); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @since 9.0.0 |
| 167 | 167 | */ |
| 168 | 168 | public function setChildrenCount($count) { |
| 169 | - if(!is_int($count)) { |
|
| 169 | + if (!is_int($count)) { |
|
| 170 | 170 | throw new \InvalidArgumentException('Integer expected.'); |
| 171 | 171 | } |
| 172 | 172 | $this->data['childrenCount'] = $count; |
@@ -192,12 +192,12 @@ discard block |
||
| 192 | 192 | * @since 9.0.0 |
| 193 | 193 | */ |
| 194 | 194 | public function setMessage($message) { |
| 195 | - if(!is_string($message)) { |
|
| 195 | + if (!is_string($message)) { |
|
| 196 | 196 | throw new \InvalidArgumentException('String expected.'); |
| 197 | 197 | } |
| 198 | 198 | $message = trim($message); |
| 199 | - if(mb_strlen($message, 'UTF-8') > IComment::MAX_MESSAGE_LENGTH) { |
|
| 200 | - throw new MessageTooLongException('Comment message must not exceed ' . IComment::MAX_MESSAGE_LENGTH . ' characters'); |
|
| 199 | + if (mb_strlen($message, 'UTF-8') > IComment::MAX_MESSAGE_LENGTH) { |
|
| 200 | + throw new MessageTooLongException('Comment message must not exceed '.IComment::MAX_MESSAGE_LENGTH.' characters'); |
|
| 201 | 201 | } |
| 202 | 202 | $this->data['message'] = $message; |
| 203 | 203 | return $this; |
@@ -225,14 +225,14 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function getMentions() { |
| 227 | 227 | $ok = preg_match_all('/\B@[a-z0-9_\-@\.\']+/i', $this->getMessage(), $mentions); |
| 228 | - if(!$ok || !isset($mentions[0]) || !is_array($mentions[0])) { |
|
| 228 | + if (!$ok || !isset($mentions[0]) || !is_array($mentions[0])) { |
|
| 229 | 229 | return []; |
| 230 | 230 | } |
| 231 | 231 | $uids = array_unique($mentions[0]); |
| 232 | 232 | $result = []; |
| 233 | 233 | foreach ($uids as $uid) { |
| 234 | 234 | // exclude author, no self-mentioning |
| 235 | - if($uid === '@' . $this->getActorId()) { |
|
| 235 | + if ($uid === '@'.$this->getActorId()) { |
|
| 236 | 236 | continue; |
| 237 | 237 | } |
| 238 | 238 | $result[] = ['type' => 'user', 'id' => substr($uid, 1)]; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * @since 9.0.0 |
| 259 | 259 | */ |
| 260 | 260 | public function setVerb($verb) { |
| 261 | - if(!is_string($verb) || !trim($verb)) { |
|
| 261 | + if (!is_string($verb) || !trim($verb)) { |
|
| 262 | 262 | throw new \InvalidArgumentException('Non-empty String expected.'); |
| 263 | 263 | } |
| 264 | 264 | $this->data['verb'] = trim($verb); |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | * @since 9.0.0 |
| 295 | 295 | */ |
| 296 | 296 | public function setActor($actorType, $actorId) { |
| 297 | - if( |
|
| 297 | + if ( |
|
| 298 | 298 | !is_string($actorType) || !trim($actorType) |
| 299 | - || !is_string($actorId) || !trim($actorId) |
|
| 299 | + || !is_string($actorId) || !trim($actorId) |
|
| 300 | 300 | ) { |
| 301 | 301 | throw new \InvalidArgumentException('String expected.'); |
| 302 | 302 | } |
@@ -380,9 +380,9 @@ discard block |
||
| 380 | 380 | * @since 9.0.0 |
| 381 | 381 | */ |
| 382 | 382 | public function setObject($objectType, $objectId) { |
| 383 | - if( |
|
| 383 | + if ( |
|
| 384 | 384 | !is_string($objectType) || !trim($objectType) |
| 385 | - || !is_string($objectId) || !trim($objectId) |
|
| 385 | + || !is_string($objectId) || !trim($objectId) |
|
| 386 | 386 | ) { |
| 387 | 387 | throw new \InvalidArgumentException('String expected.'); |
| 388 | 388 | } |
@@ -399,20 +399,20 @@ discard block |
||
| 399 | 399 | * @return IComment |
| 400 | 400 | */ |
| 401 | 401 | protected function fromArray($data) { |
| 402 | - foreach(array_keys($data) as $key) { |
|
| 402 | + foreach (array_keys($data) as $key) { |
|
| 403 | 403 | // translate DB keys to internal setter names |
| 404 | - $setter = 'set' . implode('', array_map('ucfirst', explode('_', $key))); |
|
| 404 | + $setter = 'set'.implode('', array_map('ucfirst', explode('_', $key))); |
|
| 405 | 405 | $setter = str_replace('Timestamp', 'DateTime', $setter); |
| 406 | 406 | |
| 407 | - if(method_exists($this, $setter)) { |
|
| 407 | + if (method_exists($this, $setter)) { |
|
| 408 | 408 | $this->$setter($data[$key]); |
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | - foreach(['actor', 'object'] as $role) { |
|
| 413 | - if(isset($data[$role . '_type']) && isset($data[$role . '_id'])) { |
|
| 414 | - $setter = 'set' . ucfirst($role); |
|
| 415 | - $this->$setter($data[$role . '_type'], $data[$role . '_id']); |
|
| 412 | + foreach (['actor', 'object'] as $role) { |
|
| 413 | + if (isset($data[$role.'_type']) && isset($data[$role.'_id'])) { |
|
| 414 | + $setter = 'set'.ucfirst($role); |
|
| 415 | + $this->$setter($data[$role.'_type'], $data[$role.'_id']); |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | throw new \InvalidArgumentException('The given notifier information is invalid'); |
| 147 | 147 | } |
| 148 | 148 | if (isset($this->notifiersInfo[$notifier['id']])) { |
| 149 | - throw new \InvalidArgumentException('The given notifier ID ' . $notifier['id'] . ' is already in use'); |
|
| 149 | + throw new \InvalidArgumentException('The given notifier ID '.$notifier['id'].' is already in use'); |
|
| 150 | 150 | } |
| 151 | 151 | $this->notifiersInfo[$notifier['id']] = $notifier['name']; |
| 152 | 152 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * @return bool |
| 49 | 49 | */ |
| 50 | 50 | public function accept() { |
| 51 | - if($this->isDir()) { |
|
| 51 | + if ($this->isDir()) { |
|
| 52 | 52 | return true; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -30,25 +30,25 @@ |
||
| 30 | 30 | parent::__construct($iterator); |
| 31 | 31 | |
| 32 | 32 | $appFolders = \OC::$APPSROOTS; |
| 33 | - foreach($appFolders as $key => $appFolder) { |
|
| 33 | + foreach ($appFolders as $key => $appFolder) { |
|
| 34 | 34 | $appFolders[$key] = rtrim($appFolder['path'], '/'); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $excludedFolders = [ |
| 38 | - rtrim($root . '/data', '/'), |
|
| 39 | - rtrim($root . '/themes', '/'), |
|
| 40 | - rtrim($root . '/config', '/'), |
|
| 41 | - rtrim($root . '/apps', '/'), |
|
| 42 | - rtrim($root . '/assets', '/'), |
|
| 43 | - rtrim($root . '/lost+found', '/'), |
|
| 38 | + rtrim($root.'/data', '/'), |
|
| 39 | + rtrim($root.'/themes', '/'), |
|
| 40 | + rtrim($root.'/config', '/'), |
|
| 41 | + rtrim($root.'/apps', '/'), |
|
| 42 | + rtrim($root.'/assets', '/'), |
|
| 43 | + rtrim($root.'/lost+found', '/'), |
|
| 44 | 44 | // Ignore folders generated by updater since the updater is replaced |
| 45 | 45 | // after the integrity check is run. |
| 46 | 46 | // See https://github.com/owncloud/updater/issues/318#issuecomment-212497846 |
| 47 | - rtrim($root . '/updater', '/'), |
|
| 48 | - rtrim($root . '/_oc_upgrade', '/'), |
|
| 47 | + rtrim($root.'/updater', '/'), |
|
| 48 | + rtrim($root.'/_oc_upgrade', '/'), |
|
| 49 | 49 | ]; |
| 50 | 50 | $customDataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', ''); |
| 51 | - if($customDataDir !== '') { |
|
| 51 | + if ($customDataDir !== '') { |
|
| 52 | 52 | $excludedFolders[] = rtrim($customDataDir, '/'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function file_put_contents($filename, $data) { |
| 61 | 61 | $bytesWritten = @file_put_contents($filename, $data); |
| 62 | - if ($bytesWritten === false || $bytesWritten !== strlen($data)){ |
|
| 63 | - throw new \Exception('Failed to write into ' . $filename); |
|
| 62 | + if ($bytesWritten === false || $bytesWritten !== strlen($data)) { |
|
| 63 | + throw new \Exception('Failed to write into '.$filename); |
|
| 64 | 64 | } |
| 65 | 65 | return $bytesWritten; |
| 66 | 66 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function assertDirectoryExists($path) { |
| 81 | 81 | if (!is_dir($path)) { |
| 82 | - throw new \Exception('Directory ' . $path . ' does not exist.'); |
|
| 82 | + throw new \Exception('Directory '.$path.' does not exist.'); |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function getAppPath($appId) { |
| 41 | 41 | $path = \OC_App::getAppPath($appId); |
| 42 | - if($path === false) { |
|
| 42 | + if ($path === false) { |
|
| 43 | 43 | |
| 44 | 44 | throw new \Exception('App not found'); |
| 45 | 45 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * @return string |
| 62 | 62 | */ |
| 63 | 63 | public function __toString() { |
| 64 | - return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
| 64 | + return __CLASS__.": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |