@@ -12,8 +12,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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,7 +43,7 @@ discard block |
||
| 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 (is_object($v)) |
| 48 | 48 | return $v->compile($js); |
| 49 | 49 | elseif (\is_array($v)) { |