-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
c08c6ce
commit 4e3c6cb
Showing
4 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters