jenkins-bot has submitted this change and it was merged.

Change subject: phpcs: Use __DIR__ constant instead of calling
......................................................................


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
---
M includes/PHPVersionCheck.php
M includes/PHPVersionError.php
M index.php
M maintenance/Maintenance.php
M maintenance/install.php
M maintenance/populateFilearchiveSha1.php
M mw-config/index.php
M tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
8 files changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php
index 333d040..41e88c2 100644
--- a/includes/PHPVersionCheck.php
+++ b/includes/PHPVersionCheck.php
@@ -40,7 +40,9 @@
                wfPHPVersionError( $entryPoint, $mwVersion, $minimumVersionPHP, 
$phpVersion );
        }
 
+       // @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
        if ( !file_exists( dirname( __FILE__ ) . '/../vendor/autoload.php' ) ) {
+               // @codingStandardsIgnoreEnd
                wfMissingVendorError( $entryPoint, $mwVersion );
        }
 }
diff --git a/includes/PHPVersionError.php b/includes/PHPVersionError.php
index 007ea89..9fbcf89 100644
--- a/includes/PHPVersionError.php
+++ b/includes/PHPVersionError.php
@@ -21,4 +21,6 @@
  * @deprecated 1.25
  * @file
  */
+// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
 require_once dirname( __FILE__ ) . '/PHPVersionCheck.php';
+// @codingStandardsIgnoreEnd
diff --git a/index.php b/index.php
index 67bd0c9..2423092 100644
--- 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';
diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index 8dad5dc..7825ce9 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -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' );
 
 /**
diff --git a/maintenance/install.php b/maintenance/install.php
index 212e42a..ae3074a 100644
--- a/maintenance/install.php
+++ b/maintenance/install.php
@@ -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 );
diff --git a/maintenance/populateFilearchiveSha1.php 
b/maintenance/populateFilearchiveSha1.php
index 850a5a5..a3099f9 100644
--- a/maintenance/populateFilearchiveSha1.php
+++ b/maintenance/populateFilearchiveSha1.php
@@ -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.
diff --git a/mw-config/index.php b/mw-config/index.php
index be811dc..31b201c 100644
--- a/mw-config/index.php
+++ b/mw-config/index.php
@@ -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' );
diff --git 
a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php 
b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
index 9d97b28..a6d1d05 100644
--- a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
@@ -21,7 +21,7 @@
 
        private static function getModules() {
                $base = array(
-                       'localBasePath' => realpath( dirname( __FILE__ ) ),
+                       'localBasePath' => realpath( __DIR__ ),
                );
 
                return array(

-- 
To view, visit https://gerrit.wikimedia.org/r/252747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I90ff10f183ed60175fe580c43d73c0e57fd04234
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to