Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

improved interfaces in Zend\EventManager #1108

Merged
merged 2 commits into from May 7, 2012

Conversation

Projects
None yet
4 participants
Contributor

prolic commented Apr 26, 2012

No description provided.

Member

Maks3w commented Apr 26, 2012

What is the motivation of this?

Contributor

prolic commented Apr 26, 2012

We rely on the eventcollection interface, and this interface is missing some methods.

@marc-mabe marc-mabe and 2 others commented on an outdated diff Apr 26, 2012

library/Zend/EventManager/EventCollection.php
+
+ /**
+ * Detach a listener aggregate
+ *
+ * @param ListenerAggregate $aggregate
+ * @return mixed return value of {@link ListenerAggregate::detach()}
+ */
+ public function detachAggregate(ListenerAggregate $aggregate);
+
+ /**
+ * Prepare arguments
+ *
+ * @param array $args
+ * @return ArrayObject
+ */
+ public function prepareArgs(array $args);
@marc-mabe

marc-mabe Apr 26, 2012

Member

Thats only a helper method and should not part of an interface

@prolic

prolic Apr 26, 2012

Contributor

I would agree on this, but I was unsure, so I added it, because it was public. Shall I remove it or keep it like this? Matthew?

@weierophinney

weierophinney Apr 26, 2012

Owner

It's an implementation detail of the concrete EventManager instance -- basically to create a convenience for passing values by reference. It should not be in the interface.

@weierophinney weierophinney commented on the diff May 7, 2012

library/Zend/EventManager/EventManager.php
@@ -59,7 +59,7 @@ class EventManager implements EventCollection, SharedEventCollectionAware
/**
* Shared connections
- * @var false|null|SharedEventCollection
@weierophinney

weierophinney May 7, 2012

Owner

false actually has a special meaning internally, and should not be removed from the signature.

@weierophinney weierophinney merged commit 261f398 into zendframework:master May 7, 2012

Owner

weierophinney commented May 7, 2012

Good call on the interface changes -- I realized immediately on seeing them that we were using non-interface methods in a variety of places.

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