@@ -44,7 +44,7 @@ |
||
44 | 44 | * @param string $value |
45 | 45 | * @return bool |
46 | 46 | */ |
47 | - public function executeCheck($operator, $value) { |
|
47 | + public function executeCheck($operator, $value) { |
|
48 | 48 | $actualValue = $this->getActualValue(); |
49 | 49 | if (in_array($operator, ['is', '!is'])) { |
50 | 50 | switch ($value) { |
@@ -323,7 +323,7 @@ |
||
323 | 323 | * @return int Check unique ID |
324 | 324 | */ |
325 | 325 | protected function addCheck($class, $operator, $value) { |
326 | - $hash = md5($class . '::' . $operator . '::' . $value); |
|
326 | + $hash = md5($class.'::'.$operator.'::'.$value); |
|
327 | 327 | |
328 | 328 | $query = $this->connection->getQueryBuilder(); |
329 | 329 | $query->select('id') |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $node = \OC::$server->getRootFolder() |
88 | 88 | ->getUserFolder($parameters['user']) |
89 | 89 | ->get($this->request->getParam('path')); |
90 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
90 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | try { |
122 | 122 | $lockingProvider->acquireLock($path, $type); |
123 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
123 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
124 | 124 | return new \OC_OCS_Result(null, 100); |
125 | 125 | } catch (LockedException $e) { |
126 | 126 | return new \OC_OCS_Result(null, Http::STATUS_LOCKED); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | try { |
147 | 147 | $lockingProvider->changeLock($path, $type); |
148 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
148 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
149 | 149 | return new \OC_OCS_Result(null, 100); |
150 | 150 | } catch (LockedException $e) { |
151 | 151 | return new \OC_OCS_Result(null, Http::STATUS_LOCKED); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | try { |
172 | 172 | $lockingProvider->releaseLock($path, $type); |
173 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
173 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
174 | 174 | return new \OC_OCS_Result(null, 100); |
175 | 175 | } catch (LockedException $e) { |
176 | 176 | return new \OC_OCS_Result(null, Http::STATUS_LOCKED); |
@@ -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 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | if ($uid !== 'admin') { |
49 | 49 | $uid = md5($uid); |
50 | 50 | } |
51 | - return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid; |
|
51 | + return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return false; |
@@ -184,12 +184,12 @@ |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | try { |
187 | - $this->getDisplayNameFromContact($user . '@http://' . $server); |
|
187 | + $this->getDisplayNameFromContact($user.'@http://'.$server); |
|
188 | 188 | } catch (\OutOfBoundsException $e) { |
189 | 189 | } |
190 | 190 | |
191 | 191 | try { |
192 | - $this->getDisplayNameFromContact($user . '@https://' . $server); |
|
192 | + $this->getDisplayNameFromContact($user.'@https://'.$server); |
|
193 | 193 | } catch (\OutOfBoundsException $e) { |
194 | 194 | } |
195 | 195 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $token = $argument['token']; |
106 | 106 | $action = $argument['action']; |
107 | 107 | $data = json_decode($argument['data'], true); |
108 | - $try = (int)$argument['try'] + 1; |
|
108 | + $try = (int) $argument['try'] + 1; |
|
109 | 109 | |
110 | 110 | $result = $this->notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try); |
111 | 111 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'token' => $argument['token'], |
129 | 129 | 'data' => $argument['data'], |
130 | 130 | 'action' => $argument['action'], |
131 | - 'try' => (int)$argument['try'] + 1, |
|
131 | + 'try' => (int) $argument['try'] + 1, |
|
132 | 132 | 'lastRun' => time() |
133 | 133 | ] |
134 | 134 | ); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @return bool |
142 | 142 | */ |
143 | 143 | protected function shouldRun(array $argument) { |
144 | - $lastRun = (int)$argument['lastRun']; |
|
144 | + $lastRun = (int) $argument['lastRun']; |
|
145 | 145 | return ((time() - $lastRun) > $this->interval); |
146 | 146 | } |
147 | 147 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | public function generateToken() { |
56 | 56 | $token = $this->secureRandom->generate( |
57 | 57 | self::TOKEN_LENGTH, |
58 | - ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
58 | + ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
59 | 59 | return $token; |
60 | 60 | } |
61 | 61 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @package OCA\Federation\Controller |
46 | 46 | */ |
47 | -class OCSAuthAPIController extends OCSController{ |
|
47 | +class OCSAuthAPIController extends OCSController { |
|
48 | 48 | |
49 | 49 | /** @var ISecureRandom */ |
50 | 50 | private $secureRandom; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function requestSharedSecret($url, $token) { |
105 | 105 | if ($this->trustedServers->isTrustedServer($url) === false) { |
106 | - $this->logger->error('remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']); |
|
106 | + $this->logger->error('remote server not trusted ('.$url.') while requesting shared secret', ['app' => 'federation']); |
|
107 | 107 | throw new OCSForbiddenException(); |
108 | 108 | } |
109 | 109 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $localToken = $this->dbHandler->getToken($url); |
113 | 113 | if (strcmp($localToken, $token) > 0) { |
114 | 114 | $this->logger->info( |
115 | - 'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.', |
|
115 | + 'remote server ('.$url.') presented lower token. We will initiate the exchange of the shared secret.', |
|
116 | 116 | ['app' => 'federation'] |
117 | 117 | ); |
118 | 118 | throw new OCSForbiddenException(); |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getSharedSecret($url, $token) { |
153 | 153 | if ($this->trustedServers->isTrustedServer($url) === false) { |
154 | - $this->logger->error('remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']); |
|
154 | + $this->logger->error('remote server not trusted ('.$url.') while getting shared secret', ['app' => 'federation']); |
|
155 | 155 | throw new OCSForbiddenException(); |
156 | 156 | } |
157 | 157 | |
158 | 158 | if ($this->isValidToken($url, $token) === false) { |
159 | 159 | $expectedToken = $this->dbHandler->getToken($url); |
160 | 160 | $this->logger->error( |
161 | - 'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret', |
|
161 | + 'remote server ('.$url.') didn\'t send a valid token (got "'.$token.'" but expected "'.$expectedToken.'") while getting shared secret', |
|
162 | 162 | ['app' => 'federation'] |
163 | 163 | ); |
164 | 164 | throw new OCSForbiddenException(); |