Closed hxss closed 6 years ago
@hxss you mean that multiline-dumped values are not aligned? Doesn't sound like a big deal to me...
@Ocramius please see this example:
$generator = new Zend\Code\Generator\ValueGenerator([
'a' => [
'b' => [
'c' => 'd',
]
],
]);
$generator->setIndentation("\t");
echo $generator->generate();
output:
array(
'a' => array(
'b' => array(
'c' => 'd',
),
),
)
We have 1 tab before 'a'
and 4 spaces as indentation on other levels of tree.
Yeah, this is not fixable, unless we touch the var_export()
output, which we shouldn't do.
This is too much risk (really, it's not that trivial) for a problem in alignment, so I'm going to close it as "won't fix", sorry.
after 363 line need to append $curValue->setIndentation($this->indentation);
https://github.com/zendframework/zend-code/blob/4a7f6785ef0567423a4d68d76986673eb297fac4/src/Generator/ValueGenerator.php#L363
@Ocramius in my test $curValue->setIndentation($this->indentation);
solve the problem.
@hxss send a patch then: re-opening (also: didn't know the value generator could already do that, thanks for checking!)
Please remember to add a test case, if yo do
Handled in #164
On 363 line ValueGenerator creates childs but dont pass to them self indentation. So when I create new ValueGenerator and use
setIndentation
method I can set only first level childs indentation.