Completed
Push — master ( a76855...a14fdd )
by Julius
20:44 queued 10s
created
apps/theming/lib/ThemingDefaults.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -142,49 +142,49 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 
144 144
 	public function getImprintUrl() {
145
-		return (string)$this->config->getAppValue('theming', 'imprintUrl', '');
145
+		return (string) $this->config->getAppValue('theming', 'imprintUrl', '');
146 146
 	}
147 147
 
148 148
 	public function getPrivacyUrl() {
149
-		return (string)$this->config->getAppValue('theming', 'privacyUrl', '');
149
+		return (string) $this->config->getAppValue('theming', 'privacyUrl', '');
150 150
 	}
151 151
 
152 152
 	public function getShortFooter() {
153 153
 		$slogan = $this->getSlogan();
154 154
 		$baseUrl = $this->getBaseUrl();
155 155
 		if ($baseUrl !== '') {
156
-			$footer = '<a href="' . $baseUrl . '" target="_blank"' .
157
-				' rel="noreferrer noopener" class="entity-name">' . $this->getEntity() . '</a>';
156
+			$footer = '<a href="'.$baseUrl.'" target="_blank"'.
157
+				' rel="noreferrer noopener" class="entity-name">'.$this->getEntity().'</a>';
158 158
 		} else {
159
-			$footer = '<span class="entity-name">' .$this->getEntity() . '</span>';
159
+			$footer = '<span class="entity-name">'.$this->getEntity().'</span>';
160 160
 		}
161
-		$footer .= ($slogan !== '' ? ' – ' . $slogan : '');
161
+		$footer .= ($slogan !== '' ? ' – '.$slogan : '');
162 162
 
163 163
 		$links = [
164 164
 			[
165 165
 				'text' => $this->l->t('Legal notice'),
166
-				'url' => (string)$this->getImprintUrl()
166
+				'url' => (string) $this->getImprintUrl()
167 167
 			],
168 168
 			[
169 169
 				'text' => $this->l->t('Privacy policy'),
170
-				'url' => (string)$this->getPrivacyUrl()
170
+				'url' => (string) $this->getPrivacyUrl()
171 171
 			],
172 172
 		];
173 173
 
174 174
 		$legalLinks = ''; $divider = '';
175
-		foreach($links as $link) {
176
-			if($link['url'] !== ''
175
+		foreach ($links as $link) {
176
+			if ($link['url'] !== ''
177 177
 				&& filter_var($link['url'], FILTER_VALIDATE_URL, [
178 178
 					'flags' => FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED
179 179
 				])
180 180
 			) {
181
-				$legalLinks .= $divider . '<a href="' . $link['url'] . '" class="legal" target="_blank"' .
182
-					' rel="noreferrer noopener">' . $link['text'] . '</a>';
181
+				$legalLinks .= $divider.'<a href="'.$link['url'].'" class="legal" target="_blank"'.
182
+					' rel="noreferrer noopener">'.$link['text'].'</a>';
183 183
 				$divider = ' · ';
184 184
 			}
185 185
 		}
186
-		if($legalLinks !== '' ) {
187
-			$footer .= '<br/>' . $legalLinks;
186
+		if ($legalLinks !== '') {
187
+			$footer .= '<br/>'.$legalLinks;
188 188
 		}
189 189
 
190 190
 		return $footer;
@@ -217,16 +217,16 @@  discard block
 block discarded – undo
217 217
 
218 218
 		$cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0');
219 219
 
220
-		if(!$logo || !$logoExists) {
221
-			if($useSvg) {
220
+		if (!$logo || !$logoExists) {
221
+			if ($useSvg) {
222 222
 				$logo = $this->urlGenerator->imagePath('core', 'logo.svg');
223 223
 			} else {
224 224
 				$logo = $this->urlGenerator->imagePath('core', 'logo.png');
225 225
 			}
226
-			return $logo . '?v=' . $cacheBusterCounter;
226
+			return $logo.'?v='.$cacheBusterCounter;
227 227
 		}
228 228
 
229
-		return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]);
229
+		return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter]);
230 230
 	}
231 231
 
232 232
 	/**
@@ -264,17 +264,17 @@  discard block
 block discarded – undo
264 264
 	 * @return array scss variables to overwrite
265 265
 	 */
266 266
 	public function getScssVariables() {
267
-		$cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl());
267
+		$cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl());
268 268
 		if ($value = $cache->get('getScssVariables')) {
269 269
 			return $value;
270 270
 		}
271 271
 
272 272
 		$variables = [
273
-			'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'",
274
-			'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime') . "'",
275
-			'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime') . "'",
276
-			'theming-logoheader-mime' => "'" . $this->config->getAppValue('theming', 'logoheaderMime') . "'",
277
-			'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'"
273
+			'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'",
274
+			'theming-logo-mime' => "'".$this->config->getAppValue('theming', 'logoMime')."'",
275
+			'theming-background-mime' => "'".$this->config->getAppValue('theming', 'backgroundMime')."'",
276
+			'theming-logoheader-mime' => "'".$this->config->getAppValue('theming', 'logoheaderMime')."'",
277
+			'theming-favicon-mime' => "'".$this->config->getAppValue('theming', 'faviconMime')."'"
278 278
 		];
279 279
 
280 280
 		$variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')";
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		}
295 295
 
296 296
 		$variables['has-legal-links'] = 'false';
297
-		if($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') {
297
+		if ($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') {
298 298
 			$variables['has-legal-links'] = 'true';
299 299
 		}
300 300
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	 * @return bool|string false if image should not replaced, otherwise the location of the image
312 312
 	 */
313 313
 	public function replaceImagePath($app, $image) {
314
-		if($app==='') {
314
+		if ($app === '') {
315 315
 			$app = 'core';
316 316
 		}
317 317
 		$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
@@ -323,19 +323,19 @@  discard block
 block discarded – undo
323 323
 		}
324 324
 
325 325
 		if ($image === 'favicon.ico' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
326
-			return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue;
326
+			return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]).'?v='.$cacheBusterValue;
327 327
 		}
328 328
 		if ($image === 'favicon-touch.png' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
329
-			return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue;
329
+			return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]).'?v='.$cacheBusterValue;
330 330
 		}
331 331
 		if ($image === 'manifest.json') {
332 332
 			try {
333 333
 				$appPath = $this->appManager->getAppPath($app);
334
-				if (file_exists($appPath . '/img/manifest.json')) {
334
+				if (file_exists($appPath.'/img/manifest.json')) {
335 335
 					return false;
336 336
 				}
337 337
 			} catch (AppPathNotFoundException $e) {}
338
-			return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue;
338
+			return $this->urlGenerator->linkToRoute('theming.Theming.getManifest').'?v='.$cacheBusterValue;
339 339
 		}
340 340
 		return false;
341 341
 	}
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	 */
346 346
 	private function increaseCacheBuster() {
347 347
 		$cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0');
348
-		$this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1);
348
+		$this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1);
349 349
 		$this->cacheFactory->createDistributed('theming-')->clear();
350 350
 		$this->cacheFactory->createDistributed('imagePath')->clear();
351 351
 
Please login to merge, or discard this patch.