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
This commit is contained in:
Jakob Warkotsch 2024-04-09 19:11:32 +02:00
parent dac2a3267a
commit 22a3e5fc55

View file

@ -2,10 +2,7 @@
namespace MediaWiki\Extension\Math; namespace MediaWiki\Extension\Math;
use ParserOptions;
use ValueFormatters\FormatterOptions; use ValueFormatters\FormatterOptions;
use ValueParsers\StringParser;
use Wikibase\Repo\Parsers\WikibaseStringValueNormalizer;
use Wikibase\Repo\Rdf\DedupeBag; use Wikibase\Repo\Rdf\DedupeBag;
use Wikibase\Repo\Rdf\EntityMentionListener; use Wikibase\Repo\Rdf\EntityMentionListener;
use Wikibase\Repo\Rdf\RdfVocabulary; use Wikibase\Repo\Rdf\RdfVocabulary;
@ -38,10 +35,6 @@ class WikibaseHook {
$validators[] = new MathValidator(); $validators[] = new MathValidator();
return $validators; 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 ) { 'formatter-factory-callback' => static function ( $format, FormatterOptions $options ) {
return new MathFormatter( $format ); return new MathFormatter( $format );
}, },