Commit graph

6 commits

Author SHA1 Message Date
Tim Starling
0077c5da15 Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

I used regex replacement.

Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
2022-10-21 15:33:37 +11:00
Lucas Werkmeister
bc59ea456f Mark WordLevelDiff as newable for now
Using the same rationale as for its parent class, Diff: ideally there
should be some kind of factory for diffs, but currently, there isn’t.
Reuse the same task ID for the todo comment (T257472), as we think it’s
appropriate for both “diff” classes, Diff and WordLevelDiff.

Note that the TwoColumnConflict extension already uses this class as if
it were newable.

Bug: T311224
Change-Id: If2553d6ebc96636b83df8f58e0420dd7eb6ba5af
Co-Authored-By: Michael Große <michael.grosse@wikimedia.de>
2022-06-30 16:51:06 +02:00
Umherirrender
bf61a77431 Change @inheritdoc to @inheritDoc
Only @inheritDoc works for the Sniff
MediaWiki.Commenting.FunctionComment

Change-Id: I91fc02cda6701d790e4334fc2bc47f230955545c
2017-08-11 16:49:52 +02:00
umherirrender
34fe90ac52 Remove empty lines at end of functions
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files

Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641
2016-11-05 11:55:10 +01:00
Max Semenik
dd57ff3cce Rethink diff limits
Now, instead of "if your changed paragraphs are larger than 10Kb, you're
screwed":
* Instead of relying on overall length, estimate complexity after splitting to words
  and taking any equal head and tail out of equation.
* Estimate based on words changed, which better reflects the actual complexity
  of generating a diff.
* New limit is determined scientifically, i.e. "above that number XDebug starts
  complaining about recursion limits reached in Vagrant".

Caveat: if new limits are hit, the consequences are more widespread as all adjacent
changed paragraphs are displayed without word level diffs, as opposed to only the
paragraph that's too long being affected. However, the new limit is much higher and
in wikitext you're supposed to put empty lines between paragraphs anyway, negating
this problem.

Bug: T128697
Change-Id: I4e91c7c40f5afdd116b847a859b8517522302489
2016-06-01 16:30:58 -07:00
Max Semenik
1cac442f1f Refactor diffs
* Merge MappedDiff into WordLevelDiff
* Rename <something insane>WordAccumulator into WordAccumulator and namespace
* Better variable names

Change-Id: I5847f2bb89402d0537b9e99cccd24c547ce4e4e2
2016-05-17 18:17:05 -07:00