Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\TemplateStyles\Hooks; |
4 | |
5 | use Wikimedia\CSS\Grammar\MatcherFactory; |
6 | use Wikimedia\CSS\Sanitizer\StylePropertySanitizer; |
7 | use Wikimedia\CSS\Sanitizer\StylesheetSanitizer; |
8 | |
9 | /** |
10 | * This is a hook handler interface, see docs/Hooks.md in core. |
11 | * Use the hook name "TemplateStylesStylesheetSanitizer" to register handlers implementing this interface. |
12 | * |
13 | * @stable to implement |
14 | * @ingroup Hooks |
15 | */ |
16 | interface TemplateStylesStylesheetSanitizerHook { |
17 | /** |
18 | * Allows for adjusting or replacing the StylesheetSanitizer. |
19 | * For example, you might add, remove, or redefine at-rule sanitizers |
20 | * |
21 | * @param StylesheetSanitizer &$sanitizer StylesheetSanitizer to be used for sanitization. |
22 | * The array returned by `$sanitizer->getRuleSanitizers()` will use the at-rule names (including the '@') as keys. |
23 | * The style rule sanitizer has key 'styles' |
24 | * @param StylePropertySanitizer $propertySanitizer StylePropertySanitizer being used for sanitization, |
25 | * for use in adding or redefining rule sanitizers |
26 | * @param MatcherFactory $matcherFactory MatcherFactory being used, for use in adding or redefining rule sanitizers |
27 | * @return bool|void True or no return value to continue or false to abort |
28 | */ |
29 | public function onTemplateStylesStylesheetSanitizer( |
30 | StylesheetSanitizer &$sanitizer, |
31 | StylePropertySanitizer $propertySanitizer, |
32 | MatcherFactory $matcherFactory |
33 | ); |
34 | } |