Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSubscribedEvents collected from annotations #48

Closed
mishak87 opened this issue Jun 13, 2014 · 3 comments
Closed

getSubscribedEvents collected from annotations #48

mishak87 opened this issue Jun 13, 2014 · 3 comments

Comments

@mishak87
Copy link
Contributor

This is reminder as @fprochazka requested. Nothing has been done. And so far it is just lets imagine something better discussion. I probably should have moved it to forum.

<?php

/**
* @Event\Subscriber([<class>])
* <class> is set as default for all handlers
*/
class OnEventListener extends Nette\Object
{

    /**
     * @Event\Handler([<class>[::]<event>][ <priority>])
     * <event> defaults to methods name
     * If there is class and event they must be separated by ::.
     * Otherwise it is determined by heuristic if argument is event or class.
     */
    public function onEvent()
    {
        // ...
    }

}
@Majkl578
Copy link
Member

👎 Use trait for building getSubscribedEvents.

@mishak87
Copy link
Contributor Author

I thought about it a bit and IMO it could be done via extension that walks all registered listeners and replaces them with generated extensions with Subscriber interface.

@fprochazka
Copy link
Member

Sorry, but it would be out-of-scope #97 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants