diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2015-03-03 00:52:31 +0100 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2015-04-02 19:16:02 +0200 |
commit | 694e515f7c812a470a9a1890aa49ba6ad59385fb (patch) | |
tree | 4de8074d3e4ce5b8e26ffa239bb106b84f529c39 | |
parent | [ticket/11768] Renamed get_words() to get_censored_words() (diff) | |
download | phpbb-694e515f7c812a470a9a1890aa49ba6ad59385fb.tar.gz phpbb-694e515f7c812a470a9a1890aa49ba6ad59385fb.tar.bz2 phpbb-694e515f7c812a470a9a1890aa49ba6ad59385fb.zip |
[ticket/11768] Replaced \phpbb\textformatter\parser with an interface
PHPBB3-11768
-rw-r--r-- | phpBB/phpbb/textformatter/parser.php | 36 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/parser.php | 13 |
2 files changed, 27 insertions, 22 deletions
diff --git a/phpBB/phpbb/textformatter/parser.php b/phpBB/phpbb/textformatter/parser.php index 6746ccada5..922226cf44 100644 --- a/phpBB/phpbb/textformatter/parser.php +++ b/phpBB/phpbb/textformatter/parser.php @@ -13,7 +13,7 @@ namespace phpbb\textformatter; -abstract class parser +interface parser { /** * Parse given text @@ -21,7 +21,7 @@ abstract class parser * @param string $text * @return string */ - abstract public function parse($text); + public function parse($text); /** * Disable a specific BBCode @@ -29,27 +29,27 @@ abstract class parser * @param string $name BBCode name * @return null */ - abstract public function disable_bbcode($name); + public function disable_bbcode($name); /** * Disable BBCodes in general */ - abstract public function disable_bbcodes(); + public function disable_bbcodes(); /** * Disable the censor */ - abstract public function disable_censor(); + public function disable_censor(); /** * Disable magic URLs */ - abstract public function disable_magic_url(); + public function disable_magic_url(); /** * Disable smilies */ - abstract public function disable_smilies(); + public function disable_smilies(); /** * Enable a specific BBCode @@ -57,34 +57,34 @@ abstract class parser * @param string $name BBCode name * @return null */ - abstract public function enable_bbcode($name); + public function enable_bbcode($name); /** * Enable BBCodes in general */ - abstract public function enable_bbcodes(); + public function enable_bbcodes(); /** * Enable the censor */ - abstract public function enable_censor(); + public function enable_censor(); /** * Enable magic URLs */ - abstract public function enable_magic_url(); + public function enable_magic_url(); /** * Enable smilies */ - abstract public function enable_smilies(); + public function enable_smilies(); /** * Get the list of errors that were generated during last parsing * * @return array */ - abstract public function get_errors(); + public function get_errors(); /** * Set a variable to be used by the parser @@ -99,7 +99,7 @@ abstract class parser * @param mixed $value * @return null */ - abstract public function set_var($name, $value); + public function set_var($name, $value); /** * Set multiple variables to be used by the parser @@ -107,11 +107,5 @@ abstract class parser * @param array Associative array of [name => value] * @return null */ - public function set_vars(array $vars) - { - foreach ($vars as $name => $value) - { - $this->set_var($name, $value); - } - } + public function set_vars(array $vars); } diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index 977097462b..de51929994 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -19,7 +19,7 @@ use s9e\TextFormatter\Parser\Logger; /** * s9e\TextFormatter\Parser adapter */ -class parser extends \phpbb\textformatter\parser +class parser implements \phpbb\textformatter\parser { /** * @var s9e\TextFormatter\Parser @@ -220,6 +220,17 @@ class parser extends \phpbb\textformatter\parser } /** + * {@inheritdoc} + */ + public function set_vars(array $vars) + { + foreach ($vars as $name => $value) + { + $this->set_var($name, $value); + } + } + + /** * Filter a flash object's height * * @see bbcode_firstpass::bbcode_flash() |