Skip to content

Commit f46c576

Browse files
author
Oleksii Korshenko
authored
MAGETWO-82235: #11328 : app:config:dump adds extra space every time in multiline array value #11452
2 parents be7c4fe + da28c4e commit f46c576

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ class PhpFormatter implements FormatterInterface
2121
public function format($data, array $comments = [])
2222
{
2323
if (!empty($comments) && is_array($data)) {
24-
return "<?php\nreturn array (\n" . $this->formatData($data, $comments, ' ') . "\n);\n";
24+
return "<?php\nreturn array (\n" . $this->formatData($data, $comments) . "\n);\n";
2525
}
2626
return "<?php\nreturn " . var_export($data, true) . ";\n";
2727
}
2828

2929
/**
3030
* Format supplied data
3131
*
32-
* @param $data
33-
* @param $comments
32+
* @param string[] $data
33+
* @param string[] $comments
3434
* @param string $prefix
3535
* @return string
3636
*/
37-
protected function formatData($data, $comments, $prefix = '')
37+
private function formatData($data, $comments = [], $prefix = ' ')
3838
{
3939
$elements = [];
4040

lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfig/Writer/PhpFormatterTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class PhpFormatterTest extends \PHPUnit\Framework\TestCase
1111
{
1212
/**
1313
* @dataProvider formatWithCommentDataProvider
14-
* @param string|array $data
15-
* @param array $comments
14+
* @param string[] $data
15+
* @param string[] $comments
1616
* @param string $expectedResult
1717
*/
1818
public function testFormat($data, $comments, $expectedResult)

0 commit comments

Comments
 (0)