diff options
author | Timo Tijhof <krinkle@fastmail.com> | 2023-10-06 18:28:57 -0700 |
---|---|---|
committer | Timo Tijhof <krinkle@fastmail.com> | 2023-10-26 16:07:20 +0100 |
commit | 08ddbf3465e83d0e7251ecae808346fa76dd048f (patch) | |
tree | 40b8cbe642d9103ce513b0a3e94aa33a78047442 /tests/phpunit/includes/parser/MagicWordFactoryTest.php | |
parent | df1abcfc189f6ab284582722ff00de6fc53715ba (diff) | |
download | mediawikicore-08ddbf3465e83d0e7251ecae808346fa76dd048f.tar.gz mediawikicore-08ddbf3465e83d0e7251ecae808346fa76dd048f.zip |
parser: deprecate unused MagicWord::getId, improve docs and tests
* MagicWord::getId was added in r24808 (164bb322f2) but never used.
At the time, access modifiers like 'private' were not yet in use.
Deprecate the method with warnings, for removal in a future release.
* Fix zero coverage for MagicWord, due to constructor being
internal, this is only intended to be created via array and
factory classes. Let their tests cover this class.
* Remove redundant file-level description and ensure the class desc
and ingroup tag are on the class block instead.
Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+message:ingroup
* Mark constructor `@internal` (was already implied by
stable interface policy), and explain where to get the object
instead.
* Mark load() `@internal`. Method was introduced in 1.1 when the
class (and PHP) did not yet use visibility modifiers for private
methods. The only way to get an instance of MagicWord
(MagicWordFactory::get) already calls load(), the method is not
a no-op if called a second time, and (fortunately) there exist no
callers to this outside this class that I could find.
* MagicWordArray::getBaseRegex was marked as internal
in change I17f1b7207db8d2203c904508f3ab8a64b68736a8.
Change-Id: I4084f858bb356029c142fbdb699f91cf0d6ec56f
Diffstat (limited to 'tests/phpunit/includes/parser/MagicWordFactoryTest.php')
-rw-r--r-- | tests/phpunit/includes/parser/MagicWordFactoryTest.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/phpunit/includes/parser/MagicWordFactoryTest.php b/tests/phpunit/includes/parser/MagicWordFactoryTest.php index f44a3b7944b4..5c7209bd8b86 100644 --- a/tests/phpunit/includes/parser/MagicWordFactoryTest.php +++ b/tests/phpunit/includes/parser/MagicWordFactoryTest.php @@ -6,6 +6,7 @@ use MediaWiki\Parser\MagicWordFactory; /** * @covers \MediaWiki\Parser\MagicWordFactory + * @covers \MediaWiki\Parser\MagicWord * * @author Derick N. Alangi */ |