Skip to content

Commit

Permalink
MAGETWO-82235: #11328 : app:config:dump adds extra space every time i…
Browse files Browse the repository at this point in the history
…n multiline array value #11452

 - Merge Pull Request #11452 from adrian-martinez-interactiv4/magento2:FR#11328-APP-CONFIG-DUMP-EXTRA-SPACES
 - Merged commits:
   1. c23f4dc
   2. a79c704
   3. dd7dba1
   4. 1740f62
  • Loading branch information
Oleksii Korshenko committed Oct 24, 2017
2 parents c6e891d + 1740f62 commit da28c4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -21,20 +21,20 @@ class PhpFormatter implements FormatterInterface
public function format($data, array $comments = [])
{
if (!empty($comments) && is_array($data)) {
return "<?php\nreturn array (\n" . $this->formatData($data, $comments, ' ') . "\n);\n";
return "<?php\nreturn array (\n" . $this->formatData($data, $comments) . "\n);\n";
}
return "<?php\nreturn " . var_export($data, true) . ";\n";
}

/**
* Format supplied data
*
* @param $data
* @param $comments
* @param string[] $data
* @param string[] $comments
* @param string $prefix
* @return string
*/
protected function formatData($data, $comments, $prefix = '')
private function formatData($data, $comments = [], $prefix = ' ')
{
$elements = [];

Expand Down
Expand Up @@ -11,8 +11,8 @@ class PhpFormatterTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider formatWithCommentDataProvider
* @param string|array $data
* @param array $comments
* @param string[] $data
* @param string[] $comments
* @param string $expectedResult
*/
public function testFormat($data, $comments, $expectedResult)
Expand Down

0 comments on commit da28c4e

Please sign in to comment.