Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[#5616] Adapt array indentation to PSR-2 guidelines by default #5907

Merged
merged 1 commit into from

2 participants

@Maks3w
Collaborator

No description provided.

@Maks3w Maks3w added this to the 2.3.0 milestone
@weierophinney weierophinney merged commit cb0164b into zendframework:develop

1 check failed

Details default The Travis CI build failed
@weierophinney weierophinney self-assigned this
@Maks3w Maks3w deleted the unknown repository branch
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
2  library/Zend/Code/Generator/PropertyValueGenerator.php
@@ -11,6 +11,8 @@
class PropertyValueGenerator extends ValueGenerator
{
+ protected $arrayDepth = 1;
+
/**
* @return string
*/
View
2  library/Zend/Code/Generator/ValueGenerator.php
@@ -48,7 +48,7 @@ class ValueGenerator extends AbstractGenerator
/**
* @var int
*/
- protected $arrayDepth = 1;
+ protected $arrayDepth = 0;
/**
* @var string
View
46 tests/ZendTest/Code/Generator/ValueGeneratorTest.php
@@ -42,8 +42,8 @@ public function testPropertyDefaultValueCanHandleArray()
{
$expectedSource = <<<EOS
array(
- 'foo'
- )
+ 'foo'
+)
EOS;
$valueGenerator = new ValueGenerator();
@@ -89,22 +89,22 @@ public function testPropertyDefaultValueCanHandleComplexArrayOfTypes()
$expectedSource = <<<EOS
array(
- 5,
- 'one' => 1,
- 'two' => '2',
- 'constant1' => __DIR__ . '/anydir1/anydir2',
+ 5,
+ 'one' => 1,
+ 'two' => '2',
+ 'constant1' => __DIR__ . '/anydir1/anydir2',
+ array(
+ 'baz' => true,
+ 'foo',
+ 'bar',
array(
- 'baz' => true,
- 'foo',
- 'bar',
- array(
- 'baz1',
- 'baz2',
- 'constant2' => ArrayObject::STD_PROP_LIST
- )
- ),
- PHP_EOL
- )
+ 'baz1',
+ 'baz2',
+ 'constant2' => ArrayObject::STD_PROP_LIST
+ )
+ ),
+ PHP_EOL
+)
EOS;
$valueGenerator = new ValueGenerator();
@@ -128,12 +128,12 @@ public function testPropertyDefaultValueCanHandleArrayWithUnsortedKeys()
$valueGenerator->setValue($value);
$expectedSource = <<<EOS
array(
- 1 => 'a',
- 0 => 'b',
- 'c',
- 7 => 'd',
- 3 => 'e'
- )
+ 1 => 'a',
+ 0 => 'b',
+ 'c',
+ 7 => 'd',
+ 3 => 'e'
+)
EOS;
$this->assertEquals($expectedSource, $valueGenerator->generate());
Something went wrong with that request. Please try again.