* @ingroup Content
*/
abstract class AbstractContent implements Content {
-
/**
* Name of the content model this Content object represents.
* Use with CONTENT_MODEL_XXX constants
break;
}
// Redirects to some special pages are not permitted
- if ( $newtitle instanceOf Title && $newtitle->isValidRedirectTarget() ) {
+ if ( $newtitle instanceof Title && $newtitle->isValidRedirectTarget() ) {
// The new title passes the checks, so make that our current
// title so that further recursion can be checked
$title = $newtitle;
break;
}
}
+
return $titles;
}
*/
public function getUltimateRedirectTarget() {
$titles = $this->getRedirectChain();
+
return $titles ? array_pop( $titles ) : null;
}
* database after deletion.
*/
public function getDeletionUpdates( WikiPage $page,
- ParserOutput $parserOutput = null )
- {
+ ParserOutput $parserOutput = null
+ ) {
return array(
new LinksDeletionUpdate( $page ),
);
}
/**
- * This default implementation always returns false. Subclasses may override this to supply matching logic.
+ * This default implementation always returns false. Subclasses may override
+ * this to supply matching logic.
*
* @see Content::matchMagicWord
*
* This base implementation calls the hook ConvertContent to enable custom conversions.
* Subclasses may override this to implement conversion for "their" content model.
*
- * @param string $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
- * @param string $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
+ * @param string $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
+ * @param string $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
* not allowed, full round-trip conversion is expected to work without losing information.
*
* @return Content|bool A content object with the content model $toModel, or false if
$result = false;
wfRunHooks( 'ConvertContent', array( $this, $toModel, $lossy, &$result ) );
+
return $result;
}
}