Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Simplification #5082

Merged
merged 1 commit into from
Sep 6, 2013
Merged

Simplification #5082

merged 1 commit into from
Sep 6, 2013

Conversation

VitoNordloh
Copy link

No description provided.

@samsonasik
Copy link
Contributor

empty is different with null.

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

@VitoNordloh
Copy link
Author

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
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants