Because it doesn't work. `phpcs:ignoreFile` is intended as a performance
shortcut, and gives up on the file as soon as that token is found.
Instead, use `phpcs:disable` which does support selectively disabling
some sniffs. And since disabling is local to the file, there's no need
to re-enable it at the bottom of the file.
<https://github.com/squizlabs/PHP_CodeSniffer/issues/1903> has some
relevant discussion and clarification from upstream on this.
And make the files that are now being re-enabled pass PHPCS.
Change-Id: Ia4d8c45045f61cf9f24eb1d8631ff98d99c82d69
<?php
// This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
<?php
// This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
-// phpcs:ignoreFile Generic.Files.LineLength
+// phpcs:disable Generic.Files.LineLength
global $wgAutoloadLocalClasses;
$wgAutoloadLocalClasses = [
global $wgAutoloadLocalClasses;
$wgAutoloadLocalClasses = [
-// phpcs:ignoreFile Generic.Arrays.DisallowLongArraySyntax,MediaWiki.Usage.DirUsage.FunctionFound
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+// phpcs:disable Generic.Arrays.DisallowLongArraySyntax,PSR2.Classes.PropertyDeclaration,MediaWiki.Usage.DirUsage
/**
* Check PHP Version, as well as for composer dependencies in entry points,
* and display something vaguely comprehensible in the event of a totally
/**
* Check PHP Version, as well as for composer dependencies in entry points,
* and display something vaguely comprehensible in the event of a totally
. "{$otherInfo['minSupported']}.\n\nCheck if you have a"
. " newer php executable with a different name, such as php5.\n\n";
. "{$otherInfo['minSupported']}.\n\nCheck if you have a"
. " newer php executable with a different name, such as php5.\n\n";
- // phpcs:ignore Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
$longHtml = <<<HTML
Please consider <a href="{$phpInfo['upgradeURL']}">upgrading your copy of
{$phpInfo['implementation']}</a>.
$longHtml = <<<HTML
Please consider <a href="{$phpInfo['upgradeURL']}">upgrading your copy of
{$phpInfo['implementation']}</a>.
See our<a href="https://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
for details of which versions are compatible with prior versions of {$phpInfo['implementation']}.
HTML;
See our<a href="https://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
for details of which versions are compatible with prior versions of {$phpInfo['implementation']}.
HTML;
+ // phpcs:enable Generic.Files.LineLength
$this->triggerError(
"Supported {$phpInfo['implementation']} versions",
$shortText,
$this->triggerError(
"Supported {$phpInfo['implementation']} versions",
$shortText,
. "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
. "for help on installing the required components.";
. "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
. "for help on installing the required components.";
- // phpcs:ignore Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
$longHtml = <<<HTML
MediaWiki now also has some external dependencies that need to be installed via
composer or from a separate git repo. Please see
<a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
for help on installing the required components.
HTML;
$longHtml = <<<HTML
MediaWiki now also has some external dependencies that need to be installed via
composer or from a separate git repo. Please see
<a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
for help on installing the required components.
HTML;
+ // phpcs:enable Generic.Files.LineLength
$this->triggerError( 'External dependencies', $shortText, $longText, $longHtml );
}
$this->triggerError( 'External dependencies', $shortText, $longText, $longHtml );
}
return <<<EOD
<?php
// This file is generated by $commandName, do not adjust manually
return <<<EOD
<?php
// This file is generated by $commandName, do not adjust manually
-// phpcs:ignoreFile Generic.Files.LineLength
+// phpcs:disable Generic.Files.LineLength
global \${$this->variableName};
\${$this->variableName} {$op} [
global \${$this->variableName};
\${$this->variableName} {$op} [
-// phpcs:ignoreFile Generic.Arrays.DisallowLongArraySyntax
+// phpcs:disable Generic.Arrays.DisallowLongArraySyntax
/**
* New version of MediaWiki web-based config/installation
*
/**
* New version of MediaWiki web-based config/installation
*
$session = $installer->execute( $session );
$_SESSION['installData'][$fingerprint] = $session;
$session = $installer->execute( $session );
$_SESSION['installData'][$fingerprint] = $session;