dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "resourceloader: Inverse hasOwn() check to fix require in debug mode"
[lhc/web/wiklou.git]
/
includes
/
content
/
ContentHandler.php
diff --git
a/includes/content/ContentHandler.php
b/includes/content/ContentHandler.php
index
e898e72
..
9ab11f3
100644
(file)
--- a/
includes/content/ContentHandler.php
+++ b/
includes/content/ContentHandler.php
@@
-227,7
+227,7
@@
abstract class ContentHandler {
$model = MWNamespace::getNamespaceContentModel( $ns );
// Hook can determine default model
$model = MWNamespace::getNamespaceContentModel( $ns );
// Hook can determine default model
- if ( !Hooks::run( 'ContentHandlerDefaultModelFor',
array( $title, &$model )
) ) {
+ if ( !Hooks::run( 'ContentHandlerDefaultModelFor',
[ $title, &$model ]
) ) {
if ( !is_null( $model ) ) {
return $model;
}
if ( !is_null( $model ) ) {
return $model;
}
@@
-240,7
+240,7
@@
abstract class ContentHandler {
}
// Hook can force JS/CSS
}
// Hook can force JS/CSS
- Hooks::run( 'TitleIsCssOrJsPage',
array( $title, &$isCodePage )
, '1.25' );
+ Hooks::run( 'TitleIsCssOrJsPage',
[ $title, &$isCodePage ]
, '1.25' );
// Is this a user subpage containing code?
$isCodeSubpage = NS_USER == $ns
// Is this a user subpage containing code?
$isCodeSubpage = NS_USER == $ns
@@
-255,7
+255,7
@@
abstract class ContentHandler {
$isWikitext = $isWikitext && !$isCodePage && !$isCodeSubpage;
// Hook can override $isWikitext
$isWikitext = $isWikitext && !$isCodePage && !$isCodeSubpage;
// Hook can override $isWikitext
- Hooks::run( 'TitleIsWikitextPage',
array( $title, &$isWikitext )
, '1.25' );
+ Hooks::run( 'TitleIsWikitextPage',
[ $title, &$isWikitext ]
, '1.25' );
if ( !$isWikitext ) {
switch ( $ext ) {
if ( !$isWikitext ) {
switch ( $ext ) {
@@
-347,7
+347,7
@@
abstract class ContentHandler {
if ( empty( $wgContentHandlers[$modelId] ) ) {
$handler = null;
if ( empty( $wgContentHandlers[$modelId] ) ) {
$handler = null;
- Hooks::run( 'ContentHandlerForModelID',
array( $modelId, &$handler )
);
+ Hooks::run( 'ContentHandlerForModelID',
[ $modelId, &$handler ]
);
if ( $handler === null ) {
throw new MWUnknownContentModelException( $modelId );
if ( $handler === null ) {
throw new MWUnknownContentModelException( $modelId );
@@
-414,7
+414,7
@@
abstract class ContentHandler {
public static function getAllContentFormats() {
global $wgContentHandlers;
public static function getAllContentFormats() {
global $wgContentHandlers;
- $formats =
array()
;
+ $formats =
[]
;
foreach ( $wgContentHandlers as $model => $class ) {
$handler = ContentHandler::getForModelID( $model );
foreach ( $wgContentHandlers as $model => $class ) {
$handler = ContentHandler::getForModelID( $model );
@@
-644,7
+644,7
@@
abstract class ContentHandler {
* @return array Always an empty array.
*/
public function getActionOverrides() {
* @return array Always an empty array.
*/
public function getActionOverrides() {
- return
array()
;
+ return
[]
;
}
/**
}
/**
@@
-668,7
+668,7
@@
abstract class ContentHandler {
// hook: get difference engine
$differenceEngine = null;
if ( !Hooks::run( 'GetDifferenceEngine',
// hook: get difference engine
$differenceEngine = null;
if ( !Hooks::run( 'GetDifferenceEngine',
- array( $context, $old, $new, $refreshCache, $unhide, &$differenceEngine )
+ [ $context, $old, $new, $refreshCache, $unhide, &$differenceEngine ]
) ) {
return $differenceEngine;
}
) ) {
return $differenceEngine;
}
@@
-705,7
+705,7
@@
abstract class ContentHandler {
$pageLang = wfGetLangObj( $lang );
}
$pageLang = wfGetLangObj( $lang );
}
- Hooks::run( 'PageContentLanguage',
array( $title, &$pageLang, $wgLang )
);
+ Hooks::run( 'PageContentLanguage',
[ $title, &$pageLang, $wgLang ]
);
return wfGetLangObj( $pageLang );
}
return wfGetLangObj( $pageLang );
}
@@
-764,7
+764,7
@@
abstract class ContentHandler {
public function canBeUsedOn( Title $title ) {
$ok = true;
public function canBeUsedOn( Title $title ) {
$ok = true;
- Hooks::run( 'ContentModelCanBeUsedOn',
array( $this->getModelID(), $title, &$ok )
);
+ Hooks::run( 'ContentModelCanBeUsedOn',
[ $this->getModelID(), $title, &$ok ]
);
return $ok;
}
return $ok;
}
@@
-923,12
+923,12
@@
abstract class ContentHandler {
// Find out if there was only one contributor
// Only scan the last 20 revisions
$res = $dbw->select( 'revision', 'rev_user_text',
// Find out if there was only one contributor
// Only scan the last 20 revisions
$res = $dbw->select( 'revision', 'rev_user_text',
- array(
+ [
'rev_page' => $title->getArticleID(),
$dbw->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
'rev_page' => $title->getArticleID(),
$dbw->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
-
)
,
+
]
,
__METHOD__,
__METHOD__,
- array( 'LIMIT' => 20 )
+ [ 'LIMIT' => 20 ]
);
if ( $res === false ) {
);
if ( $res === false ) {
@@
-1082,6
+1082,16
@@
abstract class ContentHandler {
return false;
}
return false;
}
+ /**
+ * Returns true if this content model supports categories.
+ * The default implementation returns true.
+ *
+ * @return bool Always true.
+ */
+ public function supportsCategories() {
+ return true;
+ }
+
/**
* Returns true if this content model supports redirects.
* This default implementation returns false.
/**
* Returns true if this content model supports redirects.
* This default implementation returns false.
@@
-1149,7
+1159,7
@@
abstract class ContentHandler {
*
* @see ContentHandler::$enableDeprecationWarnings
*/
*
* @see ContentHandler::$enableDeprecationWarnings
*/
- public static function runLegacyHooks( $event, $args =
array()
,
+ public static function runLegacyHooks( $event, $args =
[]
,
$warn = null
) {
$warn = null
) {
@@
-1166,7
+1176,7
@@
abstract class ContentHandler {
// so we can find and fix them.
$handlers = Hooks::getHandlers( $event );
// so we can find and fix them.
$handlers = Hooks::getHandlers( $event );
- $handlerInfo =
array()
;
+ $handlerInfo =
[]
;
MediaWiki\suppressWarnings();
MediaWiki\suppressWarnings();
@@
-1198,8
+1208,8
@@
abstract class ContentHandler {
}
// convert Content objects to text
}
// convert Content objects to text
- $contentObjects =
array()
;
- $contentTexts =
array()
;
+ $contentObjects =
[]
;
+ $contentTexts =
[]
;
foreach ( $args as $k => $v ) {
if ( $v instanceof Content ) {
foreach ( $args as $k => $v ) {
if ( $v instanceof Content ) {