aboutsummaryrefslogtreecommitdiffstats
path: root/.phan/stubs
diff options
context:
space:
mode:
authorMáté Szabó <mszabo@fandom.com>2023-02-12 15:05:57 +0100
committerMáté Szabó <mszabo@fandom.com>2023-02-12 15:49:02 +0100
commit4e3c6cb25db4423dcc093f63dcbe04d45d8781bb (patch)
tree79d5129bcc37a17d38447d661d3399ccb6a71644 /.phan/stubs
parentc08c6ce3491e2a96fb887e46fad57baad39f7697 (diff)
downloadmediawikicore-4e3c6cb25db4423dcc093f63dcbe04d45d8781bb.tar.gz
mediawikicore-4e3c6cb25db4423dcc093f63dcbe04d45d8781bb.zip
TempFSFile: Use a WeakMap for reference tracking if available
Use a WeakMap to track references to TempFSFile instances if available to avoid deprecation warnings for dynamic property creation on PHP 8.2. Use an anonymous class rather than an stdClass to test the behavior in TempFSFileTestTrait to verify that bind() does not trigger dynamic property creation on PHP 8.2. Also add a Phan stub for WeakMap for PHP 7.4. Bug: T324894 Change-Id: Ic413c115e9ed1c750e175152094f3309628e777a
Diffstat (limited to '.phan/stubs')
-rw-r--r--.phan/stubs/WeakMap.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/.phan/stubs/WeakMap.php b/.phan/stubs/WeakMap.php
new file mode 100644
index 000000000000..309c50c72b5a
--- /dev/null
+++ b/.phan/stubs/WeakMap.php
@@ -0,0 +1,24 @@
+<?php
+
+// Phan stub for PHP 8.0's WeakMap class
+
+ final class WeakMap implements ArrayAccess, Countable, IteratorAggregate {
+
+ public function count(): int {
+ }
+
+ public function getIterator(): Iterator {
+ }
+
+ public function offsetExists( object $object ): bool {
+ }
+
+ public function offsetGet( object $object ): mixed {
+ }
+
+ public function offsetSet( object $object, mixed $value ): void {
+ }
+
+ public function offsetUnset( object $object ): void {
+ }
+ }