Fix php code style
Preparation change for updating mediawiki code sniffer to 0.8.0 Change-Id: Ib0b3fe4afea9096ffa3a1347b4f7e07d3398b0b2
This commit is contained in:
parent
a3feb82b8f
commit
54c56da85a
27 changed files with 42 additions and 63 deletions
|
|
@ -3170,7 +3170,6 @@ class EditPage {
|
|||
);
|
||||
$wgOut->addHTML( "{$label} {$input}" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1436,7 +1436,6 @@ function wfMsgReplaceArgs( $message, $args ) {
|
|||
function wfHostname() {
|
||||
static $host;
|
||||
if ( is_null( $host ) ) {
|
||||
|
||||
# Hostname overriding
|
||||
global $wgOverrideHostname;
|
||||
if ( $wgOverrideHostname !== false ) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* but instead manually called by WikitextHandler.
|
||||
* This should be fixed in the future.
|
||||
*/
|
||||
class FileContentHandler extends WikitextContentHandler {
|
||||
class FileContentHandler extends WikitextContentHandler {
|
||||
|
||||
public function getFieldsForSearchIndex( SearchEngine $engine ) {
|
||||
$fields['file_media_type'] =
|
||||
|
|
|
|||
|
|
@ -231,7 +231,6 @@ class RecentChangesUpdateJob extends Job {
|
|||
],
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
},
|
||||
__METHOD__
|
||||
);
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ class IEUrlExtension {
|
|||
// Check QUERY_STRING or REQUEST_URI
|
||||
if ( isset( $vars['SERVER_SOFTWARE'] )
|
||||
&& isset( $vars['REQUEST_URI'] )
|
||||
&& self::haveUndecodedRequestUri( $vars['SERVER_SOFTWARE'] ) )
|
||||
{
|
||||
&& self::haveUndecodedRequestUri( $vars['SERVER_SOFTWARE'] )
|
||||
) {
|
||||
$urlPart = $vars['REQUEST_URI'];
|
||||
} elseif ( isset( $vars['QUERY_STRING'] ) ) {
|
||||
$urlPart = $vars['QUERY_STRING'];
|
||||
|
|
@ -79,8 +79,8 @@ class IEUrlExtension {
|
|||
// Some servers have PATH_INFO but not REQUEST_URI, so we check both
|
||||
// to be on the safe side.
|
||||
if ( isset( $vars['PATH_INFO'] )
|
||||
&& self::isUrlExtensionBad( $vars['PATH_INFO'], $extWhitelist ) )
|
||||
{
|
||||
&& self::isUrlExtensionBad( $vars['PATH_INFO'], $extWhitelist )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -223,8 +223,8 @@ class IEUrlExtension {
|
|||
// If the extension is NOT exe, dll or cgi, return it
|
||||
$extension = substr( $url, $pos, $nextPos - $pos );
|
||||
if ( strcasecmp( $extension, 'exe' ) && strcasecmp( $extension, 'dll' ) &&
|
||||
strcasecmp( $extension, 'cgi' ) )
|
||||
{
|
||||
strcasecmp( $extension, 'cgi' )
|
||||
) {
|
||||
return $extension;
|
||||
}
|
||||
// Else continue looking
|
||||
|
|
|
|||
|
|
@ -399,8 +399,8 @@ class IEContentAnalyzer {
|
|||
$proposedFormat = $this->getDataFormat( $version, $proposed );
|
||||
if ( $proposedFormat == 'unknown'
|
||||
&& $proposed != 'multipart/mixed'
|
||||
&& $proposed != 'multipart/x-mixed-replace' )
|
||||
{
|
||||
&& $proposed != 'multipart/x-mixed-replace'
|
||||
) {
|
||||
return $proposed;
|
||||
}
|
||||
if ( strval( $chunk ) === '' ) {
|
||||
|
|
@ -426,15 +426,15 @@ class IEContentAnalyzer {
|
|||
return 'image/gif';
|
||||
}
|
||||
if ( ( $proposed == 'image/pjpeg' || $proposed == 'image/jpeg' )
|
||||
&& $binaryType == 'image/pjpeg' )
|
||||
{
|
||||
&& $binaryType == 'image/pjpeg'
|
||||
) {
|
||||
return $proposed;
|
||||
}
|
||||
// PNG check added in IE 7
|
||||
if ( $version >= 'ie07'
|
||||
&& ( $proposed == 'image/x-png' || $proposed == 'image/png' )
|
||||
&& $binaryType == 'image/x-png' )
|
||||
{
|
||||
&& $binaryType == 'image/x-png'
|
||||
) {
|
||||
return $proposed;
|
||||
}
|
||||
|
||||
|
|
@ -450,8 +450,8 @@ class IEContentAnalyzer {
|
|||
}
|
||||
if ( isset( $sampleFound['rdf-tag'] )
|
||||
&& isset( $sampleFound['rdf-url'] )
|
||||
&& isset( $sampleFound['rdf-purl'] ) )
|
||||
{
|
||||
&& isset( $sampleFound['rdf-purl'] )
|
||||
) {
|
||||
return 'application/rss+xml';
|
||||
}
|
||||
if ( isset( $sampleFound['atom'] ) ) {
|
||||
|
|
@ -497,8 +497,8 @@ class IEContentAnalyzer {
|
|||
// Freaky heuristics to determine if the data is text or binary
|
||||
// The heuristic is of course broken for non-ASCII text
|
||||
if ( $counters['ctrl'] != 0 && ( $counters['ff'] + $counters['low'] )
|
||||
< ( $counters['ctrl'] + $counters['high'] ) * 16 )
|
||||
{
|
||||
< ( $counters['ctrl'] + $counters['high'] ) * 16
|
||||
) {
|
||||
$kindOfBinary = true;
|
||||
$type = $binaryType ? $binaryType : $textType;
|
||||
if ( $type === false ) {
|
||||
|
|
@ -599,13 +599,13 @@ class IEContentAnalyzer {
|
|||
|
||||
if ( $chunk2 == 'BM'
|
||||
&& substr( $chunk, 6, 2 ) == "\000\000"
|
||||
&& substr( $chunk, 8, 2 ) == "\000\000" )
|
||||
{
|
||||
&& substr( $chunk, 8, 2 ) == "\000\000"
|
||||
) {
|
||||
return 'image/bmp'; // another non-standard MIME
|
||||
}
|
||||
if ( $chunk4 == 'RIFF'
|
||||
&& substr( $chunk, 8, 4 ) == 'WAVE' )
|
||||
{
|
||||
&& substr( $chunk, 8, 4 ) == 'WAVE'
|
||||
) {
|
||||
return 'audio/wav';
|
||||
}
|
||||
// These were integer literals in IE
|
||||
|
|
@ -613,8 +613,8 @@ class IEContentAnalyzer {
|
|||
if ( $chunk4 == ".sd\000"
|
||||
|| $chunk4 == ".snd"
|
||||
|| $chunk4 == "\000ds."
|
||||
|| $chunk4 == "dns." )
|
||||
{
|
||||
|| $chunk4 == "dns."
|
||||
) {
|
||||
return 'audio/basic';
|
||||
}
|
||||
if ( $chunk3 == "MM\000" ) {
|
||||
|
|
@ -648,8 +648,8 @@ class IEContentAnalyzer {
|
|||
return 'video/mpeg';
|
||||
}
|
||||
if ( $chunk4 == "\001\000\000\000"
|
||||
&& substr( $chunk, 40, 4 ) == ' EMF' )
|
||||
{
|
||||
&& substr( $chunk, 40, 4 ) == ' EMF'
|
||||
) {
|
||||
return 'image/x-emf';
|
||||
}
|
||||
if ( $chunk4 == "\xd7\xcd\xc6\x9a" ) {
|
||||
|
|
@ -789,8 +789,8 @@ class IEContentAnalyzer {
|
|||
if ( !strncasecmp( $remainder, $rdfUrl, strlen( $rdfUrl ) ) ) {
|
||||
$found['rdf-url'] = true;
|
||||
if ( isset( $found['rdf-tag'] )
|
||||
&& isset( $found['rdf-purl'] ) ) // [sic]
|
||||
{
|
||||
&& isset( $found['rdf-purl'] ) // [sic]
|
||||
) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -798,8 +798,8 @@ class IEContentAnalyzer {
|
|||
|
||||
if ( !strncasecmp( $remainder, $rdfPurl, strlen( $rdfPurl ) ) ) {
|
||||
if ( isset( $found['rdf-tag'] )
|
||||
&& isset( $found['rdf-url'] ) ) // [sic]
|
||||
{
|
||||
&& isset( $found['rdf-url'] ) // [sic]
|
||||
) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -735,8 +735,8 @@ EOT;
|
|||
( strpos( $head, "<\x00?\x00 " ) !== false ) ||
|
||||
( strpos( $head, "<\x00?\x00\n" ) !== false ) ||
|
||||
( strpos( $head, "<\x00?\x00\t" ) !== false ) ||
|
||||
( strpos( $head, "<\x00?\x00=" ) !== false ) ) {
|
||||
|
||||
( strpos( $head, "<\x00?\x00=" ) !== false )
|
||||
) {
|
||||
$this->logger->info( __METHOD__ . ": recognized $file as application/x-php\n" );
|
||||
return 'application/x-php';
|
||||
}
|
||||
|
|
@ -1035,7 +1035,6 @@ EOT;
|
|||
// Special code for ogg - detect if it's video (theora),
|
||||
// else label it as sound.
|
||||
if ( $mime == 'application/ogg' && file_exists( $path ) ) {
|
||||
|
||||
// Read a chunk of the file
|
||||
$f = fopen( $path, "rt" );
|
||||
if ( !$f ) {
|
||||
|
|
|
|||
|
|
@ -28,14 +28,12 @@ class LoadMonitorNull implements ILoadMonitor {
|
|||
public function __construct(
|
||||
ILoadBalancer $lb, BagOStuff $sCache, BagOStuff $cCache, array $options = []
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public function setLogger( LoggerInterface $logger ) {
|
||||
}
|
||||
|
||||
public function scaleLoads( array &$loads, $domain ) {
|
||||
|
||||
}
|
||||
|
||||
public function getLagTimes( array $serverIndexes, $domain ) {
|
||||
|
|
@ -43,6 +41,5 @@ class LoadMonitorNull implements ILoadMonitor {
|
|||
}
|
||||
|
||||
public function clearCaches() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class SamplingStatsdClient extends StatsdClient {
|
|||
return $data;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Send the metrics over UDP
|
||||
* Sample the metrics according to their sample rate and send the remaining ones.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -272,7 +272,6 @@ class XMPReader implements LoggerAwareInterface {
|
|||
if ( isset( $data['xmp-exif']['GPSAltitudeRef'] )
|
||||
&& isset( $data['xmp-exif']['GPSAltitude'] )
|
||||
) {
|
||||
|
||||
// Must convert to a real before multiplying by -1
|
||||
// XMPValidate guarantees there will always be a '/' in this value.
|
||||
list( $nom, $denom ) = explode( '/', $data['xmp-exif']['GPSAltitude'] );
|
||||
|
|
@ -1004,7 +1003,6 @@ class XMPReader implements LoggerAwareInterface {
|
|||
*/
|
||||
private function startElementModeInitial( $ns, $tag, $attribs ) {
|
||||
if ( $ns !== self::NS_RDF ) {
|
||||
|
||||
if ( isset( $this->items[$ns][$tag] ) ) {
|
||||
if ( isset( $this->items[$ns][$tag]['structPart'] ) ) {
|
||||
// If this element is supposed to appear only as
|
||||
|
|
@ -1066,7 +1064,6 @@ class XMPReader implements LoggerAwareInterface {
|
|||
*/
|
||||
private function startElementModeStruct( $ns, $tag, $attribs ) {
|
||||
if ( $ns !== self::NS_RDF ) {
|
||||
|
||||
if ( isset( $this->items[$ns][$tag] ) ) {
|
||||
if ( isset( $this->items[$ns][$this->ancestorStruct]['children'] )
|
||||
&& !isset( $this->items[$ns][$this->ancestorStruct]['children'][$tag] )
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
/**
|
||||
* @ingroup Parser
|
||||
*/
|
||||
class ParserDiffTest
|
||||
{
|
||||
class ParserDiffTest {
|
||||
public $parsers;
|
||||
public $conf;
|
||||
public $shortOutput = false;
|
||||
|
|
|
|||
|
|
@ -455,8 +455,8 @@ abstract class SearchEngine {
|
|||
$title = Title::newFromText( $search . 'Dummy' );
|
||||
if ( $title && $title->getText() == 'Dummy'
|
||||
&& $title->getNamespace() != NS_MAIN
|
||||
&& !$title->isExternal() )
|
||||
{
|
||||
&& !$title->isExternal()
|
||||
) {
|
||||
$ns = [ $title->getNamespace() ];
|
||||
$search = '';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ class ServiceContainer implements DestructibleService {
|
|||
|
||||
$instance = $this->peekService( $name );
|
||||
|
||||
if ( $destroy && $instance instanceof DestructibleService ) {
|
||||
if ( $destroy && $instance instanceof DestructibleService ) {
|
||||
$instance->destroy();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1022,7 +1022,6 @@ abstract class ChangesListSpecialPage extends SpecialPage {
|
|||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
|
|||
$jsData = $this->getStructuredFilterJsData();
|
||||
|
||||
$messages = [];
|
||||
foreach ( $jsData['messageKeys'] as $key ){
|
||||
foreach ( $jsData['messageKeys'] as $key ) {
|
||||
$messages[$key] = $this->msg( $key )->plain();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -522,7 +522,6 @@ class User implements IDBAccessObject {
|
|||
}
|
||||
|
||||
return $data;
|
||||
|
||||
},
|
||||
[ 'pcTTL' => $cache::TTL_PROC_LONG, 'version' => self::VERSION ]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,6 @@ global \${$this->variableName};
|
|||
];
|
||||
|
||||
EOD;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ class BatchRowIterator implements RecursiveIterator {
|
|||
|
||||
/**
|
||||
* @param IDatabase $db The database to read from
|
||||
* @param string|array $table The name or names of the table to read from
|
||||
* @param string|array $table The name or names of the table to read from
|
||||
* @param string|array $primaryKey The name or names of the primary key columns
|
||||
* @param integer $batchSize The number of rows to fetch per iteration
|
||||
* @param integer $batchSize The number of rows to fetch per iteration
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct( IDatabase $db, $table, $primaryKey, $batchSize ) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use Html;
|
|||
* interwiki prefix. Includes a per-wiki header indicating where
|
||||
* the results are from.
|
||||
*/
|
||||
class SimpleSearchResultSetWidget implements SearchResultSetWidget{
|
||||
class SimpleSearchResultSetWidget implements SearchResultSetWidget {
|
||||
/** @var SpecialSearch */
|
||||
protected $specialSearch;
|
||||
/** @var SearchResultWidget */
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ unset( $lines );
|
|||
|
||||
$lines = explode( "\n", shell_exec( 'git log --format="%aN"' ) );
|
||||
foreach ( $lines as $line ) {
|
||||
if ( empty( $line ) ) {
|
||||
if ( empty( $line ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( substr( $line, 0, 5 ) === '[BOT]' ) {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ class ChangesListFilterTest extends MediaWikiTestCase {
|
|||
'filters' => [],
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ class FakeDatabaseMysqlBase extends DatabaseMysqlBase {
|
|||
}
|
||||
|
||||
protected function mysqlRealEscapeString( $s ) {
|
||||
|
||||
}
|
||||
|
||||
function insertId() {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ class DeferredUpdatesTest extends MediaWikiTestCase {
|
|||
$post = DeferredUpdates::POSTSEND;
|
||||
$all = DeferredUpdates::ALL;
|
||||
|
||||
$update = $this->getMockBuilder( 'DeferrableUpdate' )
|
||||
->getMock();
|
||||
$update = $this->getMock( DeferrableUpdate::class );
|
||||
$update->expects( $this->never() )
|
||||
->method( 'doUpdate' );
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ class DnsSrvDiscovererTest extends PHPUnit_Framework_TestCase {
|
|||
$record = $discoverer->pickServer( $params );
|
||||
|
||||
$this->assertEquals( $expected, $record );
|
||||
|
||||
}
|
||||
|
||||
public static function provideRecords() {
|
||||
|
|
|
|||
|
|
@ -323,7 +323,6 @@ class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase {
|
|||
$expected,
|
||||
$module->getContent( $titleText )
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ class SearchIndexFieldTest extends MediaWikiTestCase {
|
|||
}
|
||||
);
|
||||
$this->assertEquals( "test", $field1->merge( $field2 ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ class SpecialWatchlistTest extends SpecialPageTestBase {
|
|||
'watchlistreloadautomatically' => 0,
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue