mediawiki-extensions-Discus.../includes
Bartosz Dziewoński 4613ae78e7 Change CommentParser into a service
Goal:
-----
To have a method like CommentParser::parse(), which just takes a node
to parse and a title and returns plain data, so that we don't need to
keep track of the config to construct a CommentParser object (the
required config like content language is provided by services) and
we don't need to keep that object around after parsing.

Changes:
--------
CommentParser.php:
* …is now a service. Constructor only takes services as arguments.
  The node and title are passed to a new parse() method.
* parse() should return plain data, but I split this part to a separate
  patch for ease of review: I49bfe019aa460651447fd383f73eafa9d7180a92.
* CommentParser still cheats and accesses global state in a few places,
  e.g. calling Title::makeTitleSafe or CommentUtils::getTitleFromUrl,
  so we can't turn its tests into true unit tests. This work is left
  for future commits.

LanguageData.php:
* …is now a service, instead of a static class.

Parser.js:
* …is not a real service, but it's changed to behave in a similar way.
  Constructor takes only the required config as argument,
  and node and title are instead passed to a new parse() method.

CommentParserTest.php:
parser.test.js:
* Can be simplified, now that we don't need a useless node and title
  to test internal methods that don't use them.

testUtils.js:
* Can be simplified, now that we don't need to override internal
  ResourceLoader stuff just to change the parser config.

Change-Id: Iadb7757debe000025e52770ca51ebcf24ca8ee66
2022-02-19 19:51:57 +01:00
..
Actions Injected SubscriptionStore into UnsubscribeAction 2021-08-09 22:38:52 +00:00
Hooks Merge "Replace use of deprecated OutputPage::enableClientCache( false )" 2022-02-10 07:01:26 +00:00
Notifications Change CommentParser into a service 2022-02-19 19:51:57 +01:00
ApiDiscussionToolsCompare.php Add discussiontoolscompare API 2022-02-08 15:53:27 +00:00
ApiDiscussionToolsEdit.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
ApiDiscussionToolsGetSubscriptions.php Remove DiscussionToolsEnableTopicSubscriptionBackend config 2022-02-04 18:22:10 +00:00
ApiDiscussionToolsPageInfo.php Add discussiontoolscompare API 2022-02-08 15:53:27 +00:00
ApiDiscussionToolsSubscribe.php Remove DiscussionToolsEnableTopicSubscriptionBackend config 2022-02-04 18:22:10 +00:00
ApiDiscussionToolsTrait.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
CommentFormatter.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
CommentItem.php Merge "ThreadItem: Use DOMUtils to get HTML of DocumentFragment" 2022-02-09 00:53:43 +00:00
CommentModifier.php Improve CommentModifier::addReply() API for re-use and testing 2022-02-03 21:12:48 +00:00
CommentParser.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
CommentUtils.php Fix some typos in comments 2022-02-04 20:36:28 +01:00
HeadingItem.php Prevent assertion failure caused by empty headings 2022-01-20 18:56:32 +00:00
ImmutableRange.php Various code quality tweaks 2022-02-19 19:36:52 +01:00
LanguageData.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
NodeFilter.php Don't refer directly to PHP dom extension classes; avoid nonstandard behavior 2021-07-30 18:15:40 -04:00
ResourceLoaderData.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
ServiceWiring.php Change CommentParser into a service 2022-02-19 19:51:57 +01:00
SpecialTopicSubscriptions.php Add Special:TopicSubscriptions 2021-10-06 20:06:01 +00:00
SubscriptionItem.php Add missing typehints 2021-12-01 14:57:09 +00:00
SubscriptionStore.php Merge "Change auto topic subs to re-subscribe you if you unsubscribed" 2021-12-17 15:32:40 +00:00
ThreadItem.php ThreadItem: Use DOMUtils to get HTML of DocumentFragment 2022-02-08 23:51:38 +00:00
TopicSubscriptionsPager.php Merge "TopicSubscriptions: Rename 'actions' column and unframe button" 2021-10-28 21:05:43 +00:00
TreeWalker.php Don't refer directly to PHP dom extension classes; avoid nonstandard behavior 2021-07-30 18:15:40 -04:00