I'd go for something like
/* TranslateServices.php */
public static function wrap( MediaWikiServices $services ) { return new
self( $services ); }
/* ServiceWiring.php */
'Translate:TranslatablePageParser' => function ( MediaWikiServices
$services ) {
return new TranslatablePageParser(
Hi Niklas!
> Do you see any downsides of using code like below instead?
>
> 'Translate:TranslatablePageParser' => function (): TranslatablePageParser {
> $services = TranslateServices::getInstance();
> return new TranslatablePageParser(
> $services->getParsingPlaceholderFactory() );
> },
The example below works, and I see it used in some extensions, but it
has no autocompletion and not catching typos.
Services.php:
class TranslateServices implements ContainerInterface {
public function getParsingPlaceholderFactory(): ParsingPlaceholderFactory {
return $this->container-