2declare( strict_types = 1 );
4namespace MediaWiki\Extension\Translate\TtmServer;
7use MediaWiki\MediaWikiServices;
19 protected array $config;
21 public function __construct( array $config ) {
22 $this->config = $config;
30 usort( $suggestions, static function ( array $a, array $b ) {
31 return $b[
'quality'] <=> $a[
'quality'];
38 public static function onDelete( WikiPage $wikipage ): void {
40 $job = TtmServerMessageUpdateJob::newJob( $handle,
'delete' );
41 MediaWikiServices::getInstance()->getJobQueueGroup()->push( $job );
47 MediaWikiServices::getInstance()->getJobQueueGroup()->push( $job );
50 public static function onGroupChange(
MessageHandle $handle, array $old ): void {
56 $job = TtmServerMessageUpdateJob::newJob( $handle,
'rebuild' );
57 MediaWikiServices::getInstance()->getJobQueueGroup()->push( $job );