@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param \OCP\IL10N $l10n |
47 | 47 | * @param Defaults $theme |
48 | 48 | */ |
49 | - public function __construct($template, $requestToken, $l10n, $theme ) { |
|
49 | + public function __construct($template, $requestToken, $l10n, $theme) { |
|
50 | 50 | $this->vars = array(); |
51 | 51 | $this->vars['requesttoken'] = $requestToken; |
52 | 52 | $this->l10n = $l10n; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { |
65 | 65 | // Check if the app is in the app folder or in the root |
66 | - if( file_exists($app_dir.'/templates/' )) { |
|
66 | + if (file_exists($app_dir.'/templates/')) { |
|
67 | 67 | return [ |
68 | 68 | $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', |
69 | 69 | $app_dir.'/templates/', |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * If the key existed before, it will be overwritten |
100 | 100 | */ |
101 | - public function assign( $key, $value) { |
|
101 | + public function assign($key, $value) { |
|
102 | 102 | $this->vars[$key] = $value; |
103 | 103 | return true; |
104 | 104 | } |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | * exists, the value will be appended. It can be accessed via |
114 | 114 | * $_[$key][$position] in the template. |
115 | 115 | */ |
116 | - public function append( $key, $value ) { |
|
117 | - if( array_key_exists( $key, $this->vars )) { |
|
116 | + public function append($key, $value) { |
|
117 | + if (array_key_exists($key, $this->vars)) { |
|
118 | 118 | $this->vars[$key][] = $value; |
119 | 119 | } |
120 | - else{ |
|
121 | - $this->vars[$key] = array( $value ); |
|
120 | + else { |
|
121 | + $this->vars[$key] = array($value); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function printPage() { |
132 | 132 | $data = $this->fetchPage(); |
133 | - if( $data === false ) { |
|
133 | + if ($data === false) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | - else{ |
|
136 | + else { |
|
137 | 137 | print $data; |
138 | 138 | return true; |
139 | 139 | } |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | $l = $this->l10n; |
167 | 167 | $theme = $this->theme; |
168 | 168 | |
169 | - if(!is_null($additionalParams)) { |
|
170 | - $_ = array_merge( $additionalParams, $this->vars ); |
|
169 | + if (!is_null($additionalParams)) { |
|
170 | + $_ = array_merge($additionalParams, $this->vars); |
|
171 | 171 | foreach ($_ as $var => $value) { |
172 | 172 | ${$var} = $value; |
173 | 173 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $timezones = \DateTimeZone::listIdentifiers(); |
37 | 37 | |
38 | 38 | if ($search !== '') { |
39 | - $timezones = array_filter($timezones, function ($timezone) use ($search) { |
|
39 | + $timezones = array_filter($timezones, function($timezone) use ($search) { |
|
40 | 40 | return stripos($timezone, $search) !== false; |
41 | 41 | }); |
42 | 42 | } |
@@ -63,10 +63,10 @@ |
||
63 | 63 | */ |
64 | 64 | protected function execute(InputInterface $input, OutputInterface $output) { |
65 | 65 | $appid = $input->getArgument('appid'); |
66 | - $path = (string)$input->getOption('path'); |
|
66 | + $path = (string) $input->getOption('path'); |
|
67 | 67 | $result = $this->checker->verifyAppSignature($appid, $path); |
68 | 68 | $this->writeArrayInOutputFormat($input, $output, $result); |
69 | - if (count($result)>0){ |
|
69 | + if (count($result) > 0) { |
|
70 | 70 | return 1; |
71 | 71 | } |
72 | 72 | } |
@@ -58,13 +58,13 @@ |
||
58 | 58 | * @since 13.0.0 |
59 | 59 | */ |
60 | 60 | protected function getValidatedType($type) { |
61 | - $type = trim((string)$type); |
|
61 | + $type = trim((string) $type); |
|
62 | 62 | |
63 | - if($type === '') { |
|
63 | + if ($type === '') { |
|
64 | 64 | throw new \InvalidArgumentException('Type must not be empty'); |
65 | 65 | } |
66 | 66 | |
67 | - if($type === 'exact') { |
|
67 | + if ($type === 'exact') { |
|
68 | 68 | throw new \InvalidArgumentException('Provided type is a reserved word'); |
69 | 69 | } |
70 | 70 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | public function generate($name, $parameters = array(), $absolute = false) { |
54 | 54 | asort($parameters); |
55 | - $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute; |
|
55 | + $key = $this->context->getHost().'#'.$this->context->getBaseUrl().$name.sha1(json_encode($parameters)).(int) $absolute; |
|
56 | 56 | $cachedKey = $this->cache->get($key); |
57 | 57 | if ($cachedKey) { |
58 | 58 | return $cachedKey; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $userSession, |
61 | 61 | $groupManager, |
62 | 62 | function($name) { |
63 | - $nodes = \OC::$server->getUserFolder()->getById((int)$name); |
|
63 | + $nodes = \OC::$server->getUserFolder()->getById((int) $name); |
|
64 | 64 | return !empty($nodes); |
65 | 65 | } |
66 | 66 | ), |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) { |
100 | - return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId()); |
|
100 | + return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId()); |
|
101 | 101 | }); |
102 | 102 | |
103 | 103 | $propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) { |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | * @return mixed|string |
130 | 130 | */ |
131 | 131 | public function getCommentsLink(Node $node) { |
132 | - $href = $this->server->getBaseUri(); |
|
132 | + $href = $this->server->getBaseUri(); |
|
133 | 133 | $entryPoint = strpos($href, '/remote.php/'); |
134 | - if($entryPoint === false) { |
|
134 | + if ($entryPoint === false) { |
|
135 | 135 | // in case we end up somewhere else, unexpectedly. |
136 | 136 | return null; |
137 | 137 | } |
138 | - $commentsPart = 'dav/comments/files/' . rawurldecode($node->getId()); |
|
138 | + $commentsPart = 'dav/comments/files/'.rawurldecode($node->getId()); |
|
139 | 139 | $href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/')); |
140 | 140 | return $href; |
141 | 141 | } |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function getUnreadCount(Node $node) { |
151 | 151 | $user = $this->userSession->getUser(); |
152 | - if(is_null($user)) { |
|
152 | + if (is_null($user)) { |
|
153 | 153 | return null; |
154 | 154 | } |
155 | 155 | |
156 | - $lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user); |
|
156 | + $lastRead = $this->commentsManager->getReadMark('files', (string) $node->getId(), $user); |
|
157 | 157 | |
158 | - return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead); |
|
158 | + return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId(), $lastRead); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | } |
@@ -37,9 +37,9 @@ |
||
37 | 37 | static function xmlDeserialize(Reader $reader) { |
38 | 38 | $value = $reader->parseInnerTree(); |
39 | 39 | if (!is_int($value) && !is_string($value)) { |
40 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); |
|
40 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}offset has illegal value'); |
|
41 | 41 | } |
42 | 42 | |
43 | - return (int)$value; |
|
43 | + return (int) $value; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | \ No newline at end of file |
@@ -37,9 +37,9 @@ |
||
37 | 37 | static function xmlDeserialize(Reader $reader) { |
38 | 38 | $value = $reader->parseInnerTree(); |
39 | 39 | if (!is_int($value) && !is_string($value)) { |
40 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value'); |
|
40 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}limit has illegal value'); |
|
41 | 41 | } |
42 | 42 | |
43 | - return (int)$value; |
|
43 | + return (int) $value; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | \ No newline at end of file |