| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
namespace MediaWiki\Extension\VisualEditor\EditCheck; |
| 11 |
|
| 12 |
use MessageLocalizer; |
| 13 |
|
| 14 |
class ResourceLoaderData { |
| 15 |
|
| 16 |
private const DEFAULTS = [ |
| 17 |
'addReference' => [ |
| 18 |
'minimumCharacters' => 50, |
| 19 |
'beforePunctuation' => false, |
| 20 |
|
| 21 |
|
| 22 |
'account' => false, |
| 23 |
'maximumEditcount' => 100, |
| 24 |
'ignoreSections' => [], |
| 25 |
'ignoreLeadSection' => false, |
| 26 |
], |
| 27 |
]; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public static function getConfig( MessageLocalizer $context ): array { |
| 36 |
$raw_config = json_decode( $context->msg( 'editcheck-config.json' )->inContentLanguage()->plain(), true ); |
| 37 |
|
| 38 |
return array_replace_recursive( self::DEFAULTS, $raw_config ?? [] ); |
| 39 |
} |
| 40 |
} |