Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
Move deduplication of language links out of Parser.php and into the
ParserOutput in order to be compatible with alternate Parsers (Parsoid).
Clean up various inconsistencies: ensure deduplication also happens in
OutputPage when multiple ParserOutputs are merged into the final output,
and ensure that the deduplication in LinksUpdate is done in the same
order (first link prevails) as in Parser/ParserOutput/OutputPage.
Deprecate OutputPage::setLanguageLinks() (the matching
ParserOutput::setLanguageLinks() was deprecated in 1.42).
As a breaking change, return an array, not an array *reference*, from
ParserOutput::getLanguageLinks(). This allows us to safely modify the
internal representation of language links. As far as I can tell, no one
used the returned reference to sneakily modify the list of language
links, and there not a good way to have deprecated this before making
the breaking change.
While we're at it, we've added tests to ensure that language link
fragments are preserved.
Bug: T26502
Bug: T358950
Bug: T375005
Change-Id: I82a05a51d94782ebb9fa87ff889ca0f633b3e15c
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I1da4b272a6b28c419cc8e860d142dae19ca0bbcf
It was asked in a patch review to apply fully import
InvalidArgumentException where possible. I was guessing some
of my other already merged patches have but turned out such
thing exists other places style so for the sake of consistency
I've turned rest of inline import of the specific exception at
top of the file.
There are instances of source files that aren't in any namespace but
have fully qualified import which this patch doesn't touch.
Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
This ensures uniform treatment of all places that call `addCategory`
without duplicating the `defaultsort` code; it also ensures that the
effect of the {{DEFAULTSORT}} parser function is independent of page
position.
Bug: T40435
Bug: T353530
Change-Id: I4480a6d59e766fa4eddc9ec9117c58b66771bb47
The RandomPage alias was dropped in an earlier commit, so
group the release note entry in with these.
Change-Id: I207d7463ced1a1bb8b8ac749eba175fc0037a217
String and non-string values behave very differently when passed to
::setPageProperty(), resulting in some unexpected gotchas for the
unaware caller.
Bug: T350224
Bug: T305158
Change-Id: I23b35b250f27a117d1353ea8a26d2b3f77c568e7
Some less trivial cases. Also update variable names.
This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.
Follow-up to 8604c384f6.
Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
Found via (?<!IDBAccessObject)::READ_
We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.
Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
Using LinkFilter functions can repair some values, but that would never
removes invalid values from the externallinks table.
When LinkFilter get bug fixes on how to handle domain or path there is
no way to refresh the links on the externallinks table (even not with
refreshlinks.php) as it compares the url rebuilded from the database
with the value from the parser. But rebuilding the url from database
must not match, when reversing the url to find back the database row.
Just use the raw values internally.
Bug: T350476
Change-Id: I60e61c229c6923427585a445a08e6130d265519d
It is difficult to distinguish this method from OutputPage::addJsConfigVars()
in code search:
https://codesearch.wmcloud.org/deployed/?q=%5BOo%5Dut%28put%29%3F%28%5C%28%5C%29%29%3F-%3EgetCategories%5C%28&files=&excludeFiles=&repos=
We generally try to replace $output with $parserOutput or $pOutput
as we touch code to improve the ability of codesearch to dig up
deprecated ParserOutput methods.
Bug: T305161
Depends-On: I02dd4f61c43c225b0ef6dc51c3e4f9d967a0a272
Depends-On: I61d2d77591579d825ad9d37f902e40366be55dd6
Depends-On: I91155106b7a9e10d3334f95ba4936d02851bfb11
Depends-On: Iaca745c79d9587571af03b23b21d76a6cba0ebf1
Depends-On: Id10a171c44411b1233ee4d6cf8fbd3dc57744eef
Depends-On: I47a25c011d9bd4b1a15dda4e673e32c25eb64f2b
Depends-On: I683fc768aba50b801f46467fcfa1668fa8731ea6
Change-Id: I5a2ac1c99b8b199102e12f0d32dd6ec5cdc24054
Previously, we scheduled recursive RefreshLinks jobs on every file
page edit, but it's only necessary when the page's redirect target has
changed. Optimize this, and only schedule them when the page is or was
a redirect.
(We still do it unnecessarily when a redirect page is edited without
changing the target, but that's more difficult to detect at this
point.)
Bug: T346383
Change-Id: Ie629881c94a7a81ae7bf597aab4587921d1c25ae
Deprecated in e5a7f8f5aa.
No errors logged in WMF production, and no obvious uses
in Codesearch (although some, like mId and mTitle, are
difficult to search for).
Change-Id: Ib8f2f9e6c073d2e9244ed3579f4e68a45d5a0711
I fixed some edge cases in the script that migrates to SQB and it
managed to fix these now.
Bug: T344971
Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
These were deprecated in 1.38 and replaced with ::{get,set}PageProperty()
and ::getPageProperties(), avoiding a heavily-aliased use of the term
"property" and making the relationship between the ParserOutput and page
properties clearer.
Bug: T305161
Change-Id: Ib1a5d0a2c1387584b81c958fa32516034e7b3d05
The design principle for SelectQueryBuilder was to make the chained
builder calls look as much like SQL as possible, so that developers
could leverage their knowledge of SQL to understand what the query
builder is doing.
That's why SelectQueryBuilder::select() takes a list of fields, and by
the same principle, it makes sense for UpdateQueryBuilder::update() to
take a table. However with "insert" and "delete", the SQL designers
chose to add prepositions "into" and "from", and I think it makes sense
to follow that here.
In terms of natural language, we update a table, but we don't delete a
table, or insert a table. We delete rows from a table, or insert rows
into a table. The table is not the object of the verb.
So, add insertInto() as an alias for insert(), and add deleteFrom() as
an alias for delete(). Use the new methods in MW core callers where
PHPStorm knows the type.
Change-Id: Idb327a54a57a0fb2288ea067472c1e9727016000
These methods are either:
- Completely unused, removed
- Used only by the class itself, made private
- Used by LBF (ILB methods) which they were moved to
ILoadBalancerForOwner
In the meantime, completely deprecating and removing per-domain and
per-cluster waitForReplication. Simply wait for all LBs to catch up:
* In reality, the replication lag is so small that it doesn't matter.
It's probably caught up already by that point anyway.
* If you don't make a db call, you don't init a new LBF to be waited on
so it's already quite small.
Bug: T326274
Change-Id: I2c0a89d70152de56d35290f2666b6699822ed330
There is no way to express that Title::castFromPageIdentity(),
Title::castFromPageReference() and Title::castFromLinkTarget()
can only return null when the parameter is null. We need to add
Phan suppressions or explicit types almost everywhere that these
methods are used with parameters that are known to not be null.
Instead, introduce new methods Title::newFromPageIdentity() and
Title::newFromPageReference() (Title::newFromLinkTarget() already
exists), without the null-coalescing behavior, and use them when
the parameter is not null. This lets static analysis tools, and
humans, easily understand where nulls can't appear.
Do the same with the corresponding TitleFactory methods.
Change the obvious uses of castFrom*() to newFrom*() (if there is
a Phan suppression, a type check, or a method call on the result).
Change-Id: Ida4da75953cf3bca372a40dc88022443109ca0cb
It's one-class namespace and I know it's not great but:
- I hope to add more classes with the redesign of externallinks table
- It's not named very well either, it's a collection of URL-related
functionalities
- Making it clear LinkFilter is about external links, not internal or
interwiki or templatelinks etc.
Bug: T321882
Change-Id: I0dd530237f45e4fec786178ec03ee941c6bcd982
The first parameter returned from findVariantLink() is not the DB key,
which whitespaces should be replaced with underscores.
Also:
1. Replaced Title::makeTitleSafe with Title::makeTitle, invalid links
would be treated as plain text by the parser and can never hit this
code path. And the makeTitle function below is also using
Title::makeTitle.
2. Updated the document of findVariantLink().
Bug: T328477
Change-Id: I2b08edd90666e0fa4eafe91444a58806909b02d6