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 | |
8 | /** |
9 | * This is a hook handler interface, see docs/Hooks.md in core. |
10 | * Use the hook name "TemplateStylesPropertySanitizer" to register handlers implementing this interface. |
11 | * |
12 | * @stable to implement |
13 | * @ingroup Hooks |
14 | */ |
15 | interface TemplateStylesPropertySanitizerHook { |
16 | /** |
17 | * Allows for adjusting or replacing the StylePropertySanitizer used when sanitizing style rules. |
18 | * For example, you might add, remove, or redefine known properties |
19 | * |
20 | * @param StylePropertySanitizer &$propertySanitizer StylePropertySanitizer to be used for sanitization |
21 | * @param MatcherFactory $matcherFactory MatcherFactory being used, for use in adding or redefining known |
22 | * properties or replacing the entire sanitizer |
23 | * @return bool|void True or no return value to continue or false to abort |
24 | */ |
25 | public function onTemplateStylesPropertySanitizer( |
26 | StylePropertySanitizer &$propertySanitizer, |
27 | MatcherFactory $matcherFactory |
28 | ); |
29 | } |