From 22a3e5fc559597329186e142e862cc5ebad7045f Mon Sep 17 00:00:00 2001 From: Jakob Warkotsch Date: Tue, 9 Apr 2024 19:11:32 +0200 Subject: [PATCH] Don't configure parser-factory-callback Configuring parser-factory-callback is not necessary here because it's the same as the default for the string value type. Setting a data type specific custom parser will soon allow for data type specific overrides of the parser whenever a statement value is deserialized, and setting it may result in additional data type lookups. Bug: T360603 Change-Id: I6a859b8d9cf25d8a837b366434380169e404fe6b --- src/WikibaseHook.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/WikibaseHook.php b/src/WikibaseHook.php index 26fa97a93..9e778be1b 100644 --- a/src/WikibaseHook.php +++ b/src/WikibaseHook.php @@ -2,10 +2,7 @@ namespace MediaWiki\Extension\Math; -use ParserOptions; use ValueFormatters\FormatterOptions; -use ValueParsers\StringParser; -use Wikibase\Repo\Parsers\WikibaseStringValueNormalizer; use Wikibase\Repo\Rdf\DedupeBag; use Wikibase\Repo\Rdf\EntityMentionListener; use Wikibase\Repo\Rdf\RdfVocabulary; @@ -38,10 +35,6 @@ class WikibaseHook { $validators[] = new MathValidator(); return $validators; }, - 'parser-factory-callback' => static function ( ParserOptions $options ) { - $normalizer = new WikibaseStringValueNormalizer( WikibaseRepo::getStringNormalizer() ); - return new StringParser( $normalizer ); - }, 'formatter-factory-callback' => static function ( $format, FormatterOptions $options ) { return new MathFormatter( $format ); },