Store the deprecation info in a static property instead of an
instance property. This was causing noticeable memory use for
the Title class.
Because the deprecated properties are defined in the constructor,
we now have to ignore repeated calls.
Bug: T351732
Change-Id: If9504321c66d9033e4090088cbf21d4dd2bd463f
* 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
* Widen `@covers` annotations in unit tests.
Ref https://gerrit.wikimedia.org/r/q/owner:krinkle+is:merged+message:covers
* Create "Debug" documentation group, covering the debug/ directory.
This will show up on doc.wikimedia.org under "Modules", where
each class is listed, and the class page will also link back to
the group as part of its breadcrumb navigation.
Test with `php maintenance/mwdocgen.php --file docs/,includes/debug/`
and then view /w/docs/html/
* Improve docs of various classes and explain relationships better.
In particular, reformat to ensure each class has a oneline
description that captures its essential function.
Change-Id: I5d1143a9244b7fd888e1dc31f0fd7965272aa900
The wfDeprecated is called directly from __get/__set/__isset which needs
only a 2, not 3. That means the message is one caller of.
Change-Id: Ia29fb0a07841f69a4d8b95431f0915df9793c340
The cost of creating closures adds up, so avoid it if we can be using
method names instead.
Bug: T297236
Change-Id: Ifb78d5f310fe45db58fd450c9db3c7af295ae399
DeprecationHelper currently breaks dynamic properties
on phpunit mocks. This happens because phpunit starts
mocking the magic methods if they're explicitly defined.
By default, magic methods and up doing nothing, but
if proxying to original methods is enabled, magic methods
are called like regular methods, regarless of whether
property exists or not. With this patch we can workaround
this issue, and create mocks for classes with deprecations.
Needed-By: I4297aea3489bb66c98c664da2332584c27793bfa
Change-Id: Id60a7751ece05669eced6eddd3216da7149411c7
Setting and getting dynamic class properties (e.g. $parser->my_fancy_prop)
is a horrific practice that we should get rid of, but it is still
used. DeprecationHelper right now can not be used on classes
where this practice is used by extensions. Introduce methods
to allow or deprecate this practice.
Change-Id: Ib378bef792dd31be155f186f1a4965a05004a37c
The main goal is to simplify the construction of the LanguageConverter and
avoid using constructors for derived classes.
In order to hard-deprecate removed property, DeprecationHelper::deprecatePublicPropertyFallback
was introduced.
Bug: T253834
Change-Id: Ib167982e4e872cfdf0fbcb78b7ca597f5ac8d60a
1. into class Parser
2. into class LinkHoderArray
3. into class DefaultPreferencesFactory
Add more tests for DefaultPreferencesFactory:
1. testVariantsSupport verifies that converter with variants is used correctly.
2. Test testUserGroupMemberships verifies that membership is used correctly
Bug: T243320, T243321, T243317
Change-Id: I1e5c37e18332d0d32391c74c06e3d84862e48df8
The method for getting the declaring class name was not used when
printing the class name, and was incorrect anyway. Use reflection
when on the error path to ensure the correct class name is used.
Change-Id: Ic9cd4319535d5ab877a0563e0433371e1025d985
self::class would have been better here for consistency across
the code base but seems HHVM handles self::class diferrently from
PHP 7, when used inside a trait. The difference is significant to the
tests and thus we keep the result the same by using __CLASS__ instead.
Change-Id: I58b452341a0567f4d6e6636a7e489531a5569d20