{"action":"closed","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/10108","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/10108/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/10108/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/10108/events","html_url":"https://github.com/yiisoft/yii2/issues/10108","id":115457425,"number":10108,"title":"Add support for events declared in the interfaces","user":{"login":"omnilight","id":3306537,"avatar_url":"https://avatars.githubusercontent.com/u/3306537?v=3","gravatar_id":"","url":"https://api.github.com/users/omnilight","html_url":"https://github.com/omnilight","followers_url":"https://api.github.com/users/omnilight/followers","following_url":"https://api.github.com/users/omnilight/following{/other_user}","gists_url":"https://api.github.com/users/omnilight/gists{/gist_id}","starred_url":"https://api.github.com/users/omnilight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omnilight/subscriptions","organizations_url":"https://api.github.com/users/omnilight/orgs","repos_url":"https://api.github.com/users/omnilight/repos","events_url":"https://api.github.com/users/omnilight/events{/privacy}","received_events_url":"https://api.github.com/users/omnilight/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:feature","name":"type:feature","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/9","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.x","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/9/labels","id":831720,"number":9,"title":"2.0.x","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":421,"closed_issues":6,"state":"open","created_at":"2014-10-19T13:49:45Z","updated_at":"2015-12-27T21:08:52Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-11-06T08:09:41Z","updated_at":"2015-12-27T21:08:52Z","closed_at":"2015-12-27T21:08:52Z","body":"Currently using `Event` object we can subscribe only on events, that are declared in some class or it's parent. But sometimes I want to declare event in the interface, implement it by some class, and subscribe on event in this interface, not in the class, example:\r\n\r\n```php\r\ninterface SomeInterface\r\n{\r\n    const EVENT_SOME_EVENT = 'someEvent';\r\n}\r\n\r\nclass SomeClass extends Component implements SomeInterface\r\n{\r\n   public function domSomething() {\r\n       $this->trigger(self::EVENT_SOME_EVENT);\r\n   }\r\n}\r\n\r\nEvent::on(SomeInterface::class, SomeInterface::EVENT_SOME_EVENT, function() {\r\n   // My handler\r\n});\r\n```\r\n\r\nBut in current implementation of the `Event::trigger` method only events for parent classes are checked, but not from interfaces. May be we should add checking for events in the interfaces too?"}}