@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | throw new \RuntimeException("No app with given id <$appId> known."); |
36 | 36 | } |
37 | 37 | |
38 | - if (!is_dir($appPath . '/l10n/')) { |
|
38 | + if (!is_dir($appPath.'/l10n/')) { |
|
39 | 39 | return []; |
40 | 40 | } |
41 | 41 | |
42 | 42 | $errors = []; |
43 | - $directory = new \DirectoryIterator($appPath . '/l10n/'); |
|
43 | + $directory = new \DirectoryIterator($appPath.'/l10n/'); |
|
44 | 44 | |
45 | 45 | foreach ($directory as $file) { |
46 | 46 | if ($file->getExtension() !== 'json') { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | json_decode($content, true); |
52 | 52 | |
53 | 53 | if (json_last_error() !== JSON_ERROR_NONE) { |
54 | - $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); |
|
54 | + $errors[] = 'Invalid language file found: l10n/'.$file->getFilename().': '.json_last_error_msg(); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $json = file_get_contents('php://stdin'); |
113 | 113 | } else { |
114 | 114 | if (!file_exists($path)) { |
115 | - $output->writeln('<error>File not found: ' . $path . '</error>'); |
|
115 | + $output->writeln('<error>File not found: '.$path.'</error>'); |
|
116 | 116 | return 1; |
117 | 117 | } |
118 | 118 | $json = file_get_contents($path); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $existingMount->getApplicableUsers() === $mount->getApplicableUsers() && |
165 | 165 | $existingMount->getBackendOptions() === $mount->getBackendOptions() |
166 | 166 | ) { |
167 | - $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>"); |
|
167 | + $output->writeln("<error>Duplicate mount (".$mount->getMountPoint().")</error>"); |
|
168 | 168 | return 1; |
169 | 169 | } |
170 | 170 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | $query = $this->connection->getQueryBuilder(); |
70 | 70 | $query->update('share') |
71 | - ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
71 | + ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
72 | 72 | ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_EMAIL))); |
73 | 73 | $query->execute(); |
74 | 74 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | private function setupUserFs($userId) { |
56 | 56 | \OC_Util::setupFS($userId); |
57 | 57 | $this->session->close(); |
58 | - return $this->principalPrefix . $userId; |
|
58 | + return $this->principalPrefix.$userId; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | public function validateBearerToken($bearerToken) { |
65 | 65 | \OC_Util::setupFS(); |
66 | 66 | |
67 | - if(!$this->userSession->isLoggedIn()) { |
|
67 | + if (!$this->userSession->isLoggedIn()) { |
|
68 | 68 | $this->userSession->tryTokenLogin($this->request); |
69 | 69 | } |
70 | - if($this->userSession->isLoggedIn()) { |
|
70 | + if ($this->userSession->isLoggedIn()) { |
|
71 | 71 | return $this->setupUserFs($this->userSession->getUser()->getUID()); |
72 | 72 | } |
73 | 73 |
@@ -71,26 +71,26 @@ |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $app = substr($script, 0, strpos($script, '/')); |
74 | - $script = substr($script, strpos($script, '/')+1); |
|
74 | + $script = substr($script, strpos($script, '/') + 1); |
|
75 | 75 | $app_path = \OC_App::getAppPath($app); |
76 | 76 | $app_url = \OC_App::getAppWebPath($app); |
77 | 77 | |
78 | 78 | // missing translations files fill be ignored |
79 | 79 | if (strpos($script, 'l10n/') === 0) { |
80 | - $this->appendIfExist($app_path, $script . '.js', $app_url); |
|
80 | + $this->appendIfExist($app_path, $script.'.js', $app_url); |
|
81 | 81 | return; |
82 | 82 | } |
83 | 83 | |
84 | 84 | if ($app_path === false && $app_url === false) { |
85 | 85 | $this->logger->error('Could not find resource {resource} to load', [ |
86 | - 'resource' => $app . '/' . $script . '.js', |
|
86 | + 'resource' => $app.'/'.$script.'.js', |
|
87 | 87 | 'app' => 'jsresourceloader', |
88 | 88 | ]); |
89 | 89 | return; |
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { |
93 | - $this->append($app_path, $script . '.js', $app_url); |
|
93 | + $this->append($app_path, $script.'.js', $app_url); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | |
68 | 68 | $isMasterKeyEnabled = $this->util->isMasterKeyEnabled(); |
69 | 69 | |
70 | - if(!$isMasterKeyEnabled) { |
|
70 | + if (!$isMasterKeyEnabled) { |
|
71 | 71 | $output->writeln('Master key already disabled'); |
72 | 72 | } else { |
73 | 73 | $question = new ConfirmationQuestion( |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $olderVersions = $ms->getMigratedVersions(); |
79 | 79 | $olderVersions[] = '0'; |
80 | 80 | $olderVersions[] = 'prev'; |
81 | - if (in_array($version, $olderVersions, true)) { |
|
81 | + if (in_array($version, $olderVersions, true)) { |
|
82 | 82 | $output->writeln('<error>Can not go back to previous migration without debug enabled</error>'); |
83 | 83 | return 1; |
84 | 84 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @throws \Doctrine\DBAL\Schema\SchemaException |
81 | 81 | */ |
82 | 82 | public function getTable($tableName) { |
83 | - return $this->schema->getTable($this->connection->getPrefix() . $tableName); |
|
83 | + return $this->schema->getTable($this->connection->getPrefix().$tableName); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return boolean |
92 | 92 | */ |
93 | 93 | public function hasTable($tableName) { |
94 | - return $this->schema->hasTable($this->connection->getPrefix() . $tableName); |
|
94 | + return $this->schema->hasTable($this->connection->getPrefix().$tableName); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return \Doctrine\DBAL\Schema\Table |
102 | 102 | */ |
103 | 103 | public function createTable($tableName) { |
104 | - return $this->schema->createTable($this->connection->getPrefix() . $tableName); |
|
104 | + return $this->schema->createTable($this->connection->getPrefix().$tableName); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function dropTable($tableName) { |
127 | 127 | $this->tablesToDelete[$tableName] = true; |
128 | - return $this->schema->dropTable($this->connection->getPrefix() . $tableName); |
|
128 | + return $this->schema->dropTable($this->connection->getPrefix().$tableName); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->config = $config; |
97 | 97 | |
98 | 98 | $this->excludedPaths[] = 'files_encryption'; |
99 | - $this->excludedPaths[] = 'appdata_' . $config->getSystemValue('instanceid', null); |
|
99 | + $this->excludedPaths[] = 'appdata_'.$config->getSystemValue('instanceid', null); |
|
100 | 100 | $this->excludedPaths[] = 'files_external'; |
101 | 101 | } |
102 | 102 | |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | * @throws EncryptionHeaderKeyExistsException if header key is already in use |
137 | 137 | */ |
138 | 138 | public function createHeader(array $headerData, IEncryptionModule $encryptionModule) { |
139 | - $header = self::HEADER_START . ':' . self::HEADER_ENCRYPTION_MODULE_KEY . ':' . $encryptionModule->getId() . ':'; |
|
139 | + $header = self::HEADER_START.':'.self::HEADER_ENCRYPTION_MODULE_KEY.':'.$encryptionModule->getId().':'; |
|
140 | 140 | foreach ($headerData as $key => $value) { |
141 | 141 | if (in_array($key, $this->ocHeaderKeys)) { |
142 | 142 | throw new EncryptionHeaderKeyExistsException($key); |
143 | 143 | } |
144 | - $header .= $key . ':' . $value . ':'; |
|
144 | + $header .= $key.':'.$value.':'; |
|
145 | 145 | } |
146 | 146 | $header .= self::HEADER_END; |
147 | 147 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($c->getType() === 'dir') { |
173 | 173 | $dirList[] = $c->getPath(); |
174 | 174 | } else { |
175 | - $result[] = $c->getPath(); |
|
175 | + $result[] = $c->getPath(); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
@@ -249,15 +249,15 @@ discard block |
||
249 | 249 | public function stripPartialFileExtension($path) { |
250 | 250 | $extension = pathinfo($path, PATHINFO_EXTENSION); |
251 | 251 | |
252 | - if ( $extension === 'part') { |
|
252 | + if ($extension === 'part') { |
|
253 | 253 | |
254 | 254 | $newLength = strlen($path) - 5; // 5 = strlen(".part") |
255 | 255 | $fPath = substr($path, 0, $newLength); |
256 | 256 | |
257 | 257 | // if path also contains a transaction id, we remove it too |
258 | 258 | $extension = pathinfo($fPath, PATHINFO_EXTENSION); |
259 | - if(substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") |
|
260 | - $newLength = strlen($fPath) - strlen($extension) -1; |
|
259 | + if (substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") |
|
260 | + $newLength = strlen($fPath) - strlen($extension) - 1; |
|
261 | 261 | $fPath = substr($fPath, 0, $newLength); |
262 | 262 | } |
263 | 263 | return $fPath; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | if (\OCP\App::isEnabled("files_external")) { |
302 | 302 | $mounts = \OC_Mount_Config::getSystemMountPoints(); |
303 | 303 | foreach ($mounts as $mount) { |
304 | - if (strpos($path, '/files/' . $mount['mountpoint']) === 0) { |
|
304 | + if (strpos($path, '/files/'.$mount['mountpoint']) === 0) { |
|
305 | 305 | if ($this->isMountPointApplicableToUser($mount, $uid)) { |
306 | 306 | return true; |
307 | 307 | } |