Found usage of isset() on expression self::$mExprParser that appears to
be always set. isset() should only be used to suppress errors. Check
whether the expression is null instead.
See https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset
Change-Id: Idcc51fc215fb727e84aaba5ac2510c052ce6b4d6
Cannot use the interface as the required version is not reached yet.
Cannot bump due to use in fundraising
Bug: T271022
Change-Id: I78771f948d4d1e03fc7565525f562c61af9d749a
timeout while converting timestamps should be a timeout for the whole
parse of that wikitext and not hidden by a invalid time.
Just let the exception bubble up to the caller
See ca71e69f for more information
Change-Id: I0d0decdeb5f4c14d009c6df2ff37920100ba320f
Manipulating $wgHooks is deprecated and unreliable.
Use HookContainer instead.
Needed-By: Iddcb760cf8961316d6527e81b9aa968657d8354c
Change-Id: I413cd2ae43fe4b13917d61a50e190b536fce7279
It's impossible that explode() returns an empty array. This is dead
code.
Also add tests for the previously untested #titleparts function to
make sure this patch doesn't change any behavior. Including weird
usages with negative numbers.
Change-Id: Ib0d2503fdb0900bf6db3ebbc26d2ff648dbfc86d
Personally I find the code much more readable when the private
helper method returns a bool.
Note this patch is intentionally tiny and focusses exclusively on
this one detail. There are many parser tests to prove that nothing
changed.
Change-Id: Ibe07c27aab9cbfc4705769820be679cd54acb79b
Parser::getFunctionLang() is being deprecated. These two functions
have been identical since 7df3473cfea59df53debb7a9eefffed8a7f20fb3
in MW 1.19 (2012) and this extension already requires MW >= 1.35.
Bug: T318860
Change-Id: I87a7ceedce173f6de4bb6722ffe594273c7b0359
The parameters passed to these parser hook handler functions have
guaranteed types. They are either strings or an array of PPNode
objects, depending on the SFH_OBJECT_ARGS flag. When a parameter is
missing the default value from the function header is used.
Change-Id: Ie0196f43f94cf002110c07ad2de30adfa6b77179
This way my IDE (in this case PHPStorm) can actually follow these
references. Strg+click brings me straight to the function, and back.
I assume other tools, linters and such might benefit the same way.
I think this is worth having a bit more duplication.
Change-Id: I16260443e0f1513b9a4715874a513c7a399b5d92
`#ifexist` used to only record media links if the file existed, now it does it either way.
Bug: T245965
Change-Id: Ida5dd30669fbc3471d792fd4c202bb0ff74737ec
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
The following sniffs now pass and were enabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0
Change-Id: Ifaca144ccfd753ea00d1dbba0d12941b0050e2a4
The replacement, Parser::getOutput(), has been in MediaWiki for over a
decade (since 1.12.2 in 2008).
Bug: T275160
Change-Id: I4f4f7b0118470741a6cdaba562f858e425fcf350
Had to change a bit how ExprError is used, to prevent having to turn unit
tests into ingergation tests, adding 5 seconds to run time.
Change-Id: Id4e158f3a4418d320b1c0bdac834ebbba03762af
* Force type hints
* Documentation
* Give links to documentation on mw.org to make high-level understanding of
what each function does easier.
Change-Id: I7708343540b7980e57b68ce9b2d9816d2aee710f
They're a rudiment from the time when the extension had to be compatible
with both SFH_OBJECT_ARGS supporting and not versions of MediaWiki.
This is in the past, so unify them now by merging and or deleting the
old versions. The resulting functions don't end with "Obj" anymore.
One "common" function was left alone to be refactored at a later time,
however I've renamed it and made private.
Change-Id: Ice97e587bf7cc0469476c2e53268d2774ddfdd04