From 65d8cd63022d688fe618f128768b78a6214db166 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 13 Aug 2013 02:14:22 -0700 Subject: [PATCH] [ticket/11784] Remove naming redundancy for event listeners PHPBB3-11784 --- phpBB/phpbb/event/extension_subscriber_loader.php | 1 - phpBB/phpbb/template/twig/node/event.php | 2 +- .../foo/bar/event/{permission_listener.php => permission.php} | 2 +- .../styles/all/template/event/{test_listener.html => test.html} | 0 .../silver/template/event/{test_listener.html => test.html} | 0 .../template/event/{test_listener.html => test.html} | 0 .../styles/all/template/event/{test_listener.html => test.html} | 0 .../silver/template/event/{test_listener.html => test.html} | 0 .../silver/template/event/{two_listener.html => two.html} | 0 .../styles/all/template/event/{test_listener.html => test.html} | 0 ...riable_spacing_listener.html => event_variable_spacing.html} | 0 .../{test_event_loop_listener.html => test_event_loop.html} | 0 .../template/event/{universal_listener.html => universal.html} | 0 .../silver/template/event/{simple_listener.html => simple.html} | 0 14 files changed, 2 insertions(+), 3 deletions(-) rename tests/functional/fixtures/ext/foo/bar/event/{permission_listener.php => permission.php} (87%) rename tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/{test_listener.html => test.html} (100%) rename tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/{test_listener.html => test.html} (100%) rename tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/{test_listener.html => test.html} (100%) rename tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/{test_listener.html => test.html} (100%) rename tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/{test_listener.html => test.html} (100%) rename tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/{two_listener.html => two.html} (100%) rename tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/{test_listener.html => test.html} (100%) rename tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/{event_variable_spacing_listener.html => event_variable_spacing.html} (100%) rename tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/{test_event_loop_listener.html => test_event_loop.html} (100%) rename tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/{universal_listener.html => universal.html} (100%) rename tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/{simple_listener.html => simple.html} (100%) diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php index d933b943d7..d6284a52fb 100644 --- a/phpBB/phpbb/event/extension_subscriber_loader.php +++ b/phpBB/phpbb/event/extension_subscriber_loader.php @@ -33,7 +33,6 @@ class phpbb_event_extension_subscriber_loader $finder = $this->extension_manager->get_finder(); $subscriber_classes = $finder ->extension_directory('/event') - ->suffix('listener') ->core_path('event/') ->get_classes(); diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index 4533151d05..c94e5fdf20 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -43,7 +43,7 @@ class phpbb_template_twig_node_event extends Twig_Node { $compiler->addDebugInfo($this); - $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name') . '_listener'; + $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name'); foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path) { diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php similarity index 87% rename from tests/functional/fixtures/ext/foo/bar/event/permission_listener.php rename to tests/functional/fixtures/ext/foo/bar/event/permission.php index 6986755f71..48688a586a 100644 --- a/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php +++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php @@ -22,7 +22,7 @@ if (!defined('IN_PHPBB')) */ use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class phpbb_ext_foo_bar_event_permission_listener implements EventSubscriberInterface +class phpbb_ext_foo_bar_event_permission implements EventSubscriberInterface { static public function getSubscribedEvents() { diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html rename to tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html rename to tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html rename to tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html rename to tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html rename to tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html rename to tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html similarity index 100% rename from tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html rename to tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html similarity index 100% rename from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html rename to tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html similarity index 100% rename from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html rename to tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html similarity index 100% rename from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html rename to tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html similarity index 100% rename from tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html rename to tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html