Note how only two files mentioned the license before. For consistency
it should be either all or none. Both solutions would be possible. Even
*not* mentioning the license anywhere in these files would be fine from
a legal perspective, as long as the relevant file COPYING is still
there in the root folder of this extension.
The overly long "deed" text does not serve much of a purpose. It's not a
complete, legally relevant license text. It's hard to read as the fact
this is "GPL2+" is surprisingly hard to find. The @license tag solves
these problems, and is recognized by documentation generators.
Change-Id: I7844be0c5f4f3d7562156cd9f34fe466552a9c9d
This is a straightforward baseline patch that does nothing but moving
existing code around, without touching it. I'm not even trying to
remove the "static" keyword. The actual refactoring will be done in
the next patch. I hope with this the changes I do in the refactoring
become more visible and much easier to review.
Change-Id: Idba859ec0c24f3622ea8fb8d7a9b11843d1e3827
This gets rid of code that is reported as being unused, even if it is
used.
This also simplifies the regular expression a little bit. The .
automatically ends at the end of the line when the mode /s is *not* set,
which it isn't. The /m mode is not needed then because there is no ^ or
$ any more in the regular expression.
Note this code is sufficentily covered by a test (one I wrote just a
few days ago).
Change-Id: I8eb57e308bb2b281e0e72499b4d46f93a4dfa5f4
This is especially covering:
* The behavior on different kinds of HTML encoded characters.
* Trimming, or more precisely the fact that the formatter currently does
not do all the trimming. There is a trim() call in the test that should
not be there. This will be reworked in a following patch.
Additionally:
* Prefer strict assertSame() where possible.
* Remove two assertions that don't help making the test more safe.
* Utilize the new `// phpcs:…` syntax.
Change-Id: Ic361f2644300dcef3fc972a2dc2ae19ad34fa513
This patch does two things:
* Add a testMemCacheHelpers() test for the setCache(), getFromCache(),
as well as cacheKey() methods.
* Simplify the existing test setup utilizing the PHPUnit4And6Compat
layer. I'm also replacing the Config mock with an actual HashConfig,
because that's a really trivial object that does not need to be mocked.
Change-Id: I7e8a62651a53919d338a7d921f548e941b671670
Instead of trying to come up with a (probably hypercomplex) integration
test for the entire API module, I start to test a few more critical
details. Yes, this is now testing private implementation details. This
is meant as a migration path. See, it's hard to test code like this
without rewriting it, and hard to rewrite it without tests. This patch
aims to give us a little more confidence for future rewrites.
Change-Id: I0405e13eba31124fcb5af83159d7438fe0ad9879
* Use the ?? operator.
* Use "\u{00A0}" instead of "\xC2\xA0".
Also increase the minimum required MediaWiki version from 1.30 to 1.31
because 1.31 requires PHP7.
Change-Id: Ic5c279976f50b381cec65e74b7cc821a210c2173
This ensures that each repository's "npm test" command is fully
independent of wherever it might be in the filesystem.
Bug: T206485
Change-Id: I370cbae95ae15c546f6d70fcab50a4506e129ef1
Use of all: '.' in Gruntfile.js for eslint config and
eslintIgnore in package.json to ignore linting the "vendor/"
directory.
Change-Id: Ic8489351b8de6b7e31a95a55420db1f772f8d535
The plugin checks and flags potential security issues (XSS, SQLi, etc.)
using static analysis.
See <https://www.mediawiki.org/wiki/Phan-taint-check-plugin> for more
details.
Bug: T201219
Change-Id: I0c81983a41a9c8863bd16c7d358b51472b7e9e9a
This patch fixes two styls issues I could not separate:
* Hook handler functions do not need to return true. This is the default
anyway, and meaningless.
* Counting is possibly expensive and not needed when all we need to know
is if an array is empty or not.
Change-Id: I460776c981638806a606d9bf88fc8579d6da8c0e