@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @throws Exception |
| 87 | 87 | * @since 1.0.4 |
| 88 | 88 | */ |
| 89 | - protected static function generateContentArray($contentRows, array $keys, $generateHeader = true, $options = []) |
|
| 89 | + protected static function generateContentArray($contentRows, array $keys, $generateHeader = true, $options = []) |
|
| 90 | 90 | { |
| 91 | 91 | if (is_scalar($contentRows)) { |
| 92 | 92 | throw new Exception("Content must be either an array, object or traversable."); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | $output = null; |
| 161 | 161 | foreach ($input as $row) { |
| 162 | - $output.= self::generateRow($row, $delimiter, '"'); |
|
| 162 | + $output .= self::generateRow($row, $delimiter, '"'); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | return $output; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | protected static function generateRow(array $row, $delimiter, $enclose) |
| 178 | 178 | { |
| 179 | - array_walk($row, function (&$item) use ($enclose) { |
|
| 179 | + array_walk($row, function(&$item) use ($enclose) { |
|
| 180 | 180 | if (is_bool($item)) { |
| 181 | 181 | $item = (int) $item; |
| 182 | 182 | } elseif (is_null($item)) { |
@@ -191,6 +191,6 @@ discard block |
||
| 191 | 191 | ], $item).$enclose; |
| 192 | 192 | }); |
| 193 | 193 | |
| 194 | - return implode($delimiter, $row) . PHP_EOL; |
|
| 194 | + return implode($delimiter, $row).PHP_EOL; |
|
| 195 | 195 | } |
| 196 | 196 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @param bool $header |
| 42 | 42 | * @param array $options Options {@since 1.8.0} |
| 43 | 43 | * + `sort`: boolean, whether they row should be sorted by its keys, default is true. |
| 44 | - * @return mixed |
|
| 44 | + * @return string |
|
| 45 | 45 | * @throws Exception |
| 46 | 46 | * @since 1.0.4 |
| 47 | 47 | */ |
@@ -77,7 +77,6 @@ discard block |
||
| 77 | 77 | * Generate content by rows. |
| 78 | 78 | * |
| 79 | 79 | * @param array $contentRows |
| 80 | - * @param string $delimiter |
|
| 81 | 80 | * @param array $keys |
| 82 | 81 | * @param bool $generateHeader |
| 83 | 82 | * @param array $options Options {@since 1.8.0} |