Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
FilterUtils | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
isHidden | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
isProtected | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\AbuseFilter; |
4 | |
5 | use MediaWiki\Extension\AbuseFilter\Filter\Flags; |
6 | |
7 | /** |
8 | * @internal |
9 | */ |
10 | class FilterUtils { |
11 | /** |
12 | * Given a bitmask of privacy levels, return if the hidden flag is set |
13 | * |
14 | * @param int $privacyLevel |
15 | * @return bool |
16 | */ |
17 | public static function isHidden( int $privacyLevel ) { |
18 | return (bool)( Flags::FILTER_HIDDEN & $privacyLevel ); |
19 | } |
20 | |
21 | /** |
22 | * Given a bitmask, return if the protected flag is set |
23 | * |
24 | * @param int $privacyLevel |
25 | * @return bool |
26 | */ |
27 | public static function isProtected( int $privacyLevel ) { |
28 | return (bool)( Flags::FILTER_USES_PROTECTED_VARS & $privacyLevel ); |
29 | } |
30 | } |