Commit Graph

12 Commits

Author SHA1 Message Date
libraryupgrader 54d1b77401 build: Updating mediawiki/mediawiki-codesniffer to 24.0.0
Change-Id: I30daab715920757ec96350c9933fc18c887972c4
2019-02-06 23:08:22 +00:00
AndreG-P 2699479827 Link wikidata items to math tags
Adds a parameter that links individual formulae to their respective wikidata items.

Bug: T71424
Change-Id: I32cfe2039e62f163fe3aebaf77bafbdd84b343c6
2018-11-12 20:59:25 +09:00
jenkins-bot 817ada2cf1 Merge "Add tracking category for deprecated mhchem syntax" 2018-11-09 12:19:12 +00:00
Moritz Schubotz (physikerwelt) a865a8565a
Add tracking category for deprecated mhchem syntax
Gets warning information from restbase and adds tracking categories
for deprecated chemical syntax.
Refactor mechanism to add tracking categories, and avoiding rechecking
already checked formulae.

Depends on: Ieca66f45ae7685d61eece1624bd7ff65ccad2eaa
Change-Id: I10e78ab79015dc1331f645c60b25bbbd237e23fe
2018-10-27 20:38:02 +02:00
Umherirrender c82458bbbc Remove @global doc annotation
It is unknown to doxygen

Change-Id: I1ef4bf4292b78fcd434f35c31f75b08b9c6a49d8
2018-09-09 20:53:28 +02:00
James D. Forrester 087a973f30 build: Bump mediawiki-codesniffer to 22.0.0
Change-Id: I448e8d368d76eee40fe57c89428a0ce472c48d01
2018-09-06 11:48:25 +00:00
Moritz Schubotz (physikerwelt) aa2c4cf913 Improve tests coverage for MathMathML
* deprecate and fix pickHost. It was broken and never used.
* simplify inputTypeSelection
* remove superfluous is_array check for the result of explode

Change-Id: I392f22f074facfe30b97d53a3002f464a471b67e
2018-06-01 15:36:35 +00:00
Moritz Schubotz (physikerwelt) b5cf0e0b77
Serve png mode from mathoid
* Use the exactly same routines to deliver png images that are used in
  mathml mode.
* Change the output to use mathoids png image rather than the mathml
  and svg output.
* Locally tested on Firefox and Chrome: Depending on the mode either
  the SVG or the PNG path is used.

Bug: T74240
Change-Id: I4b1cac92eb9a02190f316faab6621940951603d5
2018-05-21 13:47:49 +02:00
Thiemo Kreuz 670f0bb8f9 Don't expect objects by reference in hook handlers
The motivation for this patch is to make the code less complex, better
readable, and less brittle.

Example:

public function onExampleHook( Parser &$parser, array &$result ) {
    /* This is the hook handler */
}

In this example the $result array is meant to be manipulated by the
hook handler. Changes should become visible to the caller. Since PHP
passes arrays by value, the & is needed to make this possible.

But the & is misplaced in pretty much all cases where the parameter is
an object. The only reason we still see these & in many hook handlers
is historical: PHP 4 passed objects by value, which potentially caused
expensive cloning. This was prevented with the &.

Since PHP 5 objects are passed by reference. However, this did not
made the & entirely meaningless. Keeping the & means callees are
allowed to replace passed objects with new ones. The & makes it look
like a function might intentionally replace a passed object, which is
unintended and actually scary in cases like the Parser. Luckily all
Hooks::run I have seen so far ignore unintended out-values. So even if
a hook handler tries to do something bad like replacing the Parser
with a different one, this would not have an effect.

Removing the & does not remove the possibility to manipulate the
object. Changes done to public properties are still visible to the
caller.

Unfortunately these & cannot be removed from the callers as long as
there is a single callee expecting a reference. This patch reduces the
number of such problematic callees.

Change-Id: I21d53c989ea487607dc69e6b3365c023ef6729f5
2018-05-15 17:50:08 +02:00
Kunal Mehta 7a53bd905c Disable PHPCS more narrowly
Change-Id: I20d8b519d5827e865ccd3adf7c2c6ba069f37afb
2018-05-03 19:00:55 -07:00
Moritz Schubotz (physikerwelt) 9fee65ae24
Generate HTML tag using HTML class
Change-Id: I8c37fdaa112cfeac0466f4380e972b63404a8d35
2018-04-23 15:39:30 +02:00
Moritz Schubotz (physikerwelt) 6e28bf8743
Move php source files
Move php source files to scr. This allows jenkins to calculate the test
coverage.

Bug: T126034
Change-Id: If012c6a4fce0fdeaa5a63dad23210a42d1fc80e6
2018-04-23 15:09:23 +02:00