This avoids addition of new code with the deprecated global,
or at least it gives extra attention on review when new code also uses
the inline ignore
Change-Id: I5c1bc5a1685c28f153d4fbe3525959930f54b557
Why:
* The populateImageSha1.php maintenance script has been in core
since at least MW 1.19, being definitely added to update.php
in 1.19 through 7cb4d69d9d.
* Per the version policy, wikis wishing to upgrade to MW 1.43
should upgrade via 1.35 or 1.39 before moving to 1.43.
* As such, this script will have been already run for any wiki
upgrading to 1.43 and therefore this script is unused.
* Removing the script is useful to reduce the amount of untested
code in the maintenance directory and reducing unnecessary
maintenance on now unused code.
What:
* Remove populateImageSha1.php
Bug: T373310
Change-Id: Ibc6a31b1eafb7c5727d68bfb2526ffd7532408a6
Fix the real issues found by this sniff, and convert the remaining
false positive ignores to per-line ignores so that any more real issues
won't be added.
Change-Id: I18e75d59df327e2d93a3a487c115e92b9f268722
Fixes some MediaWiki.Commenting.PropertyDocumentation.SpacingAfter PHPCS
errors by converting doc-comments into regular comments.
Change-Id: Iac8fece839e0a54855bb1f431d2ee88a5783ddab
Instead of globally ignoring this sniff, convert the current violations
(which set the variable so can't be fixed easily yet) to use local phpcs
comments to silence the errors.
Change-Id: I490cbf4915e2705383edb4a2fc5ddc1efd55c960
Fixed SkinModuleTest::provideGetFeatureFilePathsOrder as nesting of
arrays for parameters is wrong
Change-Id: I9875008adf62d284c48662ebfbd245d72e5be064
Based on .eslintignore; docs/html/, in particular, can contain a handful
of PHP files that shouldn’t be linted. (All four directories are
generated, see .gitignore and docs/html/.gitignore.)
Change-Id: I0fb06d4a6c716680850de93096395650afe3802b
Also change the letter case in the file names to be consistent to other
files in includes/specials.
The PHPCS exclude-pattern for these files on
MediaWiki.Files.ClassMatchesFilename.NotMatch can now removed.
The old class names are still available as aliases and are deprecated
now.
Change-Id: Id71f5a5ce456caf522c95c477487e14f366c1b40
This allows methods to be defined instead of global functions, which in
this case, were missing the "wf" prefix.
Change-Id: I2413675f46a29d914cb756071cd6abbcf38b500e
* maintenance/benchmarks: 4 files were deleted in d814a74b6f.
1 file was deleted in 4c5de97a9b.
* includes/Stub*.php: 3 files were moved in 0fff5089ba to a
new subdirectory. phpcs:ignore comments were added in the move.
Change-Id: I8b2c71e0e054f969741691f29dca62adeab757bd
Since 096ea23208, these no longer exist as global functions:
* moveToExternal
* resolveStub
* resolveStubs
Change-Id: I1c36ece4d84895647a27aaf7160ac3b66c402f01
This comment was added in 355a6cd4c3 and quickly became outdated.
While it should still mostly be correct, it is no longer "policy" to use
the at-ease library. The "@" operator is now explicitly permitted where
necessary and is now recommended even outside tests (T253461). As such,
it no longer makes sense to keep this comment around.
Change-Id: I07aa84d46be8c7e5a1c8a3249d382cbbfef80267
Also:
* In .phpcs.xml, remove "showUsage" from the list; transstat.php was
removed in e19f4e16a6.
* In styleTest.css.php, check the type of the $_GET value as part of the
"basic sanitization".
Change-Id: Icb82d8a42dd6cd062f41a04696f092b43b04f54f
Since 863a1d5bdd the converter classes are in own files.
therefor the exclude for the rule
Generic.Files.OneObjectStructurePerFile.MultipleFound is not needed
anymore.
Change-Id: Id10ba77fc4caf9065a8f0e3480f42aad492275e4
The Language converter classes are not in this folder anymore and don't
use the pattern of two classes in one file anymore.
Change-Id: Ie25bc2fe4ad860c218145615caefbfee2200d1c6
With PHPUnit 9, tests without @covers tags are considered risky and emit
warnings. Not having @covers is bad practice anyway, so use
@coversNothing instead to make the intention clear, and re-enable the
phpcs rule.
Also rewrite an assertion in ResourcesTest that was bothering me.
Bug: T243600
Change-Id: I6dd683f93b6b2faed5f107be2ca7860602277fbc
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Revert of a241d83e0a.
Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
This reverts commit e08ea8ccb9.
Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).
Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
This further removes files that are not maintenance scripts from this
directory. It isn't used outside of tests, either.
While at it, rename this to a PSR-4 namespace consistent with some of
the other test-only classes.
Change-Id: Ibc49617631f17a5e9489789a90a7b8537340ead3
There is a common and reasonable need for longer lines in tests.
The nudge for shorter lines doesn't seem valuable here. The natural
breaks will likely still fall in 80-100 given the enforced practice
for non-test code, e.g. whether through habit, or 80-100 column markers
in text editors, or the finite width of diff and code review
interfaces.
Change-Id: I879479e13551789a67624ce66f0946d2f185e6ee
* Enforce the ban on is_resource in phpcs
* In OrderedStreamingForkController, the comment was incorrect. I
confirmed using a small test script that if the child closes one end
of a socket pair, the other end will still be open, and is_resource()
will still return true, and fclose() will not fail. The issue was
introduced in c82d30d19c, it was not present in the
CirrusSearch copy of the class.
* Allow is_resource() for debug logging.
* Allow is_resource() for parameter validation where a stream may be
passed to a function, since there is no alternative.
Bug: T260735
Change-Id: I59a752f7bb4b043ddfb2434b52a02f9221bf54db
$wgShellLocale was a flawed solution to the problem of locale
dependence. MediaWiki has its own concept of locale (the Language
hierarchy) and any kind of dependence on the server's libc locale is
incorrect and harmful, leading to bugs. Developers have an expectation
that functions like strtolower() will work in a certain way, and
respecting the locale set in the environment at install time violates
this expectation.
The problems with using C as a locale, which led to $wgShellLocale, are:
* escapeshellarg() will strip non-ASCII characters. This can be worked
around by not using it. The security vulnerability it was trying to
fix can be prevented in another way.
* Shell commands like rsvg will fail to correctly interpret UTF-8
arguments. This is the reason for the putenv(). On Linux, this can
be fixed by using C.UTF-8, which we didn't know at the time. On
Windows, the problem is not relevant (there are unrelated issues
with UTF-8 arguments).
Bug: T291234
Change-Id: Ib5ac0e7bc720dcc094303a358ee1c7bbdcfc6447
This is done without a deprecation process since the function is
@internal and completely unused outside of core.
Bug: T291341
Change-Id: I4b074f83f9be67b5b5bc2d33b2a6a55bb109a2b3
With this patch deprecation warnings will be emitted
if $wgUser is accessed or written into. The only pattern
of usage still allowed is
$oldUser = $wgUser;
$wgUser = $newUser;
// Do something
$wgUser = $oldUser;
Once there is no deprecation warnings, we know that nothing
legitimately depends on $wgUser being set, so we can safely
remove the code that's still allowed as well.
Bug: T267861
Change-Id: Ia1c42b3a32acd0e2bb9b0e93f1dc3c82640dcb22
This change is for consistency to the file name and to other classes.
The old class name RandomPage is kept as alias for compatibility and is
now deprecated.
Also change the letter case in the class names and file names:
* SpecialRandompage -> SpecialRandomPage
* SpecialRandomredirect -> SpecialRandomRedirect
* SpecialRandomrootpage -> SpecialRandomRootPage
The change of the letter case of file names may cause problems on
Windows operating systems.
Change-Id: If4dd23126e0d032f42a86aff7d09414edcb1ade2
Use /* at the end of exclude-pattern when excluding the whole folder,
see Id95236edbd3d87f57719d235c7c9cee366180099 for explaination
Remove the file extension when excluding the whole folder,
because it process php files only by the extensions argument set to php
Change-Id: Icaad23ab4b1708a5ce17930f77067ac9224169b5