daniel added a comment.

You are right, static factory methods on ParserOptions are probably the best choice for now. Ideally, ParserOutput is a plain value object, then we don't even need a factory - but even if we do, we can add that later.

We definitely want something like ParserOptions::newCanonical(), but I'm a bit torn on what parameters it should take, and what decisions it should make.

  • a Title. Even if we don't do this right now, conceptually, the default target language may depend on the namespace or a suffix.
  • the User. The factory may decide at this point that the out put depends on the user language.
  • ...or just require the language to be passed, avoiding access to the global $wgContLang.

Or maybe, pass nothing at all, leaving it to the callers to use setters?


TASK DETAIL
https://phabricator.wikimedia.org/T194263

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Anomie, daniel
Cc: Aklapper, gerritbot, daniel, Lahi, PDrouin-WMF, Gq86, E1presidente, Ramsey-WMF, Cparle, Anooprao, SandraF_WMF, GoranSMilovanovic, QZanden, Tramullas, Acer, LawExplorer, JJMC89, Agabi10, Susannaanas, Aschroet, Fjalapeno, Jane023, Wikidata-bugs, Base, matthiasmullie, aude, Ricordisamoa, Lydia_Pintscher, Fabrice_Florin, Raymond, Anomie, Steinsplitter, Mbch331, Ltrlg
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to