mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Code Modernization: Silence the deprecation warning for missing return type in phpunit/tests/compat.php.
This fixes the "Deprecated: Return type of `CountableFake::count()` should be compatible with `Countable::count(): int`" warning on PHP 8.1. PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute. Follow-up to [51517], [51529], [51530], [51531], [51532]. Props jrf. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51594 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
016cce0695
commit
2af80e6cbe
@ -318,6 +318,7 @@ class ArrayIteratorFake extends ArrayIterator {
|
||||
}
|
||||
|
||||
class CountableFake implements Countable {
|
||||
#[ReturnTypeWillChange]
|
||||
public function count() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user