Remove JSONContentHandler::$contentClass
[lhc/web/wiklou.git] / includes / content / JSONContentHandler.php
1 <?php
2 /**
3 * JSON Schema Content Handler
4 *
5 * @file
6 *
7 * @author Ori Livneh <ori@wikimedia.org>
8 * @author Kunal Mehta <legoktm@gmail.com>
9 */
10
11 /**
12 * @since 1.24
13 */
14 class JSONContentHandler extends TextContentHandler {
15
16 public function __construct( $modelId = CONTENT_MODEL_JSON ) {
17 parent::__construct( $modelId, array( CONTENT_FORMAT_JSON ) );
18 }
19
20 /**
21 * @return string
22 */
23 protected function getContentClass() {
24 return 'JSONContent';
25 }
26
27 /**
28 * Returns the english language, because JSON is english, and should be handled as such.
29 *
30 * @param Title $title
31 * @param Content|null $content
32 *
33 * @return Language Return of wfGetLangObj( 'en' )
34 *
35 * @see ContentHandler::getPageLanguage()
36 */
37 public function getPageLanguage( Title $title, Content $content = null ) {
38 return wfGetLangObj( 'en' );
39 }
40
41 /**
42 * Returns the english language, because JSON is english, and should be handled as such.
43 *
44 * @param Title $title
45 * @param Content|null $content
46 *
47 * @return Language Return of wfGetLangObj( 'en' )
48 *
49 * @see ContentHandler::getPageLanguage()
50 */
51 public function getPageViewLanguage( Title $title, Content $content = null ) {
52 return wfGetLangObj( 'en' );
53 }
54 }