| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Some functions accept only string, cast ints and floats to string
* After preg_matches or explode() casts numbers to int to do maths
* Cast unix timestamps to int to do maths
* Cast return values from timestamp format function to int
* Cast bitwise operator to bool when needed as bool
* php internal functions like floor/round/ceil documented to return
float, most cases the result is used as int, added casts
Found by phan strict checks
Change-Id: Icb2de32107f43817acc45fe296fb77acf65c1786
|
|
|
|
| |
Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
|
|
|
|
|
| |
Bug: T289879
Change-Id: Ifcac569a1aaa378f21a73357638cd6f734a7640a
|
|
|
|
|
|
|
|
|
|
| |
ObjectFactory needs a service container from which it can fetch the
services to be injected. ObjectFactory::createObject automatically
uses the one being injected into ObjectFactory.
This now allows easy injection of services into session providers.
Change-Id: I8e33e7ff08cef039104b967ce44f29ef106d0a4d
|
|
|
|
|
|
|
|
| |
When the called function has a doc of int, it should be cast to be
explicit here.
Also cast for arithmetic operations to be explicit about the number
Change-Id: I905b78dfb66e66443e0e3203488bab5b548db543
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI.
Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228
* This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it.
A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki
Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
|
|
|
|
| |
Change-Id: Id86769ca81ff65707edde520585aa9ea117123e1
|
|
|
|
|
| |
Bug: T296898
Change-Id: I9d3f1da8a8b5b88a6972e7926d2dac09704deaac
|
|
|
|
|
| |
Bug: T254646
Change-Id: I096b2cf738a1395a14f1d47bcbed0c2c686c2581
|
|
|
|
|
| |
Bug: T254646
Change-Id: I2b120f0b9c9e1dc1a6c216bfefa3f2463efe1001
|
|
|
|
| |
Change-Id: I833052a656b1ce419c0929f6f0514f2a33c2c4cc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Idf68f1cc63fb2e01e004ff353fcda026fa4ec10f
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Auto-generated with rector.
Change-Id: I4f27e10cf029bb067b7bc57d82f7a64e21ea8d42
|
|/
|
|
|
|
|
|
|
|
|
| |
The documentation of SessionProvider::init says that the method can be used in implementation tests.
Now all tests must use SessionProviderTestTrait::initProvider in order to initialize a SessionProvider.
So the entire description after @internal was rewritten. Also the
similar note was added to the documentation of
AbstractAuthenticationProvider::init.
Bug: T283931
Change-Id: I1cde6fd12666ef3a7c9b1e33a718592c11cf9e29
|
|
|
|
|
|
|
|
|
|
| |
::isCreatableName""
This reverts commit ecf826a2ee9442ee669e8057328a0118c1a5d0f8.
Reason for revert: need to edit the patch and then it will be GTG in order to finish hard deprecating of User ::getCanonicalName, ::isUsableName, ::isCreatableName
Change-Id: I2f57f56728fcbeada96dc2228f07dc8bcaa5d4f6
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
In all these cases the property is unconditionally set in
the constructor. The extra initialisation is effectively
dead code and an extra source of errors and confusion.
Change-Id: Icae13390d5ca5c14e2754f3be4eb956dd7f54ac4
|
|/
|
|
|
| |
Bug: T282256
Change-Id: I97244429bb4aa05ffdeda381f89db5dbda182d31
|
|
|
|
|
|
|
|
|
|
| |
::isCreatableName"
This reverts commit b491279268fe1769a8787cbf30b5309c8aa91363.
Reason for revert: caused CentralAuth tests to fail.
Change-Id: Icb3ed094578df427622e0da2a7462645adcc3d6f
|
|
|
|
|
| |
Bug: T275030
Change-Id: I60689ee6519c2dbd6d000afa8ac05c3e6b7895d2
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
init() method was added to SessionProvider. It helps to inject
dependecies. Overridable postInitSetup() method was added to
SessionProvider. A provider can override this to do
any necessary setup.
SessionProvider ::setLogger(), ::setManager(), ::setConfig(),
::setHookContainer() were soft deprecated. Now developers must use
SessionProvider::init()
Bug: T275030
Change-Id: I958797881251572e4ec22e7dd9d13f74f7e216a3
|
|
|
|
|
| |
Bug: T277987
Change-Id: Ieceb01f7a61693a0f03cc331213cb8f93163b8e9
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T270225
Change-Id: I2dcf0c979d8ad6e41e583bde056d21526b1bce9a
|
| |
| |
| |
| |
| |
| |
| | |
User::isValidUserName is deprecated since 1.35 and should be replaced with the UserNameUtils service
Bug: T277398
Change-Id: Iaef995b992e2f38f651453092b23c928479e7d18
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The logstash formatter for Monolog 2 doesn't do this automatically
anymore, and it wasn't really correct anyway to rely on a formatter
when we have no guarantee it's going to be used.
Follows up If92d60289fa925d19261ef912e2f2a5d31db31dc.
Bug: T269680
Change-Id: Ia7875346cec95fbc30bc4579ec8b7fb60e911d12
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Sending the object to the logger renders an object in the logging
pipeline. This type-conflicts with other uses of this field as it is
expected to be a string.
Bug: T269680
Change-Id: If92d60289fa925d19261ef912e2f2a5d31db31dc
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor the database setup code to share more code between
ParserTestRunner and MediaWikiIntegrationTestCase. Made
`::setupAllTestDBs` static so it can be reused from
ParserTestRunner.
Made ParserTestRunner::addArticle more like
MediaWikiIntegrationTestCase::addCoreDBData(). Some additional
refactoring work could be done here in the future to share more code.
After the refactoring the ParserTestTables hook is no longer necessary
and so has been (soft) deprecated. MediaWikiIntegrationTestCase
clones all database tables, so ParserTestRunner no longer needs to ask
extensions for a list of specific tables it should clone. Cleaning up
the handful of extensions which define this hook will be left to a
future patch set.
Change-Id: I5124789fac333a664b73b4b4a1e801ecc0a618ca
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PHPStorm can use custom folding regions defined in either the
VisualStudio style or the NetBeans style. The VisualStudio style is more
pleasing to the eye and also works as a vim foldmarker. So get rid of
the previous vim foldmarkers, and use region/endregion.
region/endregion need to be in a single-line comment which is not a doc
comment, and the rest of the comment is used as a region heading (by
both PHPStorm and vim). So to retain Doxygen @name tags, it is
necessary to repeat the section heading, once in a @name and once in a
region. Establish a standard style for this, with a divider and three
spaces before the heading, to better set off the heading name in plain
text.
Besides being the previous vim foldmarker, @{ is also a Doxygen
grouping command. However, almost all prior usages of @{ ... @} in this
sense were broken for one reason or another. It's necessary for the @{
to be in a doc comment, and DISTRIBUTE_GROUP_DOC doesn't work if any of
the individual members in the group are separately documented.
@name alone is sufficient to create a Doxygen section when the sections
are adjacent, but if there is ungrouped content after the section, it
is necessary to use @{ ... @} to avoid having the Doxygen group run on.
So I retained, fixed or added @{ ... @} in certain cases.
I wasn't able to test the changes to the trait documentation in Doxygen
since trait syntax is not recognised and the output is badly broken.
Change-Id: I7d819fdb376c861f40bfc01aed74cd3706141b20
|
|
|
|
| |
Change-Id: I343d2bae626a3903eb1e67c05bf5caef4314b7dd
|
|
|
|
|
|
|
| |
This allows integration tests to control User instances by
setting a fake UserFactory service.
Change-Id: I006d18b3bc4e8c7eee5da243bac663b10238ae1c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example, documenting the method getUser() with "get the User
object" does not add any information that's not already there.
But I have to read the text first to understand that it doesn't
document anything that's not already obvious from the code.
Some of this is from a time when we had a PHPCS sniff that was
complaining when a line like `@param User $user` doesn't end
with some descriptive text. Some users started adding text like
`@param User $user The User` back then. Let's please remove
this.
Change-Id: I0ea8d051bc732466c73940de9259f87ffb86ce7a
|
|
|
|
|
|
|
|
|
| |
These methods use a static property to cache the return value, and
although they're guaranteed to return an object (as per documentation,
current code, and current usage), some static analysis tool may fail to
understand this.
Change-Id: I4317e1bb11e9793de721356a579a7677137e52cc
|
|
|
|
|
| |
Bug: T264799
Change-Id: I25257cde897db684a8438923487f80b09abe16c0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Store IP and device information in the session and log when
it changes. The goal is to detect session leakage when the
session is accidentally sent to another user, which is a
hypothetical cause of T264370. The log will be noisy since
users do change IP addresses for a number of reasons,
but we are mainly interested in the ability of correlating
user-reported incidents where we have a username to filter
by, so that's OK.
Based on I27468a3f6d58.
Bug: T264799
Change-Id: Ifa14fa637c1b199159ea11e983a25212ae005565
|
|
|
|
|
|
|
|
| |
If all goes well, this should cut INFO-level log volume on the
session channel to about a third.
Bug: T264793
Change-Id: I268b57747a1449456df2c98696807c50b05e7147
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is very noisy (logs several times in the same request), but
I'm not sure much can be done about that. It is a flaw in
SessionManager, which does call SessionProvider::persist/unpersist
that many times, and relies on cookie deduplication in WebResponse.
But it should give some idea of when cookies are emitted, and does
not log on normal requests (where no cookies are emitted) so it
shouldn't overload the logging backend.
Bug: T264793
Change-Id: I93733d73af1dfcf539a94b17cf5e4de76cc59748
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T258665
Change-Id: Ifddbf57f8aa2e3eb0d5845601376cbafa08ed407
|
|/
|
|
| |
Change-Id: Ibc187d95b003017255bc87adf56afae7a59bd3db
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: I17e5e92e24c708ffc846945a136347670a3a20c7
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
|