phpcs: Use __DIR__ constant instead of calling
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 12 Nov 2015 18:58:20 +0000 (19:58 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 15 Nov 2015 20:14:42 +0000 (21:14 +0100)
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

includes/PHPVersionCheck.php
includes/PHPVersionError.php
index.php
maintenance/Maintenance.php
maintenance/install.php
maintenance/populateFilearchiveSha1.php
mw-config/index.php
tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php

index 333d040..41e88c2 100644 (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 );
        }
 }
index 007ea89..9fbcf89 100644 (file)
@@ -21,4 +21,6 @@
  * @deprecated 1.25
  * @file
  */
+// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
 require_once dirname( __FILE__ ) . '/PHPVersionCheck.php';
+// @codingStandardsIgnoreEnd
index 67bd0c9..2423092 100644 (file)
--- a/index.php
+++ b/index.php
@@ -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';
index 8dad5dc..7825ce9 100644 (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' );
 
 /**
index 212e42a..ae3074a 100644 (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 );
index 850a5a5..a3099f9 100644 (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.
index be811dc..31b201c 100644 (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' );
index 9d97b28..a6d1d05 100644 (file)
@@ -21,7 +21,7 @@ class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase {
 
        private static function getModules() {
                $base = array(
-                       'localBasePath' => realpath( dirname( __FILE__ ) ),
+                       'localBasePath' => realpath( __DIR__ ),
                );
 
                return array(