@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @since 16.0.0 |
127 | 127 | */ |
128 | 128 | public function addResource(IResource $resource): void { |
129 | - array_map(function (IResource $r) use ($resource) { |
|
129 | + array_map(function(IResource $r) use ($resource) { |
|
130 | 130 | if ($this->isSameResource($r, $resource)) { |
131 | 131 | throw new ResourceException('Already part of the collection'); |
132 | 132 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @since 16.0.0 |
159 | 159 | */ |
160 | 160 | public function removeResource(IResource $resource): void { |
161 | - $this->resources = array_filter($this->getResources(), function (IResource $r) use ($resource) { |
|
161 | + $this->resources = array_filter($this->getResources(), function(IResource $r) use ($resource) { |
|
162 | 162 | return !$this->isSameResource($r, $resource); |
163 | 163 | }); |
164 | 164 |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'label' => $user->getDisplayName(), |
108 | 108 | 'value' => [ |
109 | 109 | 'shareType' => IShare::TYPE_USER, |
110 | - 'shareWith' => (string)$user->getUID(), |
|
110 | + 'shareWith' => (string) $user->getUID(), |
|
111 | 111 | ], |
112 | 112 | ]; |
113 | 113 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | if ($this->shareWithGroupOnly) { |
164 | 164 | // Only add, if we have a common group |
165 | - $userGroupIds = array_map(function (IGroup $group) { |
|
165 | + $userGroupIds = array_map(function(IGroup $group) { |
|
166 | 166 | return $group->getGID(); |
167 | 167 | }, $userGroups); |
168 | 168 | $commonGroups = array_intersect($userGroupIds, $this->groupManager->getUserGroupIds($user)); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | public function takeOutCurrentUser(array &$users) { |
199 | 199 | $currentUser = $this->userSession->getUser(); |
200 | - if(!is_null($currentUser)) { |
|
200 | + if (!is_null($currentUser)) { |
|
201 | 201 | if (isset($users[$currentUser->getUID()])) { |
202 | 202 | unset($users[$currentUser->getUID()]); |
203 | 203 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @deprecated 14.0.0 |
56 | 56 | */ |
57 | 57 | static public function rmdirr($dir) { |
58 | - return \OC_Helper::rmdirr( $dir ); |
|
58 | + return \OC_Helper::rmdirr($dir); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @deprecated 14.0.0 |
91 | 91 | */ |
92 | 92 | public static function streamCopy($source, $target) { |
93 | - list($count, ) = \OC_Helper::streamCopy( $source, $target ); |
|
93 | + list($count,) = \OC_Helper::streamCopy($source, $target); |
|
94 | 94 | return $count; |
95 | 95 | } |
96 | 96 | |
@@ -115,6 +115,6 @@ discard block |
||
115 | 115 | * @deprecated 14.0.0 use IAppData instead |
116 | 116 | */ |
117 | 117 | public static function getStorage($app) { |
118 | - return \OC_App::getStorage( $app ); |
|
118 | + return \OC_App::getStorage($app); |
|
119 | 119 | } |
120 | 120 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * @since 15.0.0 |
39 | 39 | */ |
40 | 40 | public function __construct($property) { |
41 | - parent::__construct('Property ' . $property . ' does not exist.'); |
|
41 | + parent::__construct('Property '.$property.' does not exist.'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | } |
@@ -60,23 +60,23 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @deprecated 14.0.0 use \OCP\ILogger::DEBUG |
62 | 62 | */ |
63 | - const DEBUG=0; |
|
63 | + const DEBUG = 0; |
|
64 | 64 | /** |
65 | 65 | * @deprecated 14.0.0 use \OCP\ILogger::INFO |
66 | 66 | */ |
67 | - const INFO=1; |
|
67 | + const INFO = 1; |
|
68 | 68 | /** |
69 | 69 | * @deprecated 14.0.0 use \OCP\ILogger::WARN |
70 | 70 | */ |
71 | - const WARN=2; |
|
71 | + const WARN = 2; |
|
72 | 72 | /** |
73 | 73 | * @deprecated 14.0.0 use \OCP\ILogger::ERROR |
74 | 74 | */ |
75 | - const ERROR=3; |
|
75 | + const ERROR = 3; |
|
76 | 76 | /** |
77 | 77 | * @deprecated 14.0.0 use \OCP\ILogger::FATAL |
78 | 78 | */ |
79 | - const FATAL=4; |
|
79 | + const FATAL = 4; |
|
80 | 80 | |
81 | 81 | /** \OCP\Share\IManager */ |
82 | 82 | private static $shareManager; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @since 4.0.0 |
172 | 172 | */ |
173 | 173 | public static function addStyle($application, $file = null) { |
174 | - \OC_Util::addStyle( $application, $file ); |
|
174 | + \OC_Util::addStyle($application, $file); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * @since 4.0.0 |
182 | 182 | */ |
183 | 183 | public static function addScript($application, $file = null) { |
184 | - \OC_Util::addScript( $application, $file ); |
|
184 | + \OC_Util::addScript($application, $file); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @param string $text the text content for the element |
204 | 204 | * @since 4.0.0 |
205 | 205 | */ |
206 | - public static function addHeader($tag, $attributes, $text=null) { |
|
206 | + public static function addHeader($tag, $attributes, $text = null) { |
|
207 | 207 | \OC_Util::addHeader($tag, $attributes, $text); |
208 | 208 | } |
209 | 209 | |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public static function linkToRemote($service) { |
233 | 233 | $urlGenerator = \OC::$server->getURLGenerator(); |
234 | - $remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service; |
|
234 | + $remoteBase = $urlGenerator->linkTo('', 'remote.php').'/'.$service; |
|
235 | 235 | return $urlGenerator->getAbsoluteURL( |
236 | - $remoteBase . (($service[strlen($service) - 1] != '/') ? '/' : '') |
|
236 | + $remoteBase.(($service[strlen($service) - 1] != '/') ? '/' : '') |
|
237 | 237 | ); |
238 | 238 | } |
239 | 239 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | * @since 4.5.0 |
367 | 367 | */ |
368 | 368 | public static function callRegister() { |
369 | - if(self::$token === '') { |
|
369 | + if (self::$token === '') { |
|
370 | 370 | self::$token = \OC::$server->getCsrfTokenManager()->getToken()->getEncryptedValue(); |
371 | 371 | } |
372 | 372 | return self::$token; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | */ |
513 | 513 | public static function needUpgrade() { |
514 | 514 | if (!isset(self::$needUpgradeCache)) { |
515 | - self::$needUpgradeCache=\OC_Util::needUpgrade(\OC::$server->getSystemConfig()); |
|
515 | + self::$needUpgradeCache = \OC_Util::needUpgrade(\OC::$server->getSystemConfig()); |
|
516 | 516 | } |
517 | 517 | return self::$needUpgradeCache; |
518 | 518 | } |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function __construct($appName, |
61 | 61 | IRequest $request, |
62 | - $corsMethods='PUT, POST, GET, DELETE, PATCH', |
|
63 | - $corsAllowedHeaders='Authorization, Content-Type, Accept', |
|
64 | - $corsMaxAge=1728000) { |
|
62 | + $corsMethods = 'PUT, POST, GET, DELETE, PATCH', |
|
63 | + $corsAllowedHeaders = 'Authorization, Content-Type, Accept', |
|
64 | + $corsMaxAge = 1728000) { |
|
65 | 65 | parent::__construct($appName, $request); |
66 | 66 | $this->corsMethods = $corsMethods; |
67 | 67 | $this->corsAllowedHeaders = $corsAllowedHeaders; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @since 7.0.0 |
80 | 80 | */ |
81 | 81 | public function preflightedCors() { |
82 | - if(isset($this->request->server['HTTP_ORIGIN'])) { |
|
82 | + if (isset($this->request->server['HTTP_ORIGIN'])) { |
|
83 | 83 | $origin = $this->request->server['HTTP_ORIGIN']; |
84 | 84 | } else { |
85 | 85 | $origin = '*'; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $response = new Response(); |
89 | 89 | $response->addHeader('Access-Control-Allow-Origin', $origin); |
90 | 90 | $response->addHeader('Access-Control-Allow-Methods', $this->corsMethods); |
91 | - $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge); |
|
91 | + $response->addHeader('Access-Control-Max-Age', (string) $this->corsMaxAge); |
|
92 | 92 | $response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders); |
93 | 93 | $response->addHeader('Access-Control-Allow-Credentials', 'false'); |
94 | 94 | return $response; |
@@ -52,8 +52,8 @@ |
||
52 | 52 | * @param array $headers additional key value based headers |
53 | 53 | * @since 8.0.0 |
54 | 54 | */ |
55 | - public function __construct($data=[], $statusCode=Http::STATUS_OK, |
|
56 | - array $headers=[]) { |
|
55 | + public function __construct($data = [], $statusCode = Http::STATUS_OK, |
|
56 | + array $headers = []) { |
|
57 | 57 | parent::__construct(); |
58 | 58 | |
59 | 59 | $this->data = $data; |
@@ -47,8 +47,8 @@ |
||
47 | 47 | * @param array $headers additional key value based headers |
48 | 48 | * @since 8.1.0 |
49 | 49 | */ |
50 | - public function __construct($data='', $statusCode=Http::STATUS_OK, |
|
51 | - $headers=[]) { |
|
50 | + public function __construct($data = '', $statusCode = Http::STATUS_OK, |
|
51 | + $headers = []) { |
|
52 | 52 | parent::__construct(); |
53 | 53 | |
54 | 54 | $this->data = $data; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param int $statusCode the Http status code, defaults to 200 |
55 | 55 | * @since 6.0.0 |
56 | 56 | */ |
57 | - public function __construct($data=[], $statusCode=Http::STATUS_OK) { |
|
57 | + public function __construct($data = [], $statusCode = Http::STATUS_OK) { |
|
58 | 58 | parent::__construct(); |
59 | 59 | |
60 | 60 | $this->data = $data; |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function render() { |
73 | 73 | $response = json_encode($this->data, JSON_HEX_TAG); |
74 | - if($response === false) { |
|
75 | - throw new \Exception(sprintf('Could not json_encode due to invalid ' . |
|
74 | + if ($response === false) { |
|
75 | + throw new \Exception(sprintf('Could not json_encode due to invalid '. |
|
76 | 76 | 'non UTF-8 characters in the array: %s', var_export($this->data, true))); |
77 | 77 | } |
78 | 78 |