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

Do not throw exception when isset is used on AbstractOptions existing object variable #7342

Conversation

Martin-P
Copy link
Contributor

Same fix as suggested by @rms230 in PR #7287. Split it up and slightly changed the assertion for BadMethodCallException.

Original description of #7287:

When calling isset() on an object variable that is a class extending AbstractOptions an exception is thrown.

An example useage of this is found in the EventManagerAwareTrait where the trait checks a class variable isset, if the class that is using the EventManagerAwareTrait extends AbstractOptions an exception is thrown.

This pull request fixes AbstractOptions by checking that the method exists and that the value is not equal to null, thus stopping the exception being thrown.

@Martin-P
Copy link
Contributor Author

Ping @weierophinney
Just making sure this part of the original PR #7287 is included in the 2.4.0 release too 😃

weierophinney added a commit that referenced this pull request Mar 19, 2015
…e-using-isset

Do not throw exception when isset is used on AbstractOptions existing object variable

Conflicts:
	tests/ZendTest/Stdlib/OptionsTest.php
weierophinney added a commit that referenced this pull request Mar 19, 2015
@weierophinney weierophinney added this to the 2.4.0 milestone Mar 19, 2015
@weierophinney
Copy link
Member

Pushed to develop for release with 2.4; thanks, @Martin-P !

@Martin-P Martin-P deleted the hotfix/abstractoptions-variable-using-isset branch April 4, 2015 15:15
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…fix/abstractoptions-variable-using-isset

Do not throw exception when isset is used on AbstractOptions existing object variable

Conflicts:
	tests/ZendTest/Stdlib/OptionsTest.php
weierophinney added a commit to zendframework/zend-stdlib 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants