| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose of all these changes is not only to make the code
shorter, but to make it more readable.
Notable:
* Fix wrong type hints.
* The `foreach ( $roles )` loop was processing everything twice.
* Inline preg_replace_callback() callbacks.
Change-Id: I2b8146946ab6966cc6f047556a0a898624af181a
|
|
|
|
|
|
|
| |
Still some more to go...
Bug: T254646
Change-Id: Ia117f01e443c35b4765f3275cab4f2707e1be96f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Results in passing a user where previously the fallback
to $wgUser was being used, mostly in tests.
Bug: T255507
Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
|
|
|
|
|
|
|
| |
Preparing replace in core (DifferenceEngine.php, Article.php, ChangesListSpecialPage.php)
Bug: T276412
Change-Id: I4fd9cbd9404879d082179b68a9993e7203e43a8d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is not entirely meaningless. It might be an indicator that
the number of calls to a method is intentionally unlimited.
This is similar to e.g. an @inheritDoc PHPDoc comment that
marks a method as being "intentionally undocumented".
However, what's the meaning of being "intentionally
unconstrained"? Let's just not have any constraint then.
I feel all these ->expects( $this->any() ) bloat the test
code so much that it's never worth it.
Change-Id: I9925e7706bd03e1666f6eb0b284cb42b0dd3be23
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ended up using
grep -Prl '\->setMethods\(' . | xargs sed -r -i 's/setMethods\(/onlyMethods\(/g'
special-casing setMethods( null ) -> onlyMethods( [] )
and then manual fix of failing test (from PS2 onwards).
Bug: T278010
Change-Id: I012dca7ae774bb430c1c44d50991ba0b633353f1
|
|
|
|
|
| |
Bug: T277203
Change-Id: I1c70abc00c912b283e3e6eb2266633ae3f57673b
|
|
|
|
|
| |
Bug: T275531
Change-Id: If641a5a901210ba1a1ea6a41fa6a18c08f4183db
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these are found by the not yet released I10559d8.
I remove the type MockObject in some cases when the calling
code really does not need to know if he get's a mock or the
real thing. However, I do this only in places that are very
closely related to the fixes.
Change-Id: I26a4c3c5a8ae141bf56161b52b54bce7e68f2e30
|
|
|
|
|
|
|
| |
Also put <br>s into empty lines so linebreaks are preserved when copying.
Bug: T192526
Change-Id: I926bedf71562c74a0aa33fbeb11f8d1a4e4130c7
|
|
|
|
|
|
|
|
|
|
|
| |
Deconstructing non-sparse, numerically indexed arrays directly in
foreach (a.k.a. using the list() syntax in foreach) is possible since
PHP 5.5.
The possibility to use string array keys as well as non-sequential
numeric keys in array deconstruction was added in PHP 7.1.
Change-Id: I56a48552a45f61cedc291b306cad8548fc70d485
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)
My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.
Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
|
|
|
|
|
|
| |
Enable the sniff
Change-Id: I9fff860706b0ffb99bb9e78ff26d15bc7c87bdb4
|
|
|
|
|
|
|
|
| |
The immediate use case is for testing, where some tests need to use the
PHP implementation even when wikidiff2 is installed.
Bug: T237049
Change-Id: I41dc4c0933429065d7638f518ec31f0a056afc41
|
|
|
|
|
|
| |
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
|
|
|
|
|
| |
Bug: T192167
Change-Id: I1ea19e9b53683b7d32ff9836990ee73ab3e11104
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Find: ^(\t*)(\$this->)setExpectedException\(\s+(\\?[a-z\\]+::class),\s+('(?:[^'\\]|\\')+'|"(?:[^"\\]|\\")+")\s+\);
Replace: $1$2expectException( $3 );\n$1\$this->expectExceptionMessage( $4 );
+broke long lines manually.
Bug: T192167
Change-Id: I5557b4372625def55a53ac637c2f980f51f12933
|
|/
|
|
|
|
|
| |
Also move the 'unit' test into integration, given it tests code
using globals.
Change-Id: Ie039cae9b5d2870c18a6deefec9a73de522dd847
|
|
|
|
|
|
|
|
|
|
|
| |
Now that resetServices() will preserve (but reset) customized services,
it should be reasonably safe to call it every time globals are changed,
and much more effective than relying on tests to call it every time
themselves.
Depends-On: Iab8ea3a61bbc6803805d855ef23c071067646f71
Depends-On: I00e35ecea6a27468674b2a6e7d9d9eb6518e3bd5
Change-Id: Ie7a89f6ed7d52a0bc01672019ff92e7ee105a1f3
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace
@var $foo type
by
@var type $foo
Change-Id: Iec8b90ffea4028a1005daef422b7c4ec38c2715f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During development a lot of classes were placed in MediaWiki\Storage\.
The precedent set would mean that every class relating to something
stored in a database table, plus all related value classes and such,
would go into that namespace.
Let's put them into MediaWiki\Revision\ instead. Then future classes
related to the 'page' table can go into MediaWiki\Page\, future classes
related to the 'user' table can go into MediaWiki\User\, and so on.
Note I didn't move DerivedPageDataUpdater, PageUpdateException,
PageUpdater, or RevisionSlotsUpdate in this patch. If these are kept
long-term, they probably belong in MediaWiki\Page\ or MediaWiki\Edit\
instead.
Bug: T204158
Change-Id: I16bea8927566a3c73c07e4f4afb3537e05aa04a5
|
|
|
|
|
| |
Bug: T202142
Change-Id: I97a74e5a029b014f3c2195188936d5c8233c1b7f
|
|
|
|
|
| |
Bug: T202641
Change-Id: I34efa0b9329e740bcb292b2529ec8f7f925dc346
|
|
|
|
|
|
| |
Bug: T201218
Bug: T202454
Change-Id: I867900190cb45b983e89769c7fc0f965e2651918
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move logic for rendering a diff between two content objects out of
DifferenceEngine, into a new SlotDiffRenderer class. Make
DifferenceEngine use multiple SlotDiffRenderers, one per slot.
This separates the class tree for changing high-level diff properties
such as the header or the revision selection method (same as before:
subclass DifferenceEngine and override ContentHandler::getDiffEngineClass
or implement GetDifferenceEngine) and the one for changing the actual
diff rendering for a given content type (subclass SlotDiffRenderer and
override ContentHandler::getSlotDiffRenderer or implement
GetSlotDiffRenderer). To keep B/C, when SlotDiffRenderer is not overridden
for a given content type but DifferenceEngine is, that DifferenceEngine
will be used instead.
The weak point of the scheme is overriding the DifferenceEngine methods
passing control to the SlotDiffRenderers (the ones calling
getDifferenceEngines), without calling the parent. These are:
showDiffStyle, getDiffBody, getDiffBodyCacheKeyParams. Extensions doing
that will probably break in unpredictable ways (most likely, only
showing the main slot diff). Nothing in gerrit does it, at least.
A new GetSlotDiffRenderer hook is added to modify rendering for content
models not owned by the extension, much like how GetDifferenceEngine
works.
Also deprecates public access to mNewRev/mOldRev and creates public
getters instead. DifferenceEngine never supported external changes to
those properties, this just acknowledges it.
Bug: T194731
Change-Id: I2f8a9dbebd2290b7feafb20e2bb2a2693e18ba11
Depends-On: I04e885a33bfce5bccc807b9bcfe1eaa577a9fd47
Depends-On: I203d8895bf436b7fee53fe4718dede8a3b1768bc
|
|
|
|
| |
Change-Id: I8e6560efc35a6bd875f96edb9b59c9961b81a956
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|
|
|
|
|
|
|
|
|
| |
* Remove redundant @licence/@license from test suite files.
They already have full licence headers. And @licence raises a
warning in Doxygen.
* Fix weird messes of comments inside comments and other things.
Change-Id: I38da8ca76330f72b8dc22b0ecf1ea69d5ea55ede
|
|
|
|
|
|
|
|
|
|
|
| |
MediaWiki default is "@return type Description", so set a type after
return and start the description with a capital letter. Also use the
more common spelling of boolean.
See http://phpdoc.org/docs/latest/references/phpdoc/tags/return.html for
more about @return
Change-Id: I4e5198822fe92836f9cef9918a9fc1a1a1e0a043
|
|
|
|
|
|
|
| |
This change also adds some tested getters to
the DiffOp class to improve testability of the class
Change-Id: I26eafd791b9892f565a18d0502474ef9c24f9a29
|
|
|
|
|
|
|
| |
These are protected in the parent MediaWikiTestCase and
PHPUnit_Framework_TestCase. No good reason to make them public.
Change-Id: I45ecc0e4209f0c3b27e63a550112e4e0ddf6e530
|
|
|
|
|
|
|
|
|
|
|
| |
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line
Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
|
|
|
|
|
|
| |
- instead of direct variable access.
Change-Id: I019017ca1b4f3c2a511e703bc65b93a8ce47fae9
|
|
Change-Id: Ia206b396e96b52ba9ac4895aae0f2839dca6f958
|