Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 32
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace Cognate;
4
5use Cognate\HookHandler\CognatePageHookHandler;
6use MediaWiki\Logger\LoggerFactory;
7use MediaWiki\MediaWikiServices;
8use Psr\Log\LoggerInterface;
9
10/**
11 * Cognate wiring for MediaWiki services.
12 */
13
14return [
15    'CognateLogger' => static function ( MediaWikiServices $services ): LoggerInterface {
16        return LoggerFactory::getInstance( 'Cognate' );
17    },
18
19    'CognateRepo' => static function ( MediaWikiServices $services ): CognateRepo {
20        $repo = new CognateRepo(
21            CognateServices::getStore( $services ),
22            CognateServices::getCacheInvalidator( $services ),
23            $services->getTitleFormatter(),
24            CognateServices::getLogger( $services )
25        );
26
27        $repo->setStatsdDataFactory( $services->getStatsdDataFactory() );
28
29        return $repo;
30    },
31
32    'CognateStore' => static function ( MediaWikiServices $services ): CognateStore {
33        return new CognateStore(
34            $services->getConnectionProvider(),
35            new StringNormalizer(),
36            new StringHasher(),
37            $services->getMainConfig()->get( 'CognateReadOnly' )
38        );
39    },
40
41    'CognatePageHookHandler' => static function ( MediaWikiServices $services ): CognatePageHookHandler {
42        return new CognatePageHookHandler(
43            $services->getMainConfig()->get( 'CognateNamespaces' ),
44            $services->getMainConfig()->get( 'DBname' )
45        );
46    },
47
48    'CognateCacheInvalidator' => static function ( MediaWikiServices $services ): CacheInvalidator {
49        return new CacheInvalidator( $services->getJobQueueGroup() );
50    },
51];