fix reflection implementation in EventDispatcher

fixes composer/composer#3546