@@ -14,24 +14,24 @@ discard block |
||
14 | 14 | use WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResultSerializer; |
15 | 15 | |
16 | 16 | return [ |
17 | - ConstraintsServices::LOGGING_HELPER => function( MediaWikiServices $services ) { |
|
17 | + ConstraintsServices::LOGGING_HELPER => function(MediaWikiServices $services) { |
|
18 | 18 | return new LoggingHelper( |
19 | 19 | $services->getStatsdDataFactory(), |
20 | - LoggerFactory::getInstance( 'WikibaseQualityConstraints' ), |
|
20 | + LoggerFactory::getInstance('WikibaseQualityConstraints'), |
|
21 | 21 | $services->getMainConfig() |
22 | 22 | ); |
23 | 23 | }, |
24 | 24 | |
25 | - ConstraintsServices::CONSTRAINT_REPOSITORY => function( MediaWikiServices $services ) { |
|
25 | + ConstraintsServices::CONSTRAINT_REPOSITORY => function(MediaWikiServices $services) { |
|
26 | 26 | return new ConstraintRepository(); |
27 | 27 | }, |
28 | 28 | |
29 | - ConstraintsServices::CONSTRAINT_LOOKUP => function( MediaWikiServices $services ) { |
|
30 | - $constraintRepository = ConstraintsServices::getConstraintRepository( $services ); |
|
31 | - return new CachingConstraintLookup( $constraintRepository ); |
|
29 | + ConstraintsServices::CONSTRAINT_LOOKUP => function(MediaWikiServices $services) { |
|
30 | + $constraintRepository = ConstraintsServices::getConstraintRepository($services); |
|
31 | + return new CachingConstraintLookup($constraintRepository); |
|
32 | 32 | }, |
33 | 33 | |
34 | - ConstraintsServices::CHECK_RESULT_SERIALIZER => function( MediaWikiServices $services ) { |
|
34 | + ConstraintsServices::CHECK_RESULT_SERIALIZER => function(MediaWikiServices $services) { |
|
35 | 35 | return new CheckResultSerializer( |
36 | 36 | new ConstraintSerializer( |
37 | 37 | false // constraint parameters are not exposed |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ); |
43 | 43 | }, |
44 | 44 | |
45 | - ConstraintsServices::CHECK_RESULT_DESERIALIZER => function( MediaWikiServices $services ) { |
|
45 | + ConstraintsServices::CHECK_RESULT_DESERIALIZER => function(MediaWikiServices $services) { |
|
46 | 46 | // TODO in the future, get EntityIdParser and DataValueFactory from $services? |
47 | 47 | $repo = WikibaseRepo::getDefaultInstance(); |
48 | 48 | $entityIdParser = $repo->getEntityIdParser(); |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | ); |
60 | 60 | }, |
61 | 61 | |
62 | - ConstraintsServices::VIOLATION_MESSAGE_SERIALIZER => function( MediaWikiServices $services ) { |
|
62 | + ConstraintsServices::VIOLATION_MESSAGE_SERIALIZER => function(MediaWikiServices $services) { |
|
63 | 63 | return new ViolationMessageSerializer(); |
64 | 64 | }, |
65 | 65 | |
66 | - ConstraintsServices::VIOLATION_MESSAGE_DESERIALIZER => function( MediaWikiServices $services ) { |
|
66 | + ConstraintsServices::VIOLATION_MESSAGE_DESERIALIZER => function(MediaWikiServices $services) { |
|
67 | 67 | // TODO in the future, get EntityIdParser and DataValueFactory from $services? |
68 | 68 | $repo = WikibaseRepo::getDefaultInstance(); |
69 | 69 | $entityIdParser = $repo->getEntityIdParser(); |
@@ -22,67 +22,67 @@ |
||
22 | 22 | const VIOLATION_MESSAGE_SERIALIZER = 'WBQC_ViolationMessageSerializer'; |
23 | 23 | const VIOLATION_MESSAGE_DESERIALIZER = 'WBQC_ViolationMessageDeserializer'; |
24 | 24 | |
25 | - private static function getService( MediaWikiServices $services = null, $name ) { |
|
26 | - if ( $services === null ) { |
|
25 | + private static function getService(MediaWikiServices $services = null, $name) { |
|
26 | + if ($services === null) { |
|
27 | 27 | $services = MediaWikiServices::getInstance(); |
28 | 28 | } |
29 | - return $services->getService( $name ); |
|
29 | + return $services->getService($name); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @param MediaWikiServices|null $services |
34 | 34 | * @return LoggingHelper |
35 | 35 | */ |
36 | - public static function getLoggingHelper( MediaWikiServices $services = null ) { |
|
37 | - return self::getService( $services, self::LOGGING_HELPER ); |
|
36 | + public static function getLoggingHelper(MediaWikiServices $services = null) { |
|
37 | + return self::getService($services, self::LOGGING_HELPER); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @param MediaWikiServices|null $services |
42 | 42 | * @return ConstraintRepository |
43 | 43 | */ |
44 | - public static function getConstraintRepository( MediaWikiServices $services = null ) { |
|
45 | - return self::getService( $services, self::CONSTRAINT_REPOSITORY ); |
|
44 | + public static function getConstraintRepository(MediaWikiServices $services = null) { |
|
45 | + return self::getService($services, self::CONSTRAINT_REPOSITORY); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | 49 | * @param MediaWikiServices|null $services |
50 | 50 | * @return ConstraintLookup |
51 | 51 | */ |
52 | - public static function getConstraintLookup( MediaWikiServices $services = null ) { |
|
53 | - return self::getService( $services, self::CONSTRAINT_LOOKUP ); |
|
52 | + public static function getConstraintLookup(MediaWikiServices $services = null) { |
|
53 | + return self::getService($services, self::CONSTRAINT_LOOKUP); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @param MediaWikiServices|null $services |
58 | 58 | * @return CheckResultSerializer |
59 | 59 | */ |
60 | - public static function getCheckResultSerializer( MediaWikiServices $services = null ) { |
|
61 | - return self::getService( $services, self::CHECK_RESULT_SERIALIZER ); |
|
60 | + public static function getCheckResultSerializer(MediaWikiServices $services = null) { |
|
61 | + return self::getService($services, self::CHECK_RESULT_SERIALIZER); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * @param MediaWikiServices|null $services |
66 | 66 | * @return CheckResultDeserializer |
67 | 67 | */ |
68 | - public static function getCheckResultDeserializer( MediaWikiServices $services = null ) { |
|
69 | - return self::getService( $services, self::CHECK_RESULT_DESERIALIZER ); |
|
68 | + public static function getCheckResultDeserializer(MediaWikiServices $services = null) { |
|
69 | + return self::getService($services, self::CHECK_RESULT_DESERIALIZER); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | 73 | * @param MediaWikiServices|null $services |
74 | 74 | * @return ViolationMessageSerializer |
75 | 75 | */ |
76 | - public static function getViolationMessageSerializer( MediaWikiServices $services = null ) { |
|
77 | - return self::getService( $services, self::VIOLATION_MESSAGE_SERIALIZER ); |
|
76 | + public static function getViolationMessageSerializer(MediaWikiServices $services = null) { |
|
77 | + return self::getService($services, self::VIOLATION_MESSAGE_SERIALIZER); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
81 | 81 | * @param MediaWikiServices|null $services |
82 | 82 | * @return ViolationMessageDeserializer |
83 | 83 | */ |
84 | - public static function getViolationMessageDeserializer( MediaWikiServices $services = null ) { |
|
85 | - return self::getService( $services, self::VIOLATION_MESSAGE_DESERIALIZER ); |
|
84 | + public static function getViolationMessageDeserializer(MediaWikiServices $services = null) { |
|
85 | + return self::getService($services, self::VIOLATION_MESSAGE_DESERIALIZER); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | } |