<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
<exclude name="Squiz.Scope.MethodScope.Missing" />
- <exclude name="Squiz.WhiteSpace.FunctionSpacing" />
</rule>
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
<properties>
* @see https://www.php.net/manual/en/class.arrayaccess.php
*/
/* @{ */
+
/**
* Whether the option exists.
* @param string $name
}
/** @noinspection PhpDocSignatureInspection */
+
/**
* Salvages the state of any salvageable service instances in $other.
*
define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
}
if ( !is_readable( MW_CONFIG_FILE ) ) {
+
function wfWebStartNoLocalSettings() {
# LocalSettings.php is the per-site customization file. If it does not exist
# the wiki installer needs to be launched or the generated file uploaded to
require_once "$IP/includes/NoLocalSettings.php";
die();
}
+
define( 'MW_CONFIG_CALLBACK', 'wfWebStartNoLocalSettings' );
}
}
// Custom setup for WebStart entry point
if ( !defined( 'MW_SETUP_CALLBACK' ) ) {
+
function wfWebStartSetup() {
// Initialise output buffering
// Check for previously set up buffers, to avoid a mix of gzip and non-gzip output.
ob_start( 'MediaWiki\\OutputHandler::handle' );
}
}
+
define( 'MW_SETUP_CALLBACK', 'wfWebStartSetup' );
}
}
return $year && $month && $day ? $year . '-' . $month . '-' . $day : '';
}
+
/**
* Print the history page for an article.
*/
header( $header );
}
}
+
private static function statusHeader( $code ) {
if ( !headers_sent() ) {
HttpStatus::header( $code );
return $value;
}
+
public function set( $key, $value, $exptime = 0, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
// Only the first cache is locked
return $this->caches[0]->unlock( $key );
}
+
/**
* Delete objects expiring before a certain date.
*
public function clearLastError() {
$this->caches[0]->clearLastError();
}
+
/**
* Apply a write method to the backing caches specified by $indexes (in order)
*
/**#@+
* @return array
*/
+
/**
* Get $this->mRawExifData
* @return array
*/
interface Pager {
function getNavigationBar();
+
function getBody();
}
public static function numberofusers( $parser, $raw = null ) {
return self::formatRaw( SiteStats::users(), $raw, $parser->getFunctionLang() );
}
+
public static function numberofactiveusers( $parser, $raw = null ) {
return self::formatRaw( SiteStats::activeUsers(), $raw, $parser->getFunctionLang() );
}
$parser->getFunctionLang()
);
}
+
public static function numberingroup( $parser, $name = '', $raw = null ) {
return self::formatRaw(
SiteStats::numberingroup( strtolower( $name ) ),
}
return str_replace( '_', ' ', $t->getNsText() );
}
+
public static function namespacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfUrlencode( $t->getNsText() );
}
+
public static function namespacenumber( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return $t->getNamespace();
}
+
public static function talkspace( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
}
return str_replace( '_', ' ', $t->getTalkNsText() );
}
+
public static function talkspacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
}
return wfUrlencode( $t->getTalkNsText() );
}
+
public static function subjectspace( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return str_replace( '_', ' ', $t->getSubjectNsText() );
}
+
public static function subjectspacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getText() );
}
+
public static function pagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getPartialURL() );
}
+
public static function fullpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
}
return wfEscapeWikiText( $t->getPrefixedText() );
}
+
public static function fullpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
}
return wfEscapeWikiText( $t->getPrefixedURL() );
}
+
public static function subpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getSubpageText() );
}
+
public static function subpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getSubpageUrlForm() );
}
+
public static function rootpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getRootText() );
}
+
public static function rootpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( wfUrlencode( str_replace( ' ', '_', $t->getRootText() ) ) );
}
+
public static function basepagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getBaseText() );
}
+
public static function basepagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( wfUrlencode( str_replace( ' ', '_', $t->getBaseText() ) ) );
}
+
public static function talkpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
}
return wfEscapeWikiText( $t->getTalkPage()->getPrefixedText() );
}
+
public static function talkpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
}
return wfEscapeWikiText( $t->getTalkPage()->getPrefixedURL() );
}
+
public static function subjectpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
}
return wfEscapeWikiText( $t->getSubjectPage()->getPrefixedText() );
}
+
public static function subjectpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
* @var string
*/
private $cacheEpoch;
+
/**
* Get an instance of this object
*
public function setNoGallery( $value ) {
$this->mNoGallery = (bool)$value;
}
+
public function getNoGallery() {
return $this->mNoGallery;
}
public function setNewSection( $value ) {
$this->mNewSection = (bool)$value;
}
+
public function hideNewSection( $value ) {
$this->mHideNewSection = (bool)$value;
}
+
public function getHideNewSection() {
return (bool)$this->mHideNewSection;
}
+
public function getNewSection() {
return (bool)$this->mNewSection;
}
*/
class RemexStripTagHandler implements TokenHandler {
private $text = '';
+
public function getResult() {
return $this->text;
}
function startDocument( Tokenizer $t, $fns, $fn ) {
// Do nothing.
}
+
function endDocument( $pos ) {
// Do nothing.
}
+
function error( $text, $pos ) {
// Do nothing.
}
+
function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
$this->text .= substr( $text, $start, $length );
}
+
function startTag( $name, Attributes $attrs, $selfClose, $sourceStart, $sourceLength ) {
// Inject whitespace for typical block-level tags to
// prevent merging unrelated<br>words.
$this->text .= ' ';
}
}
+
function endTag( $name, $sourceStart, $sourceLength ) {
// Inject whitespace for typical block-level tags to
// prevent merging unrelated<br>words.
$this->text .= ' ';
}
}
+
function doctype( $name, $public, $system, $quirks, $sourceStart, $sourceLength ) {
// Do nothing.
}
+
function comment( $text, $sourceStart, $sourceLength ) {
// Do nothing.
}
// to include data on filters that use the unstructured UI. messageKeys is a
// special top-level value, with the value being an array of the message keys to
// send to the client.
+
/**
* Gets structured filter information needed by JS
*
}
// @todo FIXME: Decide which syntax to use for this, and stick to it
+
/**
* Whether this special page is listed in Special:SpecialPages
* @since 1.3 (r3583)
class UploadChunkVerificationException extends MWException {
public $msg;
+
public function __construct( array $res ) {
$this->msg = wfMessage( ...$res );
parent::__construct( wfMessage( ...$res )
// Custom setup for Maintenance entry point
if ( !defined( 'MW_SETUP_CALLBACK' ) ) {
+
function wfMaintenanceSetup() {
// phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $maintenance, $wgLocalisationCacheConf, $wgCacheDirectory;
$maintenance->finalSetup();
}
+
define( 'MW_SETUP_CALLBACK', 'wfMaintenanceSetup' );
}
$this->addOption( 'commit', 'Whether to actually update the database', false, false );
$this->setBatchSize( 500 );
}
+
public function execute() {
$this->commit = $this->hasOption( 'commit' );
$dbr = $this->getDB( DB_REPLICA );
true
);
}
+
public function execute() {
$validator = new ExtensionJsonValidator( function ( $msg ) {
$this->fatalError( $msg );
public function __construct( $mode ) {
$this->mode = $mode;
}
+
public function suppress( $input ) {
echo "Unsupported output mode: {$this->mode}\n$input";
return true;
public function isRaw() {
return $this->isRaw;
}
+
public function isKnownEmpty( ResourceLoaderContext $context ) {
return $this->isKnownEmpty;
}
private function assertGuessBoolean( $data ) {
$this->guess( FormOptions::BOOL, $data );
}
+
private function assertGuessInt( $data ) {
$this->guess( FormOptions::INT, $data );
}
+
private function assertGuessFloat( $data ) {
$this->guess( FormOptions::FLOAT, $data );
}
+
private function assertGuessString( $data ) {
$this->guess( FormOptions::STRING, $data );
}
+
private function assertGuessArray( $data ) {
$this->guess( FormOptions::ARR, $data );
}
FormOptions::guessType( $data )
);
}
+
/* @} */
/**
parent::setUp();
ResourceLoader::clearCache();
}
+
protected function tearDown() {
parent::tearDown();
ResourceLoader::clearCache();
->disableOriginalConstructor()
->getMock();
}
+
private function getMockParserOptions() {
return $this->getMockBuilder( ParserOptions::class )
->disableOriginalConstructor()
public function massageSvgPathdata( $svg ) {
return parent::massageSvgPathdata( $svg );
}
+
// Stub, since we don't know if we even have a SVG handler, much less what exactly it'll output
public function rasterize( $svg ) {
return 'RASTERIZESTUB';
class TestResourceLoaderWikiModule extends ResourceLoaderWikiModule {
public static $returnFetchTitleInfo = null;
+
protected static function fetchTitleInfo( IDatabase $db, array $pages, $fname = null ) {
$ret = self::$returnFetchTitleInfo;
self::$returnFetchTitleInfo = null;
$user
);
}
+
public function testRcHidepatrolledFilter() {
$user = $this->getTestSysop()->getUser();
$this->assertConditions(
* getSubject/Talk/Associated
* %{
*/
+
/**
* @dataProvider provideSubjectTalk
* @covers NamespaceInfo::getSubject
// No canonical namespace names
// %{
+
/**
* @covers NamespaceInfo::getCanonicalNamespaces
*/
// Hook namespaces
// %{
+
/**
* @return array Expected canonical namespaces
*/
// Extra namespaces
// %{
+
/**
* @return NamespaceInfo
*/
// Canonical namespace caching
// %{
+
/**
* @covers NamespaceInfo::getCanonicalNamespaces
*/
}
# #### HELPERS #####################################################
+
/**
*Wrapper to verify text stay the same after applying conversion
* @param string $text Text to convert
}
# #### HELPERS #####################################################
+
/**
* Wrapper to verify text stay the same after applying conversion
* @param string $text Text to convert
public function isMissingRevision() {
return $this->isMissingRevision;
}
+
public function setMissingRevision( $isMissingRevision ) {
$this->isMissingRevision = $isMissingRevision;
return $this;