Completed
Push — master ( 0afb03...b5753d )
by Morris
14:32
created
apps/theming/lib/ThemingDefaults.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@
 block discarded – undo
305 305
 	 *
306 306
 	 * @param string $app name of the app
307 307
 	 * @param string $image filename of the image
308
-	 * @return bool|string false if image should not replaced, otherwise the location of the image
308
+	 * @return string|false false if image should not replaced, otherwise the location of the image
309 309
 	 */
310 310
 	public function replaceImagePath($app, $image) {
311 311
 		if ($app === '' || $app === 'files_sharing') {
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -141,47 +141,47 @@  discard block
 block discarded – undo
141 141
 	}
142 142
 
143 143
 	public function getImprintUrl() {
144
-		return (string)$this->config->getAppValue('theming', 'imprintUrl', '');
144
+		return (string) $this->config->getAppValue('theming', 'imprintUrl', '');
145 145
 	}
146 146
 
147 147
 	public function getPrivacyUrl() {
148
-		return (string)$this->config->getAppValue('theming', 'privacyUrl', '');
148
+		return (string) $this->config->getAppValue('theming', 'privacyUrl', '');
149 149
 	}
150 150
 
151 151
 	public function getShortFooter() {
152 152
 		$slogan = $this->getSlogan();
153 153
 		$baseUrl = $this->getBaseUrl();
154 154
 		if ($baseUrl !== '') {
155
-			$footer = '<a href="' . $baseUrl . '" target="_blank"' .
156
-				' rel="noreferrer noopener" class="entity-name">' . $this->getEntity() . '</a>';
155
+			$footer = '<a href="'.$baseUrl.'" target="_blank"'.
156
+				' rel="noreferrer noopener" class="entity-name">'.$this->getEntity().'</a>';
157 157
 		} else {
158
-			$footer = '<span class="entity-name">' .$this->getEntity() . '</span>';
158
+			$footer = '<span class="entity-name">'.$this->getEntity().'</span>';
159 159
 		}
160
-		$footer .= ($slogan !== '' ? ' – ' . $slogan : '');
160
+		$footer .= ($slogan !== '' ? ' – '.$slogan : '');
161 161
 
162 162
 		$links = [
163 163
 			[
164 164
 				'text' => $this->l->t('Legal notice'),
165
-				'url' => (string)$this->getImprintUrl()
165
+				'url' => (string) $this->getImprintUrl()
166 166
 			],
167 167
 			[
168 168
 				'text' => $this->l->t('Privacy policy'),
169
-				'url' => (string)$this->getPrivacyUrl()
169
+				'url' => (string) $this->getPrivacyUrl()
170 170
 			],
171 171
 		];
172 172
 
173 173
 		$legalLinks = ''; $divider = '';
174
-		foreach($links as $link) {
175
-			if($link['url'] !== ''
174
+		foreach ($links as $link) {
175
+			if ($link['url'] !== ''
176 176
 				&& filter_var($link['url'], FILTER_VALIDATE_URL)
177 177
 			) {
178
-				$legalLinks .= $divider . '<a href="' . $link['url'] . '" class="legal" target="_blank"' .
179
-					' rel="noreferrer noopener">' . $link['text'] . '</a>';
178
+				$legalLinks .= $divider.'<a href="'.$link['url'].'" class="legal" target="_blank"'.
179
+					' rel="noreferrer noopener">'.$link['text'].'</a>';
180 180
 				$divider = ' · ';
181 181
 			}
182 182
 		}
183
-		if($legalLinks !== '' ) {
184
-			$footer .= '<br/>' . $legalLinks;
183
+		if ($legalLinks !== '') {
184
+			$footer .= '<br/>'.$legalLinks;
185 185
 		}
186 186
 
187 187
 		return $footer;
@@ -214,16 +214,16 @@  discard block
 block discarded – undo
214 214
 
215 215
 		$cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0');
216 216
 
217
-		if(!$logo || !$logoExists) {
218
-			if($useSvg) {
217
+		if (!$logo || !$logoExists) {
218
+			if ($useSvg) {
219 219
 				$logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg');
220 220
 			} else {
221 221
 				$logo = $this->urlGenerator->imagePath('core', 'logo/logo.png');
222 222
 			}
223
-			return $logo . '?v=' . $cacheBusterCounter;
223
+			return $logo.'?v='.$cacheBusterCounter;
224 224
 		}
225 225
 
226
-		return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]);
226
+		return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter]);
227 227
 	}
228 228
 
229 229
 	/**
@@ -261,17 +261,17 @@  discard block
 block discarded – undo
261 261
 	 * @return array scss variables to overwrite
262 262
 	 */
263 263
 	public function getScssVariables() {
264
-		$cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl());
264
+		$cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl());
265 265
 		if ($value = $cache->get('getScssVariables')) {
266 266
 			return $value;
267 267
 		}
268 268
 
269 269
 		$variables = [
270
-			'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'",
271
-			'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime') . "'",
272
-			'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime') . "'",
273
-			'theming-logoheader-mime' => "'" . $this->config->getAppValue('theming', 'logoheaderMime') . "'",
274
-			'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'"
270
+			'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'",
271
+			'theming-logo-mime' => "'".$this->config->getAppValue('theming', 'logoMime')."'",
272
+			'theming-background-mime' => "'".$this->config->getAppValue('theming', 'backgroundMime')."'",
273
+			'theming-logoheader-mime' => "'".$this->config->getAppValue('theming', 'logoheaderMime')."'",
274
+			'theming-favicon-mime' => "'".$this->config->getAppValue('theming', 'faviconMime')."'"
275 275
 		];
276 276
 
277 277
 		$variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')";
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 		}
292 292
 
293 293
 		$variables['has-legal-links'] = 'false';
294
-		if($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') {
294
+		if ($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') {
295 295
 			$variables['has-legal-links'] = 'true';
296 296
 		}
297 297
 
@@ -320,19 +320,19 @@  discard block
 block discarded – undo
320 320
 		}
321 321
 
322 322
 		if ($image === 'favicon.ico' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
323
-			return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue;
323
+			return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]).'?v='.$cacheBusterValue;
324 324
 		}
325 325
 		if ($image === 'favicon-touch.png' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
326
-			return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue;
326
+			return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]).'?v='.$cacheBusterValue;
327 327
 		}
328 328
 		if ($image === 'manifest.json') {
329 329
 			try {
330 330
 				$appPath = $this->appManager->getAppPath($app);
331
-				if (file_exists($appPath . '/img/manifest.json')) {
331
+				if (file_exists($appPath.'/img/manifest.json')) {
332 332
 					return false;
333 333
 				}
334 334
 			} catch (AppPathNotFoundException $e) {}
335
-			return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue;
335
+			return $this->urlGenerator->linkToRoute('theming.Theming.getManifest').'?v='.$cacheBusterValue;
336 336
 		}
337 337
 		return false;
338 338
 	}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	 */
343 343
 	private function increaseCacheBuster() {
344 344
 		$cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0');
345
-		$this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1);
345
+		$this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1);
346 346
 		$this->cacheFactory->createDistributed('theming-')->clear();
347 347
 		$this->cacheFactory->createDistributed('imagePath')->clear();
348 348
 
Please login to merge, or discard this patch.