mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
e89f7e3960
* Add mongodb Cursor and CursorInterface stubs * Use proper variable name * Update WriteConcern constructor Based on https://www.php.net/manual/es/mongodb-driver-writeconcern.construct.php
60 lines
944 B
PHP
60 lines
944 B
PHP
<?php
|
|
|
|
namespace MongoDB\Driver;
|
|
|
|
use Iterator;
|
|
use Traversable;
|
|
|
|
/**
|
|
* @template-covariant TKey
|
|
* @template-covariant TValue
|
|
*
|
|
* @template-extends Traversable<TKey, TValue>
|
|
*/
|
|
interface CursorInterface extends Traversable
|
|
{
|
|
/**
|
|
* @return array<TValue>
|
|
*/
|
|
public function toArray();
|
|
}
|
|
|
|
/**
|
|
* @template-covariant TValue of array|object
|
|
*
|
|
* @template-implements Iterator<int, TValue>
|
|
* @template-implements CursorInterface<int, TValue>
|
|
*/
|
|
final class Cursor implements CursorInterface, Iterator
|
|
{
|
|
/**
|
|
* @return TValue
|
|
*/
|
|
public function current() {}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function next() {}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function key() {}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function valid() {}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function rewind() {}
|
|
|
|
/**
|
|
* @return array<TValue>
|
|
*/
|
|
public function toArray() {}
|
|
}
|