Commit graph

39 commits

Author SHA1 Message Date
Siebrand Mazeland
f994817f6b Pass phpcs-strict on various files in includes/
These files have all had treatment before, and these occurrences have either
been missed or have been introduced after.

Change-Id: I06cdab4616b5bff47c85152df28f18c861730a23
2014-04-24 21:50:01 +02:00
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +00:00
Thiemo Mättig
6806400129 Added and updated Doxygen comments in content handler and diff namespaces
Reasons for touching this are:
* "@param type $var" were mixed in a lot of places. Both works but the
  MediaWiki coding conventions suggest that specific order.
* Things like String and Bool aren't objects and shouldn't be uppercase.
* Tried to fill missing types in "@param $var".
* Tried to fill missing descriptions in "@return type" when I could.
* Removed duplicate descriptions if a @see is sufficend.
* Removed useless descriptions ("isUsefull returns true if usefull").
* Removed useless @return void.
* Replaces mixed[] with array (does have the exact same meaning).
* Tried to find better replacements for "varargs", phpDocumentor
  suggest $var,...
* Order should be @since, @param, @throws, @return, @see. This is the
  order Doxygen renders this.

There is always more to do but I think this is already much better
than before. Please feel free to put more change sets on top of mine
or request more changes by adding comments.

Change-Id: I05262ce06caabf79f68772302524ac91bbead1c6
2014-03-06 11:17:41 +01:00
addshore
3d1fba6e72 Add tests for ArrayDiffFormatter and DiffOp
This change also adds some tested getters to
the DiffOp class to improve testability of the class

Change-Id: I26eafd791b9892f565a18d0502474ef9c24f9a29
2014-02-26 22:53:05 +01:00
Max Semenik
44962de1a5 Allow customizing classes inside of diffs
Not every implementation might want them

Change-Id: Id186b71760d59be7e61458bf1f62965a0f2f826c
2013-12-11 23:07:04 +04:00
jenkins-bot
debe941aa8 Merge "Initialise variables and update documentation" 2013-11-20 21:59:27 +00:00
jenkins-bot
424845ad11 Merge "Remove unused private method check()" 2013-11-20 21:56:57 +00:00
jenkins-bot
3edd3c4055 Merge "Abstract declaration must precede visibility declaration" 2013-11-20 21:52:09 +00:00
Siebrand Mazeland
84552a2dd4 Initialise variables and update documentation
Change-Id: Idb242f65801ee79531c2300cf9fcb5b3929f66ab
2013-11-20 20:57:52 +01:00
Siebrand Mazeland
dcb0471e19 Remove unused private method check()
Change-Id: I29381892be9966b92b99cb3b021cc5a9a4be8a80
2013-11-20 20:41:58 +01:00
Siebrand Mazeland
7b94b51088 Abstract declaration must precede visibility declaration
Change-Id: Ic13646c5a5c5b1f80db58740b207f853c7e25ceb
2013-11-20 20:32:53 +01:00
Siebrand Mazeland
f5003767a0 Rename classes DiffOp_* to DiffOp*
Part of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core in core are updated
in this patch. No uses in extensions.

Change-Id: I86b8c6f8702e661554c7b794df09892db94a84d1
2013-11-20 20:28:14 +01:00
Siebrand Mazeland
4da81608c2 Rename class HWLDF_WordAccumulator to HWLDFWordAccumulator
Part of program to remove underscores from class names. Checked core and
600+ extensions for occurrences. All uses are in core in core are updated
in this patch.

Change-Id: Ib3094249ab192db80f1639c5e543ece84c688b9a
2013-11-20 20:24:48 +01:00
Siebrand Mazeland
27edd5708d Avoid function calls in a for loop test part
Change-Id: Ief0976e3d1cd1da7074b1ed6d427153ccc189f18
2013-11-20 20:22:26 +01:00
Siebrand Mazeland
abefd2c07e Update formatting for includes/diff
Change-Id: Id032a32ca6ebea3daf5313a05602c5e98603d983
2013-11-20 20:11:57 +01:00
Max Semenik
c37b4dc964 Refactor diffs
* Move some classes to separate files to avoid having a monstrous file with a
  dozen classes.
* Remove weird underscores from class names.
* Instead of prefixing members with underscores, specify visibility explicitly.
* Rename c_style -> camelCase per coding conventions.
* Throw exceptions instead of fataling out with trigger_error().
* Remove pointless constant used only once.

Change-Id: Icac23c0f6259c73f5fe07f201b83b9c332ba0469
2013-10-30 21:40:06 +04:00
Tim Starling
d1bc243f65 Remove all instances of the word "iff"
It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.

If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.

Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1
2013-10-23 10:56:54 -07:00
Boris Nagaev
c3a13553fa DairikiDiff: Optimise method WordLevelDiff._split()
_split() copied two arrays N times, where N is number of lines in diff.
This was done by $a = array_merge($a, ...);
Instead of doing this, new words are appended to the end of array
using []= syntax.

Bug: 47989
Change-Id: I41338a2a82fbc20d7511f4c79581880febeeeea5
2013-05-16 23:01:09 +00:00
umherirrender
9f14ecf829 Added space after switch/Removed spaces after unset
While at it, added/removed some other spaces in the same files

Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
2013-04-26 16:42:31 +02:00
umherirrender
892ee7a4af Fixed spacing in db/debug/diff/externalstore/objectcache folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I32a43c547630ce31b6b25cc1bc9eedc50e67b2d7
2013-04-20 22:28:52 +02:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
umherirrender
8764b3aa7c Remove spaces in function signature
Change-Id: I45aea7a7af88cd913b2f485913620a8af0ab2fed
2013-03-18 20:44:43 +01:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
f97a3a4027 fix some spacing
Change-Id: I670a7baf3ba1e70d18346bb00938d518ba2063bd
2013-02-04 19:59:14 +00:00
jenkins-bot
7fbc18e1ba Merge "fix some spacing" 2013-01-27 13:14:56 +00:00
umherirrender
25bc3a0727 The use of function sizeof() is forbidden; use count() instead
From phpcs

Change-Id: I919c8af46a722cd1c14bb8c134400e2ec51160d1
2013-01-26 22:20:04 +01:00
umherirrender
2e8da558ba fix some spacing
Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
2013-01-26 22:11:09 +01:00
Antoine Musso
42a8daaf5a (bug 26280) all files should have GPL header
MediaWiki is licensed under GPL so we should really add the header to
our PHP code unless reusing code licensed differently.

Tested using:
  ack-grep --php -L 'This program is free software' \
    includes/ maintenance/ mw-config/ resources/ skins/

Output the following files:
 includes/ExternalEdit.php (public domain)

Various other licenses:
 includes/json/Services_JSON.php
 includes/libs/CSSMin.php
 includes/libs/IEContentAnalyzer.php
 includes/libs/JavaScriptMinifier.php
 includes/libs/jsminplus.php
 includes/normal/Utf8Case.php
 includes/objectcache/MemcachedClient.php

File autogenerated from a GPL file and Unicode data:
 includes/ZhConversion.php

A few lines coming from stack overflow:
 maintenance/mwdoc-filter.php

Message files do not have any license :-/

Change-Id: I214a988edfa9e2dfcc762612a0f7d47eee8bcb74
2012-11-18 15:34:00 +01:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
Christian Aistleitner
0954fc366f Sanitizing already existing use of PHP's assert 2012-03-19 11:14:43 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Aaron Schulz
fe728c8b92 Reverted r101244 changes - these are not equivalent and may have been causing the assertion failures people (timo, myself) were getting. 2011-11-09 22:59:09 +00:00
Sam Reed
c8e89896f7 Remove more assignments in conditionals (while each to foreach) 2011-10-29 02:04:27 +00:00
Sam Reed
4622da783c More documentation! 2011-10-26 04:15:09 +00:00
Alexandre Emsenhuber
7f50a3d5b9 Removed usage of error suppression operator 2011-07-05 11:08:05 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Jack Phoenix
8137b9c807 spaces, added some braces to DairikiDiff.php 2011-02-20 19:04:58 +00:00
Alexandre Emsenhuber
d18f921b57 Per Tim Starling, follow-up r76252: move WikiDiff.php to DairikiDiff.php to not confuse with the wikidiff extension 2011-02-20 16:28:13 +00:00
Renamed from includes/diff/WikiDiff.php (Browse further)