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 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace Wikimedia\Parsoid\Ext; |
| 5 | |
| 6 | /** |
| 7 | * A Parsoid native extension module. This bundles up the |
| 8 | * configuration for a number of different ExtensionTagHandlers, |
| 9 | * ContentModelHandlers, FragmentHandlers, and DomProcessors into one |
| 10 | * registered object. The only method required is `getConfig`. |
| 11 | * |
| 12 | * An ExtensionModule can be created on-demand from configuration data |
| 13 | * specified in extension.json; see SiteConfig::registerExtensionModule() |
| 14 | * and |
| 15 | * https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#ParsoidModules |
| 16 | * |
| 17 | * Implementing an ExtensionModule should only be done by Parsoid-internal |
| 18 | * extensions. If you are implementing a Parsoid module in an extension |
| 19 | * and have an `extension.json`, you should use that to specify your |
| 20 | * module configuration. |
| 21 | */ |
| 22 | interface ExtensionModule { |
| 23 | |
| 24 | /** |
| 25 | * Return information about this extension module. |
| 26 | * |
| 27 | * The structure of the return value is enforced by |
| 28 | * `moduleconfig.schema.json`, in this directory. |
| 29 | * |
| 30 | * @see https://www.mediawiki.org/wiki/Parsoid/Internals/Module_Configuration_Schema |
| 31 | * @return array{name:string} |
| 32 | */ |
| 33 | public function getConfig(): array; |
| 34 | |
| 35 | } |