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
3namespace MediaWiki\Content;
4
5use ContentHandler;
6use MWUnknownContentModelException;
7
8interface IContentHandlerFactory {
9
10    /**
11     * Returns a ContentHandler instance for the given $modelID.
12     *
13     * @param string $modelID
14     *
15     * @return ContentHandler
16     * @throws MWUnknownContentModelException If no handler is known for the model ID.
17     */
18    public function getContentHandler( string $modelID ): ContentHandler;
19
20    /**
21     * Returns a list of defined content models.
22     * getContentHandler() can be expected to return a ContentHandler for the models returned
23     * by this method.
24     *
25     * @return string[]
26     */
27    public function getContentModels(): array;
28
29    /**
30     * Returns a list of all serialization formats supported for any of the defined content models.
31     * @see ContentHandler::getSupportedFormats()
32     * @return string[]
33     */
34    public function getAllContentFormats(): array;
35
36    /**
37     * Returns true if $modelID is a defined content model for which getContentHandler() can be
38     * expected to return a ContentHandler instance.
39     * @param string $modelID
40     *
41     * @return bool
42     */
43    public function isDefinedModel( string $modelID ): bool;
44}