diff options
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/parser.php | 17 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/renderer.php | 17 | ||||
-rw-r--r-- | tests/text_formatter/s9e/parser_test.php | 12 | ||||
-rw-r--r-- | tests/text_formatter/s9e/renderer_test.php | 12 |
4 files changed, 26 insertions, 32 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index fb6ef03c1c..77328ee4d9 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -57,7 +57,7 @@ class parser implements \phpbb\textformatter\parser_interface $this->dispatcher = $dispatcher; $this->parser = $parser; $this->user = $user; - $self = $this; + $parser = $this; /** * Configure the parser service @@ -69,12 +69,11 @@ class parser implements \phpbb\textformatter\parser_interface * - configure the s9e\TextFormatter parser * * @event core.text_formatter_s9e_parser_setup - * @var \s9e\TextFormatter\Parser parser s9e\TextFormatter parser instance - * @var \phpbb\textformatter\s9e\parser self This parser service + * @var \phpbb\textformatter\s9e\parser parser This parser service * @var \phpbb\user user Current user * @since 3.2.0-a1 */ - $vars = array('parser', 'self', 'user'); + $vars = array('parser', 'user'); extract($dispatcher->trigger_event('core.text_formatter_s9e_parser_setup', compact($vars))); } @@ -83,17 +82,17 @@ class parser implements \phpbb\textformatter\parser_interface */ public function parse($text) { - $self = $this; + $parser = $this; /** * Modify a text before it is parsed * * @event core.text_formatter_s9e_parse_before - * @var \phpbb\textformatter\s9e\parser self This parser service + * @var \phpbb\textformatter\s9e\parser parser This parser service * @var string text The original text * @since 3.2.0-a1 */ - $vars = array('self', 'text'); + $vars = array('parser', 'text'); extract($this->dispatcher->trigger_event('core.text_formatter_s9e_parse_before', compact($vars))); $xml = $this->parser->parse($text); @@ -102,11 +101,11 @@ class parser implements \phpbb\textformatter\parser_interface * Modify a parsed text in its XML form * * @event core.text_formatter_s9e_parse_after - * @var \phpbb\textformatter\s9e\parser self This parser service + * @var \phpbb\textformatter\s9e\parser parser This parser service * @var string xml The parsed text, in XML * @since 3.2.0-a1 */ - $vars = array('self', 'xml'); + $vars = array('parser', 'xml'); extract($this->dispatcher->trigger_event('core.text_formatter_s9e_parse_after', compact($vars))); return $xml; diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php index 02461b3849..168b13e692 100644 --- a/phpBB/phpbb/textformatter/s9e/renderer.php +++ b/phpBB/phpbb/textformatter/s9e/renderer.php @@ -99,17 +99,16 @@ class renderer implements \phpbb\textformatter\renderer_interface } $this->dispatcher = $dispatcher; $this->renderer = $renderer; - $self = $this; + $renderer = $this; /** * Configure the renderer service * * @event core.text_formatter_s9e_renderer_setup - * @var \s9e\TextFormatter\Renderer renderer s9e\TextFormatter renderer instance - * @var \phpbb\textformatter\s9e\renderer self This renderer service + * @var \phpbb\textformatter\s9e\renderer renderer This renderer service * @since 3.2.0-a1 */ - $vars = array('renderer', 'self'); + $vars = array('renderer'); extract($dispatcher->trigger_event('core.text_formatter_s9e_renderer_setup', compact($vars))); } @@ -210,17 +209,17 @@ class renderer implements \phpbb\textformatter\renderer_interface */ public function render($xml) { - $self = $this; + $renderer = $this; /** * Modify a parsed text before it is rendered * * @event core.text_formatter_s9e_render_before - * @var \phpbb\textformatter\s9e\renderer self This renderer service + * @var \phpbb\textformatter\s9e\renderer renderer This renderer service * @var string xml The parsed text, in its XML form * @since 3.2.0-a1 */ - $vars = array('self', 'xml'); + $vars = array('renderer', 'xml'); extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_before', compact($vars))); if (isset($this->censor) && $this->viewcensors) @@ -267,10 +266,10 @@ class renderer implements \phpbb\textformatter\renderer_interface * * @event core.text_formatter_s9e_render_after * @var string html The rendered text's HTML - * @var \phpbb\textformatter\s9e\renderer self This renderer service + * @var \phpbb\textformatter\s9e\renderer renderer This renderer service * @since 3.2.0-a1 */ - $vars = array('html', 'self'); + $vars = array('html', 'renderer'); extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_after', compact($vars))); return $html; diff --git a/tests/text_formatter/s9e/parser_test.php b/tests/text_formatter/s9e/parser_test.php index 2904df25b4..71966f9d36 100644 --- a/tests/text_formatter/s9e/parser_test.php +++ b/tests/text_formatter/s9e/parser_test.php @@ -200,9 +200,7 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case public function setup_event_callback($vars) { return isset($vars['parser']) - && $vars['parser'] instanceof \s9e\TextFormatter\Parser - && isset($vars['self']) - && $vars['self'] instanceof \phpbb\textformatter\s9e\parser + && $vars['parser'] instanceof \phpbb\textformatter\s9e\parser && isset($vars['user']) && $vars['user'] instanceof \phpbb\user; } @@ -247,16 +245,16 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case public function parse_before_event_callback($vars) { - return isset($vars['self']) - && $vars['self'] instanceof \phpbb\textformatter\s9e\parser + return isset($vars['parser']) + && $vars['parser'] instanceof \phpbb\textformatter\s9e\parser && isset($vars['text']) && $vars['text'] === '...'; } public function parse_after_event_callback($vars) { - return isset($vars['self']) - && $vars['self'] instanceof \phpbb\textformatter\s9e\parser + return isset($vars['parser']) + && $vars['parser'] instanceof \phpbb\textformatter\s9e\parser && isset($vars['xml']) && $vars['xml'] === '<t>...</t>'; } diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php index 8835a80d9d..91458541d3 100644 --- a/tests/text_formatter/s9e/renderer_test.php +++ b/tests/text_formatter/s9e/renderer_test.php @@ -385,9 +385,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case public function setup_event_callback($vars) { return isset($vars['renderer']) - && $vars['renderer'] instanceof \s9e\TextFormatter\Renderer - && isset($vars['self']) - && $vars['self'] instanceof \phpbb\textformatter\s9e\renderer; + && $vars['renderer'] instanceof \phpbb\textformatter\s9e\renderer; } /** @@ -430,8 +428,8 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case public function render_before_event_callback($vars) { - return isset($vars['self']) - && $vars['self'] instanceof \phpbb\textformatter\s9e\renderer + return isset($vars['renderer']) + && $vars['renderer'] instanceof \phpbb\textformatter\s9e\renderer && isset($vars['xml']) && $vars['xml'] === '<t>...</t>'; } @@ -440,8 +438,8 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case { return isset($vars['html']) && $vars['html'] === '...' - && isset($vars['self']) - && $vars['self'] instanceof \phpbb\textformatter\s9e\renderer; + && isset($vars['renderer']) + && $vars['renderer'] instanceof \phpbb\textformatter\s9e\renderer; } public function test_get_renderer() |