@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * |
59 | 59 | * SQL query via Doctrine prepare(), needs to be execute()'d! |
60 | 60 | */ |
61 | - static public function prepare($query , $limit = null, $offset = null, $isManipulation = null) { |
|
61 | + static public function prepare($query, $limit = null, $offset = null, $isManipulation = null) { |
|
62 | 62 | $connection = \OC::$server->getDatabaseConnection(); |
63 | 63 | |
64 | 64 | if ($isManipulation === null) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | // return the result |
70 | 70 | try { |
71 | - $result =$connection->prepare($query, $limit, $offset); |
|
71 | + $result = $connection->prepare($query, $limit, $offset); |
|
72 | 72 | } catch (\Doctrine\DBAL\DBALException $e) { |
73 | 73 | throw new \OC\DatabaseException($e->getMessage()); |
74 | 74 | } |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | } |
127 | 127 | if (is_array($stmt)) { |
128 | 128 | // convert to prepared statement |
129 | - if ( ! array_key_exists('sql', $stmt) ) { |
|
129 | + if (!array_key_exists('sql', $stmt)) { |
|
130 | 130 | $message = 'statement array must at least contain key \'sql\''; |
131 | 131 | throw new \OC\DatabaseException($message); |
132 | 132 | } |
133 | - if ( ! array_key_exists('limit', $stmt) ) { |
|
133 | + if (!array_key_exists('limit', $stmt)) { |
|
134 | 134 | $stmt['limit'] = null; |
135 | 135 | } |
136 | - if ( ! array_key_exists('limit', $stmt) ) { |
|
136 | + if (!array_key_exists('limit', $stmt)) { |
|
137 | 137 | $stmt['offset'] = null; |
138 | 138 | } |
139 | 139 | $stmt = self::prepare($stmt['sql'], $stmt['limit'], $stmt['offset']); |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | self::raiseExceptionOnError($result, 'Could not execute statement'); |
145 | 145 | } else { |
146 | 146 | if (is_object($stmt)) { |
147 | - $message = 'Expected a prepared statement or array got ' . get_class($stmt); |
|
147 | + $message = 'Expected a prepared statement or array got '.get_class($stmt); |
|
148 | 148 | } else { |
149 | - $message = 'Expected a prepared statement or array got ' . gettype($stmt); |
|
149 | + $message = 'Expected a prepared statement or array got '.gettype($stmt); |
|
150 | 150 | } |
151 | 151 | throw new \OC\DatabaseException($message); |
152 | 152 | } |
@@ -212,11 +212,11 @@ discard block |
||
212 | 212 | * @throws \OC\DatabaseException |
213 | 213 | */ |
214 | 214 | public static function raiseExceptionOnError($result, $message = null) { |
215 | - if($result === false) { |
|
215 | + if ($result === false) { |
|
216 | 216 | if ($message === null) { |
217 | 217 | $message = self::getErrorMessage(); |
218 | 218 | } else { |
219 | - $message .= ', Root cause:' . self::getErrorMessage(); |
|
219 | + $message .= ', Root cause:'.self::getErrorMessage(); |
|
220 | 220 | } |
221 | 221 | throw new \OC\DatabaseException($message); |
222 | 222 | } |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | static public function connect($signalClass, $signalName, $slotClass, $slotName) { |
55 | 55 | // If we're trying to connect to an emitting class that isn't |
56 | 56 | // yet registered, register it |
57 | - if( !array_key_exists($signalClass, self::$registered )) { |
|
57 | + if (!array_key_exists($signalClass, self::$registered)) { |
|
58 | 58 | self::$registered[$signalClass] = []; |
59 | 59 | } |
60 | 60 | // If we're trying to connect to an emitting method that isn't |
61 | 61 | // yet registered, register it with the emitting class |
62 | - if( !array_key_exists( $signalName, self::$registered[$signalClass] )) { |
|
62 | + if (!array_key_exists($signalName, self::$registered[$signalClass])) { |
|
63 | 63 | self::$registered[$signalClass][$signalName] = []; |
64 | 64 | } |
65 | 65 | |
@@ -95,27 +95,27 @@ discard block |
||
95 | 95 | |
96 | 96 | // Return false if no hook handlers are listening to this |
97 | 97 | // emitting class |
98 | - if( !array_key_exists($signalClass, self::$registered )) { |
|
98 | + if (!array_key_exists($signalClass, self::$registered)) { |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 | |
102 | 102 | // Return false if no hook handlers are listening to this |
103 | 103 | // emitting method |
104 | - if( !array_key_exists( $signalName, self::$registered[$signalClass] )) { |
|
104 | + if (!array_key_exists($signalName, self::$registered[$signalClass])) { |
|
105 | 105 | return false; |
106 | 106 | } |
107 | 107 | |
108 | 108 | // Call all slots |
109 | - foreach( self::$registered[$signalClass][$signalName] as $i ) { |
|
109 | + foreach (self::$registered[$signalClass][$signalName] as $i) { |
|
110 | 110 | try { |
111 | - call_user_func( [ $i["class"], $i["name"] ], $params ); |
|
112 | - } catch (Exception $e){ |
|
111 | + call_user_func([$i["class"], $i["name"]], $params); |
|
112 | + } catch (Exception $e) { |
|
113 | 113 | self::$thrownExceptions[] = $e; |
114 | 114 | \OC::$server->getLogger()->logException($e); |
115 | - if($e instanceof \OC\HintException) { |
|
115 | + if ($e instanceof \OC\HintException) { |
|
116 | 116 | throw $e; |
117 | 117 | } |
118 | - if($e instanceof \OC\ServerNotAvailableException) { |
|
118 | + if ($e instanceof \OC\ServerNotAvailableException) { |
|
119 | 119 | throw $e; |
120 | 120 | } |
121 | 121 | } |
@@ -129,15 +129,15 @@ discard block |
||
129 | 129 | * @param string $signalClass |
130 | 130 | * @param string $signalName |
131 | 131 | */ |
132 | - static public function clear($signalClass='', $signalName='') { |
|
132 | + static public function clear($signalClass = '', $signalName = '') { |
|
133 | 133 | if ($signalClass) { |
134 | 134 | if ($signalName) { |
135 | - self::$registered[$signalClass][$signalName]=[]; |
|
136 | - }else{ |
|
137 | - self::$registered[$signalClass]=[]; |
|
135 | + self::$registered[$signalClass][$signalName] = []; |
|
136 | + } else { |
|
137 | + self::$registered[$signalClass] = []; |
|
138 | 138 | } |
139 | - }else{ |
|
140 | - self::$registered=[]; |
|
139 | + } else { |
|
140 | + self::$registered = []; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | $entry['active'] = false; |
96 | - if(!isset($entry['icon'])) { |
|
96 | + if (!isset($entry['icon'])) { |
|
97 | 97 | $entry['icon'] = ''; |
98 | 98 | } |
99 | - if(!isset($entry['classes'])) { |
|
99 | + if (!isset($entry['classes'])) { |
|
100 | 100 | $entry['classes'] = ''; |
101 | 101 | } |
102 | - if(!isset($entry['type'])) { |
|
102 | + if (!isset($entry['type'])) { |
|
103 | 103 | $entry['type'] = 'link'; |
104 | 104 | } |
105 | 105 | $this->entries[$entry['id']] = $entry; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | $result = $this->entries; |
122 | 122 | if ($type !== 'all') { |
123 | - $result = array_filter($this->entries, function ($entry) use ($type) { |
|
123 | + $result = array_filter($this->entries, function($entry) use ($type) { |
|
124 | 124 | return $entry['type'] === $type; |
125 | 125 | }); |
126 | 126 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @return array |
136 | 136 | */ |
137 | 137 | private function proceedNavigation(array $list): array { |
138 | - uasort($list, function ($a, $b) { |
|
138 | + uasort($list, function($a, $b) { |
|
139 | 139 | if (isset($a['order']) && isset($b['order'])) { |
140 | 140 | return ($a['order'] < $b['order']) ? -1 : 1; |
141 | 141 | } else if (isset($a['order']) || isset($b['order'])) { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | ]); |
232 | 232 | |
233 | 233 | $logoutUrl = \OC_User::getLogoutUrl($this->urlGenerator); |
234 | - if($logoutUrl !== '') { |
|
234 | + if ($logoutUrl !== '') { |
|
235 | 235 | // Logout |
236 | 236 | $this->add([ |
237 | 237 | 'type' => 'settings', |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | $l = $this->l10nFac->get($app); |
291 | - $id = $nav['id'] ?? $app . ($key === 0 ? '' : $key); |
|
291 | + $id = $nav['id'] ?? $app.($key === 0 ? '' : $key); |
|
292 | 292 | $order = isset($nav['order']) ? $nav['order'] : 100; |
293 | 293 | $type = isset($nav['type']) ? $nav['type'] : 'link'; |
294 | 294 | $route = $nav['route'] !== '' ? $this->urlGenerator->linkToRoute($nav['route']) : ''; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | 'EMAIL' |
79 | 79 | ]); |
80 | 80 | |
81 | - $entries = array_map(function (array $contact) { |
|
81 | + $entries = array_map(function(array $contact) { |
|
82 | 82 | return $this->contactArrayToEntry($contact); |
83 | 83 | }, $allContacts); |
84 | 84 | return $this->filterContacts( |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($excludedGroups) { |
122 | 122 | $excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', ''); |
123 | 123 | $decodedExcludeGroups = json_decode($excludedGroups, true); |
124 | - $excludeGroupsList = ($decodedExcludeGroups !== null) ? $decodedExcludeGroups : []; |
|
124 | + $excludeGroupsList = ($decodedExcludeGroups !== null) ? $decodedExcludeGroups : []; |
|
125 | 125 | |
126 | 126 | if (count(array_intersect($excludeGroupsList, $selfGroups)) !== 0) { |
127 | 127 | // a group of the current user is excluded -> filter all local users |
@@ -131,28 +131,28 @@ discard block |
||
131 | 131 | |
132 | 132 | $selfUID = $self->getUID(); |
133 | 133 | |
134 | - return array_values(array_filter($entries, function (IEntry $entry) use ($self, $skipLocal, $ownGroupsOnly, $selfGroups, $selfUID, $disallowEnumeration, $filter) { |
|
134 | + return array_values(array_filter($entries, function(IEntry $entry) use ($self, $skipLocal, $ownGroupsOnly, $selfGroups, $selfUID, $disallowEnumeration, $filter) { |
|
135 | 135 | if ($skipLocal && $entry->getProperty('isLocalSystemBook') === true) { |
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | |
139 | 139 | // Prevent enumerating local users |
140 | - if($disallowEnumeration && $entry->getProperty('isLocalSystemBook')) { |
|
140 | + if ($disallowEnumeration && $entry->getProperty('isLocalSystemBook')) { |
|
141 | 141 | $filterUser = true; |
142 | 142 | |
143 | 143 | $mailAddresses = $entry->getEMailAddresses(); |
144 | - foreach($mailAddresses as $mailAddress) { |
|
145 | - if($mailAddress === $filter) { |
|
144 | + foreach ($mailAddresses as $mailAddress) { |
|
145 | + if ($mailAddress === $filter) { |
|
146 | 146 | $filterUser = false; |
147 | 147 | break; |
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | - if($entry->getProperty('UID') && $entry->getProperty('UID') === $filter) { |
|
151 | + if ($entry->getProperty('UID') && $entry->getProperty('UID') === $filter) { |
|
152 | 152 | $filterUser = false; |
153 | 153 | } |
154 | 154 | |
155 | - if($filterUser) { |
|
155 | + if ($filterUser) { |
|
156 | 156 | return false; |
157 | 157 | } |
158 | 158 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @return IEntry|null |
183 | 183 | */ |
184 | 184 | public function findOne(IUser $user, $shareType, $shareWith) { |
185 | - switch($shareType) { |
|
185 | + switch ($shareType) { |
|
186 | 186 | case 0: |
187 | 187 | case 6: |
188 | 188 | $filter = ['UID']; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | $userId = $user->getUID(); |
198 | 198 | $allContacts = $this->contactsManager->search($shareWith, $filter); |
199 | - $contacts = array_filter($allContacts, function ($contact) use ($userId) { |
|
199 | + $contacts = array_filter($allContacts, function($contact) use ($userId) { |
|
200 | 200 | return $contact['UID'] !== $userId; |
201 | 201 | }); |
202 | 202 | $match = null; |
@@ -69,36 +69,36 @@ discard block |
||
69 | 69 | // yes - should be injected .... |
70 | 70 | $this->config = \OC::$server->getConfig(); |
71 | 71 | |
72 | - if(\OCP\Util::isIE()) { |
|
72 | + if (\OCP\Util::isIE()) { |
|
73 | 73 | \OC_Util::addStyle('ie'); |
74 | 74 | } |
75 | 75 | |
76 | 76 | // Decide which page we show |
77 | - if($renderAs === 'user') { |
|
78 | - parent::__construct( 'core', 'layout.user' ); |
|
79 | - if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
77 | + if ($renderAs === 'user') { |
|
78 | + parent::__construct('core', 'layout.user'); |
|
79 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
80 | 80 | $this->assign('bodyid', 'body-settings'); |
81 | - }else{ |
|
81 | + } else { |
|
82 | 82 | $this->assign('bodyid', 'body-user'); |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Add navigation entry |
86 | - $this->assign( 'application', ''); |
|
87 | - $this->assign( 'appid', $appId ); |
|
86 | + $this->assign('application', ''); |
|
87 | + $this->assign('appid', $appId); |
|
88 | 88 | $navigation = \OC::$server->getNavigationManager()->getAll(); |
89 | - $this->assign( 'navigation', $navigation); |
|
89 | + $this->assign('navigation', $navigation); |
|
90 | 90 | $settingsNavigation = \OC::$server->getNavigationManager()->getAll('settings'); |
91 | - $this->assign( 'settingsnavigation', $settingsNavigation); |
|
92 | - foreach($navigation as $entry) { |
|
91 | + $this->assign('settingsnavigation', $settingsNavigation); |
|
92 | + foreach ($navigation as $entry) { |
|
93 | 93 | if ($entry['active']) { |
94 | - $this->assign( 'application', $entry['name'] ); |
|
94 | + $this->assign('application', $entry['name']); |
|
95 | 95 | break; |
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - foreach($settingsNavigation as $entry) { |
|
99 | + foreach ($settingsNavigation as $entry) { |
|
100 | 100 | if ($entry['active']) { |
101 | - $this->assign( 'application', $entry['name'] ); |
|
101 | + $this->assign('application', $entry['name']); |
|
102 | 102 | break; |
103 | 103 | } |
104 | 104 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->assign('user_uid', \OC_User::getUser()); |
140 | 140 | } else if ($renderAs === 'public') { |
141 | 141 | parent::__construct('core', 'layout.public'); |
142 | - $this->assign( 'appid', $appId ); |
|
142 | + $this->assign('appid', $appId); |
|
143 | 143 | $this->assign('bodyid', 'body-public'); |
144 | 144 | |
145 | 145 | /** @var IRegistry $subscription */ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $this->assign('language', $lang); |
162 | 162 | $this->assign('locale', $locale); |
163 | 163 | |
164 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
164 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
165 | 165 | if (empty(self::$versionHash)) { |
166 | 166 | $v = \OC_App::getAppVersions(); |
167 | 167 | $v['core'] = implode('.', \OCP\Util::getVersion()); |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); |
194 | 194 | } |
195 | 195 | } |
196 | - foreach($jsFiles as $info) { |
|
196 | + foreach ($jsFiles as $info) { |
|
197 | 197 | $web = $info[1]; |
198 | 198 | $file = $info[2]; |
199 | - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
199 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | try { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | // Do not initialise scss appdata until we have a fully installed instance |
209 | 209 | // Do not load scss for update, errors, installation or login page |
210 | - if(\OC::$server->getSystemConfig()->getValue('installed', false) |
|
210 | + if (\OC::$server->getSystemConfig()->getValue('installed', false) |
|
211 | 211 | && !\OCP\Util::needUpgrade() |
212 | 212 | && $pathInfo !== '' |
213 | 213 | && !preg_match('/^\/login/', $pathInfo) |
@@ -224,19 +224,19 @@ discard block |
||
224 | 224 | $this->assign('cssfiles', []); |
225 | 225 | $this->assign('printcssfiles', []); |
226 | 226 | $this->assign('versionHash', self::$versionHash); |
227 | - foreach($cssFiles as $info) { |
|
227 | + foreach ($cssFiles as $info) { |
|
228 | 228 | $web = $info[1]; |
229 | 229 | $file = $info[2]; |
230 | 230 | |
231 | 231 | if (substr($file, -strlen('print.css')) === 'print.css') { |
232 | - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
232 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
233 | 233 | } else { |
234 | 234 | $suffix = $this->getVersionHashSuffix($web, $file); |
235 | 235 | |
236 | 236 | if (strpos($file, '?v=') == false) { |
237 | - $this->append( 'cssfiles', $web.'/'.$file . $suffix); |
|
237 | + $this->append('cssfiles', $web.'/'.$file.$suffix); |
|
238 | 238 | } else { |
239 | - $this->append( 'cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); |
|
239 | + $this->append('cssfiles', $web.'/'.$file.'-'.substr($suffix, 3)); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | |
263 | 263 | if ($this->config->getSystemValue('installed', false)) { |
264 | 264 | if (\OC::$server->getAppManager()->isInstalled('theming')) { |
265 | - $themingSuffix = '-' . $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
265 | + $themingSuffix = '-'.$this->config->getAppValue('theming', 'cachebuster', '0'); |
|
266 | 266 | } |
267 | 267 | $v = \OC_App::getAppVersions(); |
268 | 268 | } |
@@ -270,21 +270,21 @@ discard block |
||
270 | 270 | // Try the webroot path for a match |
271 | 271 | if ($path !== false && $path !== '') { |
272 | 272 | $appName = $this->getAppNamefromPath($path); |
273 | - if(array_key_exists($appName, $v)) { |
|
273 | + if (array_key_exists($appName, $v)) { |
|
274 | 274 | $appVersion = $v[$appName]; |
275 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
275 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
276 | 276 | } |
277 | 277 | } |
278 | 278 | // fallback to the file path instead |
279 | 279 | if ($file !== false && $file !== '') { |
280 | 280 | $appName = $this->getAppNamefromPath($file); |
281 | - if(array_key_exists($appName, $v)) { |
|
281 | + if (array_key_exists($appName, $v)) { |
|
282 | 282 | $appVersion = $v[$appName]; |
283 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
283 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
287 | - return '?v=' . self::$versionHash . $themingSuffix; |
|
287 | + return '?v='.self::$versionHash.$themingSuffix; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | // Read the selected theme from the config file |
296 | 296 | $theme = \OC_Util::getTheme(); |
297 | 297 | |
298 | - if($compileScss) { |
|
298 | + if ($compileScss) { |
|
299 | 299 | $SCSSCacher = \OC::$server->query(SCSSCacher::class); |
300 | 300 | } else { |
301 | 301 | $SCSSCacher = null; |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | $locator = new \OC\Template\CSSResourceLocator( |
305 | 305 | \OC::$server->getLogger(), |
306 | 306 | $theme, |
307 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
308 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
307 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
308 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
309 | 309 | $SCSSCacher |
310 | 310 | ); |
311 | 311 | $locator->find($styles); |
@@ -340,8 +340,8 @@ discard block |
||
340 | 340 | $locator = new \OC\Template\JSResourceLocator( |
341 | 341 | \OC::$server->getLogger(), |
342 | 342 | $theme, |
343 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
344 | - [ \OC::$SERVERROOT => \OC::$WEBROOT ], |
|
343 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
344 | + [\OC::$SERVERROOT => \OC::$WEBROOT], |
|
345 | 345 | \OC::$server->query(JSCombiner::class) |
346 | 346 | ); |
347 | 347 | $locator->find($scripts); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public static function convertToRelativePath($filePath) { |
358 | 358 | $relativePath = explode(\OC::$SERVERROOT, $filePath); |
359 | - if(count($relativePath) !== 2) { |
|
359 | + if (count($relativePath) !== 2) { |
|
360 | 360 | throw new \Exception('$filePath is not under the \OC::$SERVERROOT'); |
361 | 361 | } |
362 | 362 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | public function getFilteredProperties(string $scope = null, string $verified = null): array { |
63 | - return \array_filter($this->properties, function (IAccountProperty $obj) use ($scope, $verified) { |
|
63 | + return \array_filter($this->properties, function(IAccountProperty $obj) use ($scope, $verified) { |
|
64 | 64 | if ($scope !== null && $scope !== $obj->getScope()) { |
65 | 65 | return false; |
66 | 66 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | throw new \InvalidArgumentException('Empty template name'); |
47 | 47 | } |
48 | 48 | |
49 | - foreach($this->dirs as $dir) { |
|
49 | + foreach ($this->dirs as $dir) { |
|
50 | 50 | $file = $dir.$template.'.php'; |
51 | 51 | if (is_file($file)) { |
52 | 52 | $this->path = $dir; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { |
67 | 67 | // Check if the app is in the app folder or in the root |
68 | - if( file_exists($app_dir.'/templates/' )) { |
|
68 | + if (file_exists($app_dir.'/templates/')) { |
|
69 | 69 | return [ |
70 | 70 | $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', |
71 | 71 | $app_dir.'/templates/', |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | * $_[$key][$position] in the template. |
116 | 116 | */ |
117 | 117 | public function append($key, $value) { |
118 | - if( array_key_exists( $key, $this->vars )) { |
|
118 | + if (array_key_exists($key, $this->vars)) { |
|
119 | 119 | $this->vars[$key][] = $value; |
120 | 120 | } |
121 | - else{ |
|
122 | - $this->vars[$key] = [ $value ]; |
|
121 | + else { |
|
122 | + $this->vars[$key] = [$value]; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function printPage() { |
133 | 133 | $data = $this->fetchPage(); |
134 | - if( $data === false ) { |
|
134 | + if ($data === false) { |
|
135 | 135 | return false; |
136 | 136 | } |
137 | - else{ |
|
137 | + else { |
|
138 | 138 | print $data; |
139 | 139 | return true; |
140 | 140 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | $l = $this->l10n; |
168 | 168 | $theme = $this->theme; |
169 | 169 | |
170 | - if(!is_null($additionalParams)) { |
|
171 | - $_ = array_merge( $additionalParams, $this->vars ); |
|
170 | + if (!is_null($additionalParams)) { |
|
171 | + $_ = array_merge($additionalParams, $this->vars); |
|
172 | 172 | foreach ($_ as $var => $value) { |
173 | 173 | ${$var} = $value; |
174 | 174 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param array $params |
35 | 35 | */ |
36 | 36 | public function __construct($params) { |
37 | - if ( ! isset($params['user']) || ! $params['user'] instanceof User) { |
|
37 | + if (!isset($params['user']) || !$params['user'] instanceof User) { |
|
38 | 38 | throw new \Exception('missing user object in parameters'); |
39 | 39 | } |
40 | 40 | $this->user = $params['user']; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | public function getId() { |
45 | - return 'object::user:' . $this->user->getUID(); |
|
45 | + return 'object::user:'.$this->user->getUID(); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |