Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AbstractSubmissionHandler | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
getUserErrorMessage | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace GrowthExperiments\NewcomerTasks; |
4 | |
5 | use MediaWiki\User\UserIdentity; |
6 | use MediaWiki\User\UserIdentityUtils; |
7 | |
8 | abstract class AbstractSubmissionHandler { |
9 | |
10 | /** |
11 | * Return the message key for the error message if the user is unregistered, |
12 | * otherwise return null. |
13 | * |
14 | * @param UserIdentityUtils $utils |
15 | * @param UserIdentity $user |
16 | * @return string|null |
17 | */ |
18 | protected static function getUserErrorMessage( |
19 | UserIdentityUtils $utils, |
20 | UserIdentity $user |
21 | ): ?string { |
22 | if ( !$utils->isNamed( $user ) ) { |
23 | return 'growthexperiments-structuredtask-anonuser'; |
24 | } |
25 | return null; |
26 | } |
27 | } |