phpcs: Use __DIR__ constant instead of calling

Replaced all dirname(__FILE__) by __DIR__ or added
@codingStandardsIgnore

Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull

Change-Id: I90ff10f183ed60175fe580c43d73c0e57fd04234
This commit is contained in:
umherirrender 2015-11-12 19:58:20 +01:00
parent da6afd8899
commit 04bef3dd66
8 changed files with 14 additions and 2 deletions

View file

@ -40,7 +40,9 @@ function wfEntryPointCheck( $entryPoint ) {
wfPHPVersionError( $entryPoint, $mwVersion, $minimumVersionPHP, $phpVersion );
}
// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
if ( !file_exists( dirname( __FILE__ ) . '/../vendor/autoload.php' ) ) {
// @codingStandardsIgnoreEnd
wfMissingVendorError( $entryPoint, $mwVersion );
}
}

View file

@ -21,4 +21,6 @@
* @deprecated 1.25
* @file
*/
// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/PHPVersionCheck.php';
// @codingStandardsIgnoreEnd

View file

@ -32,7 +32,9 @@
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
// @codingStandardsIgnoreEnd
wfEntryPointCheck( 'index.php' );
require __DIR__ . '/includes/WebStart.php';

View file

@ -22,7 +22,9 @@
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
// @codingStandardsIgnoreEnd
wfEntryPointCheck( 'cli' );
/**

View file

@ -23,7 +23,9 @@
// Checking for old versions of PHP is done in Maintenance.php
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/Maintenance.php';
// @codingStandardsIgnoreEnd
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
define( 'MEDIAWIKI_INSTALL', true );

View file

@ -21,7 +21,7 @@
* @ingroup Maintenance
*/
require_once dirname( __FILE__ ) . '/Maintenance.php';
require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to populate the fa_sha1 field.

View file

@ -22,7 +22,9 @@
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
// @codingStandardsIgnoreEnd
wfEntryPointCheck( 'mw-config/index.php' );
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );

View file

@ -21,7 +21,7 @@ class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase {
private static function getModules() {
$base = array(
'localBasePath' => realpath( dirname( __FILE__ ) ),
'localBasePath' => realpath( __DIR__ ),
);
return array(