Skip to content

Conversation

@moufmouf
Copy link
Contributor

Hi Thomas!

I've been facing a problem using the setDefaultValue() method with non empty arrays.

So far, the code

$property = new PhpProperty('fooArray'); $property->setDefaultValue(array("some value"));

would fail to generate

public $fooArray = array('some value');

Instead, it would generate:

public $fooArray = array();

This pull-request contains a fix (and a new unit-test case).

Thanks for your work man!

@gossi
Copy link
Member

gossi commented Mar 23, 2015

Hey @moufmouf,

great catch, I'm on this next week to merge your pr.

Thanks a lot!

gossi added a commit that referenced this pull request May 15, 2015
Making sure a default value for a property or parameter can contain a non empty array.
@gossi gossi merged commit c5b1fc4 into phpowermove:master May 15, 2015
@gossi
Copy link
Member

gossi commented May 15, 2015

Thanks @moufmouf
It's now in, although I must admit I'm not that happy about the formatting for arrays ;) However, that's another story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants