144 lines
3.9 KiB
PHP
144 lines
3.9 KiB
PHP
<?php
|
|
/**
|
|
* Stub file for MongoDB extension types
|
|
* This file provides type information for the PHP language server
|
|
* It should never be executed - it's only for IDE/static analysis
|
|
*/
|
|
|
|
namespace MongoDB\BSON {
|
|
|
|
/**
|
|
* BSON type for the "ObjectId" type
|
|
*/
|
|
class ObjectId implements \Stringable, \JsonSerializable, \MongoDB\BSON\Type
|
|
{
|
|
/**
|
|
* Construct a new ObjectId
|
|
* @param string|null $id A 24-character hexadecimal string. If not provided, the driver will generate an ObjectId.
|
|
*/
|
|
final public function __construct(?string $id = null) {}
|
|
|
|
/**
|
|
* Returns the hexadecimal representation of this ObjectId
|
|
*/
|
|
final public function __toString(): string {}
|
|
|
|
/**
|
|
* Returns the timestamp component of this ObjectId
|
|
*/
|
|
final public function getTimestamp(): int {}
|
|
|
|
/**
|
|
* Returns a representation that can be converted to JSON
|
|
*/
|
|
final public function jsonSerialize(): mixed {}
|
|
|
|
/**
|
|
* Checks if a value is a valid ObjectId
|
|
*/
|
|
final public static function isValid(string $id): bool {}
|
|
}
|
|
|
|
/**
|
|
* BSON type for the "UTCDateTime" type
|
|
*/
|
|
class UTCDateTime implements \JsonSerializable, \MongoDB\BSON\Type
|
|
{
|
|
/**
|
|
* Construct a new UTCDateTime
|
|
* @param int|\DateTimeInterface|null $milliseconds Number of milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC)
|
|
*/
|
|
final public function __construct(int|\DateTimeInterface|null $milliseconds = null) {}
|
|
|
|
/**
|
|
* Returns the string representation of this UTCDateTime
|
|
*/
|
|
final public function __toString(): string {}
|
|
|
|
/**
|
|
* Returns the DateTime representation of this UTCDateTime
|
|
*/
|
|
final public function toDateTime(): \DateTime {}
|
|
|
|
/**
|
|
* Returns a representation that can be converted to JSON
|
|
*/
|
|
final public function jsonSerialize(): mixed {}
|
|
}
|
|
|
|
/**
|
|
* This interface is implemented by BSON types
|
|
*/
|
|
interface Type {}
|
|
}
|
|
|
|
namespace MongoDB\Driver {
|
|
|
|
/**
|
|
* The MongoDB\Driver\CursorInterface interface
|
|
*/
|
|
interface CursorInterface extends \Traversable
|
|
{
|
|
/**
|
|
* Returns the MongoDB\Driver\CursorId associated with this cursor
|
|
*/
|
|
public function getId(): CursorId;
|
|
|
|
/**
|
|
* Returns the MongoDB\Driver\Server associated with this cursor
|
|
*/
|
|
public function getServer(): Server;
|
|
|
|
/**
|
|
* Checks if the cursor may have additional results
|
|
*/
|
|
public function isDead(): bool;
|
|
|
|
/**
|
|
* Sets a type map to use for BSON unserialization
|
|
*/
|
|
public function setTypeMap(array $typemap): void;
|
|
|
|
/**
|
|
* Returns an array containing all results for this cursor
|
|
*/
|
|
public function toArray(): array;
|
|
}
|
|
|
|
/**
|
|
* The MongoDB\Driver\Cursor class
|
|
*/
|
|
final class Cursor implements CursorInterface, \Iterator
|
|
{
|
|
private function __construct() {}
|
|
|
|
public function current(): array|object|null {}
|
|
public function getId(): CursorId {}
|
|
public function getServer(): Server {}
|
|
public function isDead(): bool {}
|
|
public function key(): ?int {}
|
|
public function next(): void {}
|
|
public function rewind(): void {}
|
|
public function setTypeMap(array $typemap): void {}
|
|
public function toArray(): array {}
|
|
public function valid(): bool {}
|
|
}
|
|
|
|
/**
|
|
* The MongoDB\Driver\CursorId class
|
|
*/
|
|
final class CursorId
|
|
{
|
|
private function __construct() {}
|
|
public function __toString(): string {}
|
|
}
|
|
|
|
/**
|
|
* The MongoDB\Driver\Server class
|
|
*/
|
|
final class Server
|
|
{
|
|
private function __construct() {}
|
|
}
|
|
}
|