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

Update EM->trigerUntil to be an alias of trigger #4122

Conversation

EvanDotPro
Copy link
Member

They contained the exact same code/logic. The only difference was the
conditional around checking if the callback was valid, but the outcome
is the same for both. This simply reduces duplicate code and causes no
change in behavior at all.

They contained the exact same code/logic. The only difference was the
conditional around checking if the callback was valid, but the outcome
is the same for both. This simply reduces duplicate code and causes no
change in behavior at all.
@marc-mabe
Copy link
Member

The method triggerUntil should be marked as deprecated because it lost it's sense

@prolic
Copy link
Contributor

prolic commented Mar 26, 2013

Agree with @marc-mabe . Please deprecate the triggerUntil method

@EvanDotPro EvanDotPro closed this Mar 27, 2013
@EvanDotPro EvanDotPro reopened this Mar 27, 2013
}

return $this->triggerListeners($event, $e, $callback);
trigger_error(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll either have to update the tests that call triggerUntil() to ignore the warning, or remove them; the test suite breaks mightily currently!

@weierophinney
Copy link
Member

ping @EvanDotPro ... fix the deprecation notices... :)

@weierophinney
Copy link
Member

Closing due to inactivity. @EvanDotPro feel free to re-open or open a new PR when you're able to fix the issues.

@j-schumann
Copy link

Please reactivate this issue as triggerUntil has additional flaws:

The signature states triggerUntil($event, $target, $argv = null, $callback = null) but the callback should not be optional as it's the reason for this function.
Also calling with $argv = null as seems possible from the signature results in Event parameters must be an array or object; received "NULL", it should be ..., $argv = array(), ... like in the trigger() signature.

@weierophinney
Copy link
Member

Marked as a BC break, as it emits a deprecation notice (which can and does break unit tests on code that exercises the method!).

gianarb pushed a commit to zendframework/zend-eventmanager that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-session 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.

6 participants