Completed
Push — master ( c40352...ea2e62 )
by Lukas
35:17 queued 20:45
created
apps/theming/lib/Util.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function invertTextColor($color) {
64 64
 		$l = $this->calculateLuminance($color);
65
-		if($l>0.5) {
65
+		if ($l > 0.5) {
66 66
 			return true;
67 67
 		} else {
68 68
 			return false;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function elementColor($color) {
79 79
 		$l = $this->calculateLuminance($color);
80
-		if($l>0.8) {
80
+		if ($l > 0.8) {
81 81
 			return '#555555';
82 82
 		} else {
83 83
 			return $color;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	public function calculateLuminance($color) {
92 92
 		$hex = preg_replace("/[^0-9A-Fa-f]/", '', $color);
93 93
 		if (strlen($hex) === 3) {
94
-			$hex = $hex{0} . $hex{0} . $hex{1} . $hex{1} . $hex{2} . $hex{2};
94
+			$hex = $hex{0}.$hex{0}.$hex{1}.$hex{1}.$hex{2}.$hex{2};
95 95
 		}
96 96
 		if (strlen($hex) !== 6) {
97 97
 			return 0;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$blue = hexdec(substr($hex, 4, 2));
102 102
 		$compiler = new Compiler();
103 103
 		$hsl = $compiler->toHSL($red, $green, $blue);
104
-		return $hsl[3]/100;
104
+		return $hsl[3] / 100;
105 105
 	}
106 106
 
107 107
 	/**
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @return string base64 encoded radio button svg
110 110
 	 */
111 111
 	public function generateRadioButton($color) {
112
-		$radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">' .
112
+		$radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">'.
113 113
 			'<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>';
114 114
 		return base64_encode($radioButtonIcon);
115 115
 	}
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 		$app = str_replace(array('\0', '/', '\\', '..'), '', $app);
124 124
 		try {
125 125
 			$appPath = $this->appManager->getAppPath($app);
126
-			$icon = $appPath . '/img/' . $app . '.svg';
126
+			$icon = $appPath.'/img/'.$app.'.svg';
127 127
 			if (file_exists($icon)) {
128 128
 				return $icon;
129 129
 			}
130
-			$icon = $appPath . '/img/app.svg';
130
+			$icon = $appPath.'/img/app.svg';
131 131
 			if (file_exists($icon)) {
132 132
 				return $icon;
133 133
 			}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 				}
143 143
 			} catch (NotFoundException $e) {}
144 144
 		}
145
-		return \OC::$SERVERROOT . '/core/img/logo.svg';
145
+		return \OC::$SERVERROOT.'/core/img/logo.svg';
146 146
 	}
147 147
 
148 148
 	/**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		$app = str_replace(array('\0', '/', '\\', '..'), '', $app);
155 155
 		$image = str_replace(array('\0', '\\', '..'), '', $image);
156 156
 		if ($app === "core") {
157
-			$icon = \OC::$SERVERROOT . '/core/img/' . $image;
157
+			$icon = \OC::$SERVERROOT.'/core/img/'.$image;
158 158
 			if (file_exists($icon)) {
159 159
 				return $icon;
160 160
 			}
@@ -166,23 +166,23 @@  discard block
 block discarded – undo
166 166
 			return false;
167 167
 		}
168 168
 
169
-		$icon = $appPath . '/img/' . $image;
169
+		$icon = $appPath.'/img/'.$image;
170 170
 		if (file_exists($icon)) {
171 171
 			return $icon;
172 172
 		}
173
-		$icon = $appPath . '/img/' . $image . '.svg';
173
+		$icon = $appPath.'/img/'.$image.'.svg';
174 174
 		if (file_exists($icon)) {
175 175
 			return $icon;
176 176
 		}
177
-		$icon = $appPath . '/img/' . $image . '.png';
177
+		$icon = $appPath.'/img/'.$image.'.png';
178 178
 		if (file_exists($icon)) {
179 179
 			return $icon;
180 180
 		}
181
-		$icon = $appPath . '/img/' . $image . '.gif';
181
+		$icon = $appPath.'/img/'.$image.'.gif';
182 182
 		if (file_exists($icon)) {
183 183
 			return $icon;
184 184
 		}
185
-		$icon = $appPath . '/img/' . $image . '.jpg';
185
+		$icon = $appPath.'/img/'.$image.'.jpg';
186 186
 		if (file_exists($icon)) {
187 187
 			return $icon;
188 188
 		}
Please login to merge, or discard this patch.