Passed
Push — master ( 87fbaf...0d825c )
by Christoph
17:33 queued 07:56
created
apps/theming/lib/Util.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public function invertTextColor($color) {
65 65
 		$l = $this->calculateLuma($color);
66
-		if($l>0.6) {
66
+		if ($l > 0.6) {
67 67
 			return true;
68 68
 		} else {
69 69
 			return false;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function elementColor($color) {
80 80
 		$l = $this->calculateLuminance($color);
81
-		if($l>0.8) {
81
+		if ($l > 0.8) {
82 82
 			return '#aaaaaa';
83 83
 		}
84 84
 		return $color;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		list($red, $green, $blue) = $this->hexToRGB($color);
93 93
 		$compiler = new Compiler();
94 94
 		$hsl = $compiler->toHSL($red, $green, $blue);
95
-		return $hsl[3]/100;
95
+		return $hsl[3] / 100;
96 96
 	}
97 97
 
98 98
 	/**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function calculateLuma($color) {
103 103
 		list($red, $green, $blue) = $this->hexToRGB($color);
104
-		return (0.2126 * $red  + 0.7152 * $green + 0.0722 * $blue) / 255;
104
+		return (0.2126 * $red + 0.7152 * $green + 0.0722 * $blue) / 255;
105 105
 	}
106 106
 
107 107
 	/**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	public function hexToRGB($color) {
112 112
 		$hex = preg_replace("/[^0-9A-Fa-f]/", '', $color);
113 113
 		if (strlen($hex) === 3) {
114
-			$hex = $hex{0} . $hex{0} . $hex{1} . $hex{1} . $hex{2} . $hex{2};
114
+			$hex = $hex{0}.$hex{0}.$hex{1}.$hex{1}.$hex{2}.$hex{2};
115 115
 		}
116 116
 		if (strlen($hex) !== 6) {
117 117
 			return 0;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return string base64 encoded radio button svg
129 129
 	 */
130 130
 	public function generateRadioButton($color) {
131
-		$radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">' .
131
+		$radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">'.
132 132
 			'<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="'.$color.'"/></svg>';
133 133
 		return base64_encode($radioButtonIcon);
134 134
 	}
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 		$app = str_replace(array('\0', '/', '\\', '..'), '', $app);
143 143
 		try {
144 144
 			$appPath = $this->appManager->getAppPath($app);
145
-			$icon = $appPath . '/img/' . $app . '.svg';
145
+			$icon = $appPath.'/img/'.$app.'.svg';
146 146
 			if (file_exists($icon)) {
147 147
 				return $icon;
148 148
 			}
149
-			$icon = $appPath . '/img/app.svg';
149
+			$icon = $appPath.'/img/app.svg';
150 150
 			if (file_exists($icon)) {
151 151
 				return $icon;
152 152
 			}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 				}
162 162
 			} catch (NotFoundException $e) {}
163 163
 		}
164
-		return \OC::$SERVERROOT . '/core/img/logo/logo.svg';
164
+		return \OC::$SERVERROOT.'/core/img/logo/logo.svg';
165 165
 	}
166 166
 
167 167
 	/**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		$app = str_replace(array('\0', '/', '\\', '..'), '', $app);
174 174
 		$image = str_replace(array('\0', '\\', '..'), '', $image);
175 175
 		if ($app === "core") {
176
-			$icon = \OC::$SERVERROOT . '/core/img/' . $image;
176
+			$icon = \OC::$SERVERROOT.'/core/img/'.$image;
177 177
 			if (file_exists($icon)) {
178 178
 				return $icon;
179 179
 			}
@@ -185,23 +185,23 @@  discard block
 block discarded – undo
185 185
 			return false;
186 186
 		}
187 187
 
188
-		$icon = $appPath . '/img/' . $image;
188
+		$icon = $appPath.'/img/'.$image;
189 189
 		if (file_exists($icon)) {
190 190
 			return $icon;
191 191
 		}
192
-		$icon = $appPath . '/img/' . $image . '.svg';
192
+		$icon = $appPath.'/img/'.$image.'.svg';
193 193
 		if (file_exists($icon)) {
194 194
 			return $icon;
195 195
 		}
196
-		$icon = $appPath . '/img/' . $image . '.png';
196
+		$icon = $appPath.'/img/'.$image.'.png';
197 197
 		if (file_exists($icon)) {
198 198
 			return $icon;
199 199
 		}
200
-		$icon = $appPath . '/img/' . $image . '.gif';
200
+		$icon = $appPath.'/img/'.$image.'.gif';
201 201
 		if (file_exists($icon)) {
202 202
 			return $icon;
203 203
 		}
204
-		$icon = $appPath . '/img/' . $image . '.jpg';
204
+		$icon = $appPath.'/img/'.$image.'.jpg';
205 205
 		if (file_exists($icon)) {
206 206
 			return $icon;
207 207
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	}
236 236
 
237 237
 	public function isBackgroundThemed() {
238
-		$backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime',false);
238
+		$backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false);
239 239
 
240 240
 		$backgroundExists = true;
241 241
 		try {
Please login to merge, or discard this patch.