Skip to content

Commit

Permalink
Fixed #104: Don't fail on short array syntax initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelpichler committed Oct 11, 2012
1 parent e8f4d0b commit d731fa6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/site/docx/changes.xml
Expand Up @@ -13,9 +13,13 @@
date=""
description="">

<action date="2b23ff9" dev="mapi" type="fix" due-to="Karol" issue="95" system="github">
<action date="f6ee217" dev="mapi" type="fix" due-to="Karol" issue="95" system="github">
PHP 5.4 array syntax is not supported in property initialization.
</action>

<action date="" dev="mapi" type="fix" due-to="Tyler Stroud" issue="104" system="github">
Syntax errors reported when PHP 5.4 short array syntax is used in method signatures or class variable definitions.
</action>
</release>

<release version="1.1.0"
Expand Down
Expand Up @@ -45,6 +45,7 @@
* @version SVN: $Id$
* @link https://github.com/pdepend/pdepend/issues/95
* @link https://github.com/pdepend/pdepend/issues/104
* @since 1.1.1
*/

require_once dirname(__FILE__) . '/AbstractTest.php';
Expand All @@ -61,6 +62,7 @@
* @version Release: @package_version@
* @link https://github.com/pdepend/pdepend/issues/95
* @link https://github.com/pdepend/pdepend/issues/104
* @since 1.1.1
*
* @ticket 104
* @ticket 95
Expand All @@ -78,6 +80,16 @@ class PHP_Depend_Bugs_ShortArraySyntaxInitializerBug00000104Test extends PHP_Dep
*/
public function testPropertyDefaultValue()
{
$this->parseCodeResourceForTest();
$this->assertNotNull($this->parseCodeResourceForTest());
}

/**
* testPropertyDefaultValue
*
* @return void
*/
public function testParameterDefaultValue()
{
$this->assertNotNull($this->parseCodeResourceForTest());
}
}
@@ -0,0 +1,7 @@
<?php
class testParameterDefaultValue
{
protected function foo($bar = [ 'a' => array( 'b', [ 23, 42 => 'baz' ] ) ])
{
}
}

0 comments on commit d731fa6

Please sign in to comment.