@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | if (!is_null($loggedUser)) { |
56 | 56 | $userValues = $this->config->getUserKeys($loggedUser->getUID(), $this->appName); |
57 | 57 | if (count($userValues) > 0) { |
58 | - $linkToCSS = $this->urlGenerator->linkToRoute($this->appName . '.accessibility.getCss', ['md5' => md5(implode('-', $userValues))]); |
|
58 | + $linkToCSS = $this->urlGenerator->linkToRoute($this->appName.'.accessibility.getCss', ['md5' => md5(implode('-', $userValues))]); |
|
59 | 59 | \OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'href' => $linkToCSS]); |
60 | 60 | } |
61 | 61 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | public function injectJavascript() { |
65 | 65 | $linkToJs = $this->urlGenerator->linkToRoute( |
66 | - $this->appName . '.accessibility.getJavascript', |
|
66 | + $this->appName.'.accessibility.getJavascript', |
|
67 | 67 | [ |
68 | 68 | 'v' => \OC::$server->getConfig()->getAppValue('accessibility', 'cachebuster', '0'), |
69 | 69 | ] |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare (strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2018 John Molakvoæ (skjnldsv) <[email protected]> |
5 | 5 | * |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | |
132 | 132 | foreach ($userValues as $key => $scssFile) { |
133 | 133 | if ($scssFile !== false) { |
134 | - $imports .= '@import "' . $scssFile . '";'; |
|
134 | + $imports .= '@import "'.$scssFile.'";'; |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | 138 | if ($imports !== '') { |
139 | 139 | $scss = new Compiler(); |
140 | 140 | $scss->setImportPaths([ |
141 | - $this->appRoot . '/css/', |
|
142 | - $this->serverRoot . '/core/css/' |
|
141 | + $this->appRoot.'/css/', |
|
142 | + $this->serverRoot.'/core/css/' |
|
143 | 143 | ]); |
144 | 144 | |
145 | 145 | // Continue after throw |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | // Import theme, variables and compile css4 variables |
150 | 150 | try { |
151 | 151 | $css .= $scss->compile( |
152 | - $imports . |
|
153 | - $this->getInjectedVariables() . |
|
154 | - '@import "variables.scss";' . |
|
152 | + $imports. |
|
153 | + $this->getInjectedVariables(). |
|
154 | + '@import "variables.scss";'. |
|
155 | 155 | '@import "css-variables.scss";' |
156 | 156 | ); |
157 | 157 | } catch (ParserException $e) { |
@@ -164,21 +164,21 @@ discard block |
||
164 | 164 | |
165 | 165 | // Rebase all urls |
166 | 166 | $appWebRoot = substr($this->appRoot, strlen($this->serverRoot) - strlen(\OC::$WEBROOT)); |
167 | - $css = $this->rebaseUrls($css, $appWebRoot . '/css'); |
|
167 | + $css = $this->rebaseUrls($css, $appWebRoot.'/css'); |
|
168 | 168 | |
169 | 169 | if (in_array('themedark', $userValues) && $this->iconsCacher->getCachedCSS() && $this->iconsCacher->getCachedCSS()->getSize() > 0) { |
170 | 170 | $iconsCss = $this->invertSvgIconsColor($this->iconsCacher->getCachedCSS()->getContent()); |
171 | - $css = $css . $iconsCss; |
|
171 | + $css = $css.$iconsCss; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $response = new DataDisplayResponse($css, Http::STATUS_OK, ['Content-Type' => 'text/css']); |
175 | 175 | |
176 | 176 | // Set cache control |
177 | 177 | $ttl = 31536000; |
178 | - $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable'); |
|
178 | + $response->addHeader('Cache-Control', 'max-age='.$ttl.', immutable'); |
|
179 | 179 | $expires = new \DateTime(); |
180 | 180 | $expires->setTimestamp($this->timeFactory->getTime()); |
181 | - $expires->add(new \DateInterval('PT' . $ttl . 'S')); |
|
181 | + $expires->add(new \DateInterval('PT'.$ttl.'S')); |
|
182 | 182 | $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); |
183 | 183 | $response->addHeader('Pragma', 'cache'); |
184 | 184 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | public function getJavascript(): DataDownloadResponse { |
195 | 195 | $responseJS = '(function() { |
196 | 196 | OCA.Accessibility = { |
197 | - theme: ' . json_encode($this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false)) . ', |
|
197 | + theme: ' . json_encode($this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false)).', |
|
198 | 198 | |
199 | 199 | }; |
200 | 200 | })();'; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | private function rebaseUrls(string $css, string $webDir): string { |
237 | 237 | $re = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x'; |
238 | - $subst = 'url(\'' . $webDir . '/$1\')'; |
|
238 | + $subst = 'url(\''.$webDir.'/$1\')'; |
|
239 | 239 | |
240 | 240 | return preg_replace($re, $subst, $css); |
241 | 241 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } |
260 | 260 | $variables = ''; |
261 | 261 | foreach ($this->defaults->getScssVariables() as $key => $value) { |
262 | - $variables .= '$' . $key . ': ' . $value . ';'; |
|
262 | + $variables .= '$'.$key.': '.$value.';'; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | // check for valid variables / otherwise fall back to defaults |