-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Prettify the output of Zend\Code\Generator\ValueGenerator for multi line arrays #5616
Prettify the output of Zend\Code\Generator\ValueGenerator for multi line arrays #5616
Conversation
@RalfEggert Update the unit tests please, there are some fails https://travis-ci.org/zendframework/zf2/jobs/15495156#L281 |
Sorry, forgot about that. The unit tests are fixed now... |
To be honest, I don't really understand what failed there... :-( |
@RalfEggert the closing parenthesis of the expected value is indended 4 spaces to much. https://github.com/RalfEggert/zf2/blob/0413da7532bc8e28e18527af18ac1ad9875cfb90/tests/ZendTest/Code/Generator/PropertyGeneratorTest.php#L108 |
@Netiul Thanks, I just checked the ValueGeneratorTest and missed that one. Now it should work... |
$expectedSource = <<<EOS | ||
array( | ||
'foo' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the close parenthesis should not be indented
…tify Prettify the output of Zend\Code\Generator\ValueGenerator for multi line arrays
[#5616] Adapt array indentation to PSR-2 guidelines by default
Based on new tests and links to relevant specifications, the code from #5608 was invalid; header lines may never start with whitespace. This patch reverts that code, and updates the `fromString()` logic to capture whitespace on subsequent lines to include in the multi-line header value. Tests have been updated where necessary to use a regex for testing the existence of whitespace between multiline values.
Forward port #5616 Conflicts: tests/ZendTest/Http/Response/ResponseStreamTest.php tests/ZendTest/Http/ResponseTest.php
…dframework#5608 Based on new tests and links to relevant specifications, the code from zendframework/zendframework#5608 was invalid; header lines may never start with whitespace. This patch reverts that code, and updates the `fromString()` logic to capture whitespace on subsequent lines to include in the multi-line header value. Tests have been updated where necessary to use a regex for testing the existence of whitespace between multiline values.
Forward port zendframework/zendframework#5616 Conflicts: tests/ZendTest/Http/Response/ResponseStreamTest.php tests/ZendTest/Http/ResponseTest.php
This fix prettifies the output for multi line arrays generated with
Zend\Code\Generator\ValueGenerator
Without this fix, an array looks like this.
With the fix, the same array will look like this:
Please note the changes for the entry for 'view_manager' and the positions of the braces.