Simplification #5082

Merged
merged 1 commit into from Sep 6, 2013

Conversation

Projects
None yet
3 participants
@VitoNordloh

No description provided.

@samsonasik

This comment has been minimized.

Show comment
Hide comment
@samsonasik

samsonasik Sep 5, 2013

Contributor

empty is different with null.

$a = '' is empty, but not NULL.
Contributor

samsonasik commented Sep 5, 2013

empty is different with null.

$a = '' is empty, but not NULL.
@VitoNordloh

This comment has been minimized.

Show comment
Hide comment
@VitoNordloh

VitoNordloh Sep 5, 2013

That's right! But not in this context. $params is always an array or null.

An alternative would be

$this->params = is_null($params) ? array() : $params;

or

$this->params = null === $params ? array() : $params;

But empty is a more common way than is_null in ZF. And ... $this->params = null === $params ... is difficult to read.

That's right! But not in this context. $params is always an array or null.

An alternative would be

$this->params = is_null($params) ? array() : $params;

or

$this->params = null === $params ? array() : $params;

But empty is a more common way than is_null in ZF. And ... $this->params = null === $params ... is difficult to read.

weierophinney added a commit that referenced this pull request Sep 6, 2013

weierophinney added a commit that referenced this pull request Sep 6, 2013

@ghost ghost assigned weierophinney Sep 6, 2013

@weierophinney weierophinney merged commit b157742 into zendframework:develop Sep 6, 2013

1 check failed

default The Travis CI build failed
Details

weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015

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