Completed
Push — master ( d35b65...6a979a )
by Morris
24:58 queued 10s
created
apps/accessibility/appinfo/routes.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,20 +22,20 @@
 block discarded – undo
22 22
  */
23 23
 
24 24
 return [
25
-	'routes' => [
26
-		['name' => 'accessibility#getCss', 'url' => '/css/user-{md5}.css', 'verb' => 'GET'],
27
-		['name' => 'accessibility#getJavascript', 'url' => '/js/accessibility', 'verb' => 'GET'],
25
+    'routes' => [
26
+        ['name' => 'accessibility#getCss', 'url' => '/css/user-{md5}.css', 'verb' => 'GET'],
27
+        ['name' => 'accessibility#getJavascript', 'url' => '/js/accessibility', 'verb' => 'GET'],
28 28
     ],
29 29
     'ocs' => [
30
-		[
31
-			'name' => 'Config#getConfig',
32
-			'url'  => '/api/v1/config',
33
-			'verb' => 'GET',
30
+        [
31
+            'name' => 'Config#getConfig',
32
+            'url'  => '/api/v1/config',
33
+            'verb' => 'GET',
34
+        ],
35
+        [
36
+            'name' => 'Config#setConfig',
37
+            'url'  => '/api/v1/config/{key}',
38
+            'verb' => 'POST',
34 39
         ],
35
-		[
36
-			'name' => 'Config#setConfig',
37
-			'url'  => '/api/v1/config/{key}',
38
-			'verb' => 'POST',
39
-		],
40 40
     ]
41 41
 ];
Please login to merge, or discard this patch.
apps/accessibility/lib/AppInfo/Application.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -30,52 +30,52 @@
 block discarded – undo
30 30
 
31 31
 class Application extends App {
32 32
 
33
-	/** @var string */
34
-	protected $appName = 'accessibility';
33
+    /** @var string */
34
+    protected $appName = 'accessibility';
35 35
 
36
-	/** @var IConfig */
37
-	private $config;
36
+    /** @var IConfig */
37
+    private $config;
38 38
 
39
-	/** @var IUserSession */
40
-	private $userSession;
39
+    /** @var IUserSession */
40
+    private $userSession;
41 41
 
42
-	/** @var IURLGenerator */
43
-	private $urlGenerator;
42
+    /** @var IURLGenerator */
43
+    private $urlGenerator;
44 44
 
45
-	public function __construct() {
46
-		parent::__construct($this->appName);
47
-		$this->config       = \OC::$server->getConfig();
48
-		$this->userSession  = \OC::$server->getUserSession();
49
-		$this->urlGenerator = \OC::$server->getURLGenerator();
50
-	}
45
+    public function __construct() {
46
+        parent::__construct($this->appName);
47
+        $this->config       = \OC::$server->getConfig();
48
+        $this->userSession  = \OC::$server->getUserSession();
49
+        $this->urlGenerator = \OC::$server->getURLGenerator();
50
+    }
51 51
 
52
-	public function injectCss() {
53
-		// Inject the fake css on all pages if enabled and user is logged
54
-		$loggedUser = $this->userSession->getUser();
55
-		if (!is_null($loggedUser)) {
56
-			$userValues = $this->config->getUserKeys($loggedUser->getUID(), $this->appName);
57
-			if (count($userValues) > 0) {
58
-				$linkToCSS = $this->urlGenerator->linkToRoute($this->appName . '.accessibility.getCss', ['md5' => md5(implode('-', $userValues))]);
59
-				\OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'href' => $linkToCSS]);
60
-			}
61
-		}
62
-	}
52
+    public function injectCss() {
53
+        // Inject the fake css on all pages if enabled and user is logged
54
+        $loggedUser = $this->userSession->getUser();
55
+        if (!is_null($loggedUser)) {
56
+            $userValues = $this->config->getUserKeys($loggedUser->getUID(), $this->appName);
57
+            if (count($userValues) > 0) {
58
+                $linkToCSS = $this->urlGenerator->linkToRoute($this->appName . '.accessibility.getCss', ['md5' => md5(implode('-', $userValues))]);
59
+                \OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'href' => $linkToCSS]);
60
+            }
61
+        }
62
+    }
63 63
 
64
-	public function injectJavascript() {
65
-		$linkToJs = $this->urlGenerator->linkToRoute(
66
-			$this->appName . '.accessibility.getJavascript',
67
-			[
68
-				'v' => \OC::$server->getConfig()->getAppValue('accessibility', 'cachebuster', '0'),
69
-			]
70
-		);
64
+    public function injectJavascript() {
65
+        $linkToJs = $this->urlGenerator->linkToRoute(
66
+            $this->appName . '.accessibility.getJavascript',
67
+            [
68
+                'v' => \OC::$server->getConfig()->getAppValue('accessibility', 'cachebuster', '0'),
69
+            ]
70
+        );
71 71
 
72
-		\OCP\Util::addHeader(
73
-			'script',
74
-			[
75
-				'src' => $linkToJs,
76
-				'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce()
77
-			],
78
-			''
79
-		);
80
-	}
72
+        \OCP\Util::addHeader(
73
+            'script',
74
+            [
75
+                'src' => $linkToJs,
76
+                'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce()
77
+            ],
78
+            ''
79
+        );
80
+    }
81 81
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			]
Please login to merge, or discard this patch.
apps/accessibility/lib/Controller/AccessibilityController.php 2 patches
Indentation   +226 added lines, -226 removed lines patch added patch discarded remove patch
@@ -41,235 +41,235 @@
 block discarded – undo
41 41
 
42 42
 class AccessibilityController extends Controller {
43 43
 
44
-	/** @var string */
45
-	protected $appName;
46
-
47
-	/** @var string */
48
-	protected $serverRoot;
49
-
50
-	/** @var IConfig */
51
-	private $config;
52
-
53
-	/** @var IUserManager */
54
-	private $userManager;
55
-
56
-	/** @var ILogger */
57
-	private $logger;
58
-
59
-	/** @var IURLGenerator */
60
-	private $urlGenerator;
61
-
62
-	/** @var ITimeFactory */
63
-	protected $timeFactory;
64
-
65
-	/** @var IUserSession */
66
-	private $userSession;
67
-
68
-	/** @var IAppManager */
69
-	private $appManager;
70
-
71
-	/** @var IconsCacher */
72
-	protected $iconsCacher;
73
-
74
-	/** @var \OC_Defaults */
75
-	private $defaults;
76
-
77
-	/** @var null|string */
78
-	private $injectedVariables;
79
-
80
-	/**
81
-	 * Account constructor.
82
-	 *
83
-	 * @param string $appName
84
-	 * @param IRequest $request
85
-	 * @param IConfig $config
86
-	 * @param IUserManager $userManager
87
-	 * @param ILogger $logger
88
-	 * @param IURLGenerator $urlGenerator
89
-	 * @param ITimeFactory $timeFactory
90
-	 * @param IUserSession $userSession
91
-	 * @param IAppManager $appManager
92
-	 * @param \OC_Defaults $defaults
93
-	 */
94
-	public function __construct(string $appName,
95
-								IRequest $request,
96
-								IConfig $config,
97
-								IUserManager $userManager,
98
-								ILogger $logger,
99
-								IURLGenerator $urlGenerator,
100
-								ITimeFactory $timeFactory,
101
-								IUserSession $userSession,
102
-								IAppManager $appManager,
103
-								IconsCacher $iconsCacher,
104
-								\OC_Defaults $defaults) {
105
-		parent::__construct($appName, $request);
106
-		$this->appName      = $appName;
107
-		$this->config       = $config;
108
-		$this->userManager  = $userManager;
109
-		$this->logger       = $logger;
110
-		$this->urlGenerator = $urlGenerator;
111
-		$this->timeFactory  = $timeFactory;
112
-		$this->userSession  = $userSession;
113
-		$this->appManager   = $appManager;
114
-		$this->iconsCacher  = $iconsCacher;
115
-		$this->defaults     = $defaults;
116
-
117
-		$this->serverRoot = \OC::$SERVERROOT;
118
-		$this->appRoot    = $this->appManager->getAppPath($this->appName);
119
-	}
120
-
121
-	/**
122
-	 * @NoAdminRequired
123
-	 * @NoCSRFRequired
124
-	 *
125
-	 * @return DataDisplayResponse
126
-	 */
127
-	public function getCss(): DataDisplayResponse {
128
-		$css        = '';
129
-		$imports    = '';
130
-		$userValues = $this->getUserValues();
131
-
132
-		foreach ($userValues as $key => $scssFile) {
133
-			if ($scssFile !== false) {
134
-				$imports .= '@import "' . $scssFile . '";';
135
-			}
136
-		}
137
-
138
-		if ($imports !== '') {
139
-			$scss = new Compiler();
140
-			$scss->setImportPaths([
141
-				$this->appRoot . '/css/',
142
-				$this->serverRoot . '/core/css/'
143
-			]);
144
-
145
-			// Continue after throw
146
-			$scss->setIgnoreErrors(true);
147
-			$scss->setFormatter(Crunched::class);
148
-
149
-			// Import theme, variables and compile css4 variables
150
-			try {
151
-				$css .= $scss->compile(
152
-					$imports .
153
-					$this->getInjectedVariables() .
154
-					'@import "variables.scss";' .
155
-					'@import "css-variables.scss";'
156
-				);
157
-			} catch (ParserException $e) {
158
-				$this->logger->error($e->getMessage(), ['app' => 'core']);
159
-			}
160
-		}
161
-
162
-		// We don't want to override vars with url since path is different
163
-		$css = $this->filterOutRule('/--[a-z-:]+url\([^;]+\)/mi', $css);
164
-
165
-		// Rebase all urls
166
-		$appWebRoot = substr($this->appRoot, strlen($this->serverRoot) - strlen(\OC::$WEBROOT));
167
-		$css        = $this->rebaseUrls($css, $appWebRoot . '/css');
168
-
169
-		if (in_array('themedark', $userValues) && $this->iconsCacher->getCachedCSS() && $this->iconsCacher->getCachedCSS()->getSize() > 0) {
170
-			$iconsCss = $this->invertSvgIconsColor($this->iconsCacher->getCachedCSS()->getContent());
171
-			$css = $css . $iconsCss;
172
-		}
173
-
174
-		$response = new DataDisplayResponse($css, Http::STATUS_OK, ['Content-Type' => 'text/css']);
175
-
176
-		// Set cache control
177
-		$ttl = 31536000;
178
-		$response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable');
179
-		$expires = new \DateTime();
180
-		$expires->setTimestamp($this->timeFactory->getTime());
181
-		$expires->add(new \DateInterval('PT' . $ttl . 'S'));
182
-		$response->addHeader('Expires', $expires->format(\DateTime::RFC1123));
183
-		$response->addHeader('Pragma', 'cache');
184
-
185
-		return $response;
186
-	}
187
-
188
-	/**
189
-	 * @NoCSRFRequired
190
-	 * @PublicPage
191
-	 *
192
-	 * @return DataDownloadResponse
193
-	 */
194
-	public function getJavascript(): DataDownloadResponse {
195
-		$responseJS = '(function() {
44
+    /** @var string */
45
+    protected $appName;
46
+
47
+    /** @var string */
48
+    protected $serverRoot;
49
+
50
+    /** @var IConfig */
51
+    private $config;
52
+
53
+    /** @var IUserManager */
54
+    private $userManager;
55
+
56
+    /** @var ILogger */
57
+    private $logger;
58
+
59
+    /** @var IURLGenerator */
60
+    private $urlGenerator;
61
+
62
+    /** @var ITimeFactory */
63
+    protected $timeFactory;
64
+
65
+    /** @var IUserSession */
66
+    private $userSession;
67
+
68
+    /** @var IAppManager */
69
+    private $appManager;
70
+
71
+    /** @var IconsCacher */
72
+    protected $iconsCacher;
73
+
74
+    /** @var \OC_Defaults */
75
+    private $defaults;
76
+
77
+    /** @var null|string */
78
+    private $injectedVariables;
79
+
80
+    /**
81
+     * Account constructor.
82
+     *
83
+     * @param string $appName
84
+     * @param IRequest $request
85
+     * @param IConfig $config
86
+     * @param IUserManager $userManager
87
+     * @param ILogger $logger
88
+     * @param IURLGenerator $urlGenerator
89
+     * @param ITimeFactory $timeFactory
90
+     * @param IUserSession $userSession
91
+     * @param IAppManager $appManager
92
+     * @param \OC_Defaults $defaults
93
+     */
94
+    public function __construct(string $appName,
95
+                                IRequest $request,
96
+                                IConfig $config,
97
+                                IUserManager $userManager,
98
+                                ILogger $logger,
99
+                                IURLGenerator $urlGenerator,
100
+                                ITimeFactory $timeFactory,
101
+                                IUserSession $userSession,
102
+                                IAppManager $appManager,
103
+                                IconsCacher $iconsCacher,
104
+                                \OC_Defaults $defaults) {
105
+        parent::__construct($appName, $request);
106
+        $this->appName      = $appName;
107
+        $this->config       = $config;
108
+        $this->userManager  = $userManager;
109
+        $this->logger       = $logger;
110
+        $this->urlGenerator = $urlGenerator;
111
+        $this->timeFactory  = $timeFactory;
112
+        $this->userSession  = $userSession;
113
+        $this->appManager   = $appManager;
114
+        $this->iconsCacher  = $iconsCacher;
115
+        $this->defaults     = $defaults;
116
+
117
+        $this->serverRoot = \OC::$SERVERROOT;
118
+        $this->appRoot    = $this->appManager->getAppPath($this->appName);
119
+    }
120
+
121
+    /**
122
+     * @NoAdminRequired
123
+     * @NoCSRFRequired
124
+     *
125
+     * @return DataDisplayResponse
126
+     */
127
+    public function getCss(): DataDisplayResponse {
128
+        $css        = '';
129
+        $imports    = '';
130
+        $userValues = $this->getUserValues();
131
+
132
+        foreach ($userValues as $key => $scssFile) {
133
+            if ($scssFile !== false) {
134
+                $imports .= '@import "' . $scssFile . '";';
135
+            }
136
+        }
137
+
138
+        if ($imports !== '') {
139
+            $scss = new Compiler();
140
+            $scss->setImportPaths([
141
+                $this->appRoot . '/css/',
142
+                $this->serverRoot . '/core/css/'
143
+            ]);
144
+
145
+            // Continue after throw
146
+            $scss->setIgnoreErrors(true);
147
+            $scss->setFormatter(Crunched::class);
148
+
149
+            // Import theme, variables and compile css4 variables
150
+            try {
151
+                $css .= $scss->compile(
152
+                    $imports .
153
+                    $this->getInjectedVariables() .
154
+                    '@import "variables.scss";' .
155
+                    '@import "css-variables.scss";'
156
+                );
157
+            } catch (ParserException $e) {
158
+                $this->logger->error($e->getMessage(), ['app' => 'core']);
159
+            }
160
+        }
161
+
162
+        // We don't want to override vars with url since path is different
163
+        $css = $this->filterOutRule('/--[a-z-:]+url\([^;]+\)/mi', $css);
164
+
165
+        // Rebase all urls
166
+        $appWebRoot = substr($this->appRoot, strlen($this->serverRoot) - strlen(\OC::$WEBROOT));
167
+        $css        = $this->rebaseUrls($css, $appWebRoot . '/css');
168
+
169
+        if (in_array('themedark', $userValues) && $this->iconsCacher->getCachedCSS() && $this->iconsCacher->getCachedCSS()->getSize() > 0) {
170
+            $iconsCss = $this->invertSvgIconsColor($this->iconsCacher->getCachedCSS()->getContent());
171
+            $css = $css . $iconsCss;
172
+        }
173
+
174
+        $response = new DataDisplayResponse($css, Http::STATUS_OK, ['Content-Type' => 'text/css']);
175
+
176
+        // Set cache control
177
+        $ttl = 31536000;
178
+        $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable');
179
+        $expires = new \DateTime();
180
+        $expires->setTimestamp($this->timeFactory->getTime());
181
+        $expires->add(new \DateInterval('PT' . $ttl . 'S'));
182
+        $response->addHeader('Expires', $expires->format(\DateTime::RFC1123));
183
+        $response->addHeader('Pragma', 'cache');
184
+
185
+        return $response;
186
+    }
187
+
188
+    /**
189
+     * @NoCSRFRequired
190
+     * @PublicPage
191
+     *
192
+     * @return DataDownloadResponse
193
+     */
194
+    public function getJavascript(): DataDownloadResponse {
195
+        $responseJS = '(function() {
196 196
 	OCA.Accessibility = {
197 197
 		theme: ' . json_encode($this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false)) . ',
198 198
 		
199 199
 	};
200 200
 })();';
201
-		$response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript');
202
-		$response->cacheFor(3600);
203
-		return $response;
204
-	}
205
-
206
-	/**
207
-	 * Return an array with the user theme & font settings
208
-	 *
209
-	 * @return array
210
-	 */
211
-	private function getUserValues(): array{
212
-		$userTheme = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false);
213
-		$userFont  = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false);
214
-
215
-		return [$userTheme, $userFont];
216
-	}
217
-
218
-	/**
219
-	 * Remove all matches from the $rule regex
220
-	 *
221
-	 * @param string $rule regex to match
222
-	 * @param string $css string to parse
223
-	 * @return string
224
-	 */
225
-	private function filterOutRule(string $rule, string $css): string {
226
-		return preg_replace($rule, '', $css);
227
-	}
228
-
229
-	/**
230
-	 * Add the correct uri prefix to make uri valid again
231
-	 *
232
-	 * @param string $css
233
-	 * @param string $webDir
234
-	 * @return string
235
-	 */
236
-	private function rebaseUrls(string $css, string $webDir): string {
237
-		$re    = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x';
238
-		$subst = 'url(\'' . $webDir . '/$1\')';
239
-
240
-		return preg_replace($re, $subst, $css);
241
-	}
242
-
243
-	/**
244
-	 * Remove all matches from the $rule regex
245
-	 *
246
-	 * @param string $css string to parse
247
-	 * @return string
248
-	 */
249
-	private function invertSvgIconsColor(string $css) {
250
-		return str_replace(['/000', '/fff', '/***'], ['/***', '/000', '/fff'], $css);
251
-	}
252
-
253
-	/**
254
-	 * @return string SCSS code for variables from OC_Defaults
255
-	 */
256
-	private function getInjectedVariables(): string {
257
-		if ($this->injectedVariables !== null) {
258
-			return $this->injectedVariables;
259
-		}
260
-		$variables = '';
261
-		foreach ($this->defaults->getScssVariables() as $key => $value) {
262
-			$variables .= '$' . $key . ': ' . $value . ';';
263
-		}
264
-
265
-		// check for valid variables / otherwise fall back to defaults
266
-		try {
267
-			$scss = new Compiler();
268
-			$scss->compile($variables);
269
-			$this->injectedVariables = $variables;
270
-		} catch (ParserException $e) {
271
-			$this->logger->error($e, ['app' => 'core']);
272
-		}
273
-		return $variables;
274
-	}
201
+        $response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript');
202
+        $response->cacheFor(3600);
203
+        return $response;
204
+    }
205
+
206
+    /**
207
+     * Return an array with the user theme & font settings
208
+     *
209
+     * @return array
210
+     */
211
+    private function getUserValues(): array{
212
+        $userTheme = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false);
213
+        $userFont  = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false);
214
+
215
+        return [$userTheme, $userFont];
216
+    }
217
+
218
+    /**
219
+     * Remove all matches from the $rule regex
220
+     *
221
+     * @param string $rule regex to match
222
+     * @param string $css string to parse
223
+     * @return string
224
+     */
225
+    private function filterOutRule(string $rule, string $css): string {
226
+        return preg_replace($rule, '', $css);
227
+    }
228
+
229
+    /**
230
+     * Add the correct uri prefix to make uri valid again
231
+     *
232
+     * @param string $css
233
+     * @param string $webDir
234
+     * @return string
235
+     */
236
+    private function rebaseUrls(string $css, string $webDir): string {
237
+        $re    = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x';
238
+        $subst = 'url(\'' . $webDir . '/$1\')';
239
+
240
+        return preg_replace($re, $subst, $css);
241
+    }
242
+
243
+    /**
244
+     * Remove all matches from the $rule regex
245
+     *
246
+     * @param string $css string to parse
247
+     * @return string
248
+     */
249
+    private function invertSvgIconsColor(string $css) {
250
+        return str_replace(['/000', '/fff', '/***'], ['/***', '/000', '/fff'], $css);
251
+    }
252
+
253
+    /**
254
+     * @return string SCSS code for variables from OC_Defaults
255
+     */
256
+    private function getInjectedVariables(): string {
257
+        if ($this->injectedVariables !== null) {
258
+            return $this->injectedVariables;
259
+        }
260
+        $variables = '';
261
+        foreach ($this->defaults->getScssVariables() as $key => $value) {
262
+            $variables .= '$' . $key . ': ' . $value . ';';
263
+        }
264
+
265
+        // check for valid variables / otherwise fall back to defaults
266
+        try {
267
+            $scss = new Compiler();
268
+            $scss->compile($variables);
269
+            $this->injectedVariables = $variables;
270
+        } catch (ParserException $e) {
271
+            $this->logger->error($e, ['app' => 'core']);
272
+        }
273
+        return $variables;
274
+    }
275 275
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.