Commit graph

3 commits

Author SHA1 Message Date
James D. Forrester
ac8a5b0b59 Drop PHP 7.4/8.0 support from master (forward-port from MW 1.42)
This patch was applied to release branches for MW 1.42 in April 2024, and
since ported to MW 1.43 and then MW 1.44 as well. This one-of-a-kind hot
patch will finally discontinue once this lands in the master branch as
part of MW 1.45+ releases.

A small handful of phan fixes make this pass so it can land; the rest
(including fixes rather than suppressions of events here) will happen in
later patches.

Bug: T328921
Bug: T359868
Change-Id: Ica2c11a6243795437ec652923e42ef3bd74a5fd8
2025-06-18 10:53:22 +01:00
Reedy
bec8eaf1f9 tests: Update @since tags for backports
Follows-Up: I1054f6f944d491b536949cada33e2ac670e026f8
Follows-Up: If6a4c7dbba39389b06ce64fb5cac08cd8d7dd9fc
Change-Id: I6f4f060d5f47db19d9e705d3fe2f60395ab195dc
2024-04-08 16:09:42 +01:00
Máté Szabó
97bb70de85 Introduce and use DynamicPropertyTestHelper
PHP 8.2 has deprecated dynamic property creation on classes that do not
explicitly allow it via the #[AllowDynamicProperties] annotation. The
recommended migration path for associating arbitrary data with objects
is the WeakMap class, but it is only available on PHP 8.0 and above.

Since MediaWiki still supports PHP 7.4, and the test framework needs to
be able to associate some state with objects it does not own, like DB
connection handles, introduce and use a new DynamicPropertyTestHelper
shim class that uses WeakMap if available and falls back to regular
dynamic property creation otherwise. Convert the DB setup-related
dynamic property usage in MediaWikiIntegrationTestCase to use this
class.

Bug: T326466
Change-Id: I1054f6f944d491b536949cada33e2ac670e026f8
2023-11-03 13:50:53 -04:00