From: Tim Düsterhus Date: Sun, 24 Aug 2014 15:52:20 +0000 (+0200) Subject: Rename \wcf\system\event\listener\IEventListener to IParameterizedEventListener X-Git-Tag: 2.1.0_Alpha_1~412 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=10a72972f970684e8cc8f9a78df6aa0edf6e9b92;p=GitHub%2FWoltLab%2FWCF.git Rename \wcf\system\event\listener\IEventListener to IParameterizedEventListener This is for BC reasons, as PHP does not allow using a class of another namespace when a class with the same name already exists within the same namespace. IParameterizedEventListener will be aliased to IEventListener when \wcf\system\event\IEventListener is removed. see bd8f17f01975dacba19199ac4b7f4bba567f3e98 --- diff --git a/wcfsetup/install/files/lib/system/event/EventHandler.class.php b/wcfsetup/install/files/lib/system/event/EventHandler.class.php index d22fed086e..6e5da6ee2d 100644 --- a/wcfsetup/install/files/lib/system/event/EventHandler.class.php +++ b/wcfsetup/install/files/lib/system/event/EventHandler.class.php @@ -1,7 +1,7 @@ inheritedActionsObjects[$name] as $actionObj) { - if ($actionObj instanceof IEventListener) { + if ($actionObj instanceof IParameterizedEventListener) { $actionObj->execute($eventObj, $className, $eventName, $parameters); if (!is_array($parameters)) { @@ -193,10 +193,10 @@ class EventHandler extends SingletonFactory { if (!class_exists($action['listenerClassName'])) { throw new SystemException("Unable to find class '".$action['listenerClassName']."'"); } - if (!ClassUtil::isInstanceOf($action['listenerClassName'], 'wcf\system\event\listener\IEventListener')) { + if (!ClassUtil::isInstanceOf($action['listenerClassName'], 'wcf\system\event\listener\IParameterizedEventListener')) { // legacy event listeners if (!ClassUtil::isInstanceOf($action['listenerClassName'], 'wcf\system\event\IEventListener')) { - throw new SystemException("'".$action['listenerClassName']."' does not implement 'wcf\system\event\listener\IEventListener'"); + throw new SystemException("'".$action['listenerClassName']."' does not implement 'wcf\system\event\listener\IParameterizedEventListener'"); } } @@ -210,7 +210,7 @@ class EventHandler extends SingletonFactory { // execute actions foreach ($this->actionsObjects[$name] as $actionObj) { - if ($actionObj instanceof IEventListener) { + if ($actionObj instanceof IParameterizedEventListener) { $actionObj->execute($eventObj, $className, $eventName, $parameters); if (!is_array($parameters)) { diff --git a/wcfsetup/install/files/lib/system/event/IEventListener.class.php b/wcfsetup/install/files/lib/system/event/IEventListener.class.php index 575abbea98..941d914d83 100644 --- a/wcfsetup/install/files/lib/system/event/IEventListener.class.php +++ b/wcfsetup/install/files/lib/system/event/IEventListener.class.php @@ -5,7 +5,7 @@ namespace wcf\system\event; * *DEPRECATED* * EventListeners can be registered for a specific event in many controller objects. * - * @deprecated since 2.1, use \wcf\system\event\listener\IEventListener + * @deprecated since 2.1, use \wcf\system\event\listener\IParameterizedEventListener * @author Marcel Werk * @copyright 2001-2014 WoltLab GmbH * @license GNU Lesser General Public License diff --git a/wcfsetup/install/files/lib/system/event/listener/IEventListener.class.php b/wcfsetup/install/files/lib/system/event/listener/IEventListener.class.php deleted file mode 100644 index 208ba82309..0000000000 --- a/wcfsetup/install/files/lib/system/event/listener/IEventListener.class.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.event.listener - * @category Community Framework - */ -interface IEventListener { - /** - * Executes this action. - * - * @param object $eventObj Object firing the event - * @param string $className class name of $eventObj - * @param string $eventName name of the event fired - * @param array &$parameters given parameters - */ - public function execute($eventObj, $className, $eventName, array &$parameters); -} diff --git a/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php b/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php new file mode 100644 index 0000000000..1b2366b092 --- /dev/null +++ b/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php @@ -0,0 +1,27 @@ + + * @package com.woltlab.wcf + * @subpackage system.event.listener + * @category Community Framework + */ +interface IParameterizedEventListener { + /** + * Executes this action. + * + * @param object $eventObj Object firing the event + * @param string $className class name of $eventObj + * @param string $eventName name of the event fired + * @param array &$parameters given parameters + */ + public function execute($eventObj, $className, $eventName, array &$parameters); +} diff --git a/wcfsetup/install/files/lib/system/event/listener/PreParserAtUserListener.class.php b/wcfsetup/install/files/lib/system/event/listener/PreParserAtUserListener.class.php index 3c92a13bb4..bb0f72bb36 100644 --- a/wcfsetup/install/files/lib/system/event/listener/PreParserAtUserListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/PreParserAtUserListener.class.php @@ -17,9 +17,9 @@ use wcf\util\StringStack; * @subpackage system.event.listener * @category Community Framework */ -class PreParserAtUserListener implements IEventListener { +class PreParserAtUserListener implements IParameterizedEventListener { /** - * @see \wcf\system\event\listener\IEventListener::execute() + * @see \wcf\system\event\listener\IParameterizedEventListener::execute() */ public function execute($eventObj, $className, $eventName, array &$parameters) { if (!$eventObj->text) return; diff --git a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php index 9f6d488de6..0a362b2780 100644 --- a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php @@ -16,9 +16,9 @@ use wcf\util\UserUtil; * @subpackage system.event.listener * @category Community Framework */ -class SessionAccessLogListener implements IEventListener { +class SessionAccessLogListener implements IParameterizedEventListener { /** - * @see \wcf\system\event\listener\IEventListener::execute() + * @see \wcf\system\event\listener\IParameterizedEventListener::execute() */ public function execute($eventObj, $className, $eventName, array &$parameters) { if (WCF::getUser()->userID && WCF::getSession()->getPermission('admin.general.canUseAcp') && !defined(get_class($eventObj).'::DO_NOT_LOG')) {