Completed
Push — master ( 7ed867...85d12a )
by Jean-Christophe
02:44
created
Ajax/common/html/PropertyWrapper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 			$output=$input;
13 13
 		}
14 14
 		if (\is_array($input)) {
15
-			if (sizeof($input) > 0) {
16
-				if (self::containsElement($input) === false) {
15
+			if (sizeof($input)>0) {
16
+				if (self::containsElement($input)===false) {
17 17
 					$output=self::wrapStrings($input, $separator=' ', $valueQuote='"');
18 18
 				} else {
19 19
 					$output=self::wrapObjects($input, $js, $separator, $valueQuote);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	private static function containsElement($input) {
27
-		foreach ( $input as $v ) {
27
+		foreach ($input as $v) {
28 28
 			if (\is_object($v) || \is_array($v))
29 29
 				return true;
30 30
 		}
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	public static function wrapStrings($input, $separator=' ', $valueQuote='"') {
35
-		if (JArray::isAssociative($input) === true) {
36
-			$result=implode($separator, array_map(function ($v, $k) use($valueQuote) {
37
-				return $k . '=' . $valueQuote . $v . $valueQuote;
35
+		if (JArray::isAssociative($input)===true) {
36
+			$result=implode($separator, array_map(function($v, $k) use($valueQuote) {
37
+				return $k.'='.$valueQuote.$v.$valueQuote;
38 38
 			}, $input, array_keys($input)));
39 39
 		} else {
40 40
 			$result=implode($separator, array_values($input));
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public static function wrapObjects($input, $js=NULL, $separator=' ', $valueQuote='"') {
46
-		return implode($separator, array_map(function ($v) use($js, $separator, $valueQuote) {
46
+		return implode($separator, array_map(function($v) use($js, $separator, $valueQuote) {
47 47
 			if ($v instanceof BaseHtml)
48 48
 				return $v->compile($js);
49 49
 			elseif (\is_array($v)) {
50 50
 				return self::wrap($v, $js, $separator, $valueQuote);
51
-			} elseif(!\is_callable($v))
51
+			} elseif (!\is_callable($v))
52 52
 				return $v;
53 53
 		}, $input));
54 54
 	}
Please login to merge, or discard this patch.