diff options
author | Tim Starling <tstarling@wikimedia.org> | 2022-11-09 13:12:50 +1100 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2022-11-09 13:12:50 +1100 |
commit | e1041b4d7ad8987bebb97bda168738d58ab671a6 (patch) | |
tree | 99186272ed90a53e70a50b6678ae878820391eb1 /includes/libs | |
parent | 0b12f8b69880d108db9035176532c891e8a75f79 (diff) | |
download | mediawikicore-e1041b4d7ad8987bebb97bda168738d58ab671a6.tar.gz mediawikicore-e1041b4d7ad8987bebb97bda168738d58ab671a6.zip |
Fix the remaining Phan failures on PHP 8.1
* Use @phan-var to suppress issues with version independence.
* In Parser strictly compare to false. I still think this is a Phan bug.
Bug: T322278
Change-Id: I654b73e5ed843474ed35c3780d95b04dce388bea
Diffstat (limited to 'includes/libs')
-rw-r--r-- | includes/libs/MappedIterator.php | 4 | ||||
-rw-r--r-- | includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/includes/libs/MappedIterator.php b/includes/libs/MappedIterator.php index 5d5c9597a993..31c7a4e4119d 100644 --- a/includes/libs/MappedIterator.php +++ b/includes/libs/MappedIterator.php @@ -76,7 +76,9 @@ class MappedIterator extends FilterIterator { } public function accept(): bool { - $value = call_user_func( $this->vCallback, $this->getInnerIterator()->current() ); + $inner = $this->getInnerIterator(); + '@phan-var Iterator $inner'; + $value = call_user_func( $this->vCallback, $inner->current() ); $ok = ( $this->aCallback ) ? call_user_func( $this->aCallback, $value ) : true; if ( $ok ) { $this->cache['current'] = $value; diff --git a/includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php b/includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php index 5a215e3b7c11..cf428777f075 100644 --- a/includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php +++ b/includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php @@ -65,7 +65,9 @@ abstract class FileBackendStoreShardListIterator extends FilterIterator { } public function accept(): bool { - $rel = $this->getInnerIterator()->current(); // path relative to given directory + $inner = $this->getInnerIterator(); + '@phan-var AppendIterator $inner'; + $rel = $inner->current(); // path relative to given directory $path = $this->params['dir'] . "/{$rel}"; // full storage path if ( $this->backend->isSingleShardPathInternal( $path ) ) { return true; // path is only on one shard; no issue with duplicates |