Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
73.91% |
17 / 23 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | use EntitySchema\DataAccess\LabelLookup; |
5 | use EntitySchema\DataAccess\SqlIdGenerator; |
6 | use EntitySchema\Domain\Storage\IdGenerator; |
7 | use EntitySchema\Presentation\AutocommentFormatter; |
8 | use EntitySchema\Wikibase\Validators\EntitySchemaExistsValidator; |
9 | use MediaWiki\MediaWikiServices; |
10 | use Wikibase\Repo\WikibaseRepo; |
11 | |
12 | /** @phpcs-require-sorted-array */ |
13 | return [ |
14 | 'EntitySchema.AutocommentFormatter' => static function ( MediaWikiServices $services ): AutocommentFormatter { |
15 | return new AutocommentFormatter(); |
16 | }, |
17 | 'EntitySchema.EntitySchemaExistsValidator' => static function ( |
18 | MediaWikiServices $services |
19 | ): EntitySchemaExistsValidator { |
20 | return new EntitySchemaExistsValidator( $services->getTitleFactory() ); |
21 | }, |
22 | |
23 | 'EntitySchema.IdGenerator' => static function ( MediaWikiServices $services ): IdGenerator { |
24 | return new SqlIdGenerator( |
25 | $services->getDBLoadBalancer(), |
26 | 'entityschema_id_counter', |
27 | $services->getMainConfig()->get( 'EntitySchemaSkippedIDs' ) |
28 | ); |
29 | }, |
30 | 'EntitySchema.LabelLookup' => static function ( MediaWikiServices $services ): LabelLookup { |
31 | return new LabelLookup( |
32 | $services->getWikiPageFactory(), |
33 | WikibaseRepo::getLanguageFallbackChainFactory( $services ) |
34 | ); |
35 | }, |
36 | ]; |