Install psalm as dev, sync scripts updates

This commit is contained in:
Clemens Schwaighofer
2023-03-09 16:27:10 +09:00
parent 6bec59e387
commit feba79a2e8
2099 changed files with 283333 additions and 32 deletions

View File

@@ -0,0 +1,544 @@
<?php
/**
* Interface to detect if a class is traversable using &foreach;.
* @link http://php.net/manual/en/class.traversable.php
*
* @template-covariant TKey
* @template-covariant TValue
*/
interface Traversable {
}
/**
* @template-covariant TKey
* @template-covariant TValue
* @template TSend
* @template-covariant TReturn
*
* @template-implements Traversable<TKey, TValue>
*/
class Generator implements Traversable {
/**
* @psalm-ignore-nullable-return
* @return ?TValue Can return any type.
*/
public function current() {}
/**
* @return void Any returned value is ignored.
*/
public function next() {}
/**
* @return TKey scalar on success, or null on failure.
*/
public function key() {}
/**
* @return bool The return value will be casted to boolean and then evaluated.
*/
public function valid() {}
/**
* @return void Any returned value is ignored.
*/
public function rewind() {}
/**
* @return TReturn Can return any type.
*/
public function getReturn() {}
/**
* @param TSend $value
* @psalm-ignore-nullable-return
* @return ?TValue Can return any type.
*/
public function send($value) {}
/**
* @psalm-ignore-nullable-return
* @return ?TValue Can return any type.
*/
public function throw(Throwable $exception) {}
}
/**
* Interface to provide accessing objects as arrays.
* @link http://php.net/manual/en/class.arrayaccess.php
*
* @template TKey
* @template TValue
*/
interface ArrayAccess {
/**
* Whether a offset exists
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
*
* @param TKey $offset An offset to check for.
* @return bool true on success or false on failure.
* The return value will be casted to boolean if non-boolean was returned.
*
* @since 5.0.0
*/
public function offsetExists($offset);
/**
* Offset to retrieve
* @link http://php.net/manual/en/arrayaccess.offsetget.php
*
* @param TKey $offset The offset to retrieve.
* @return TValue|null Can return all value types.
* @psalm-ignore-nullable-return
*
* @since 5.0.0
*/
public function offsetGet($offset);
/**
* Offset to set
* @link http://php.net/manual/en/arrayaccess.offsetset.php
*
* @param TKey|null $offset The offset to assign the value to.
* @param TValue $value The value to set.
* @return void
*
* @since 5.0.0
*/
public function offsetSet($offset, $value);
/**
* Offset to unset
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
*
* @param TKey $offset The offset to unset.
* @return void
*
* @since 5.0.0
*/
public function offsetUnset($offset);
}
/**
* This class allows objects to work as arrays.
* @link http://php.net/manual/en/class.arrayobject.php
*
* @template TKey
* @template TValue
* @template-implements IteratorAggregate<TKey, TValue>
* @template-implements ArrayAccess<TKey, TValue>
*/
class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable {
/**
* Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).
*/
const STD_PROP_LIST = 1;
/**
* Entries can be accessed as properties (read and write).
*/
const ARRAY_AS_PROPS = 2;
/**
* Construct a new array object
* @link http://php.net/manual/en/arrayobject.construct.php
*
* @param array<TKey, TValue>|object $input The input parameter accepts an array or an Object.
* @param int $flags Flags to control the behaviour of the ArrayObject object.
* @param string $iterator_class Specify the class that will be used for iteration of the ArrayObject object. ArrayIterator is the default class used.
* @psalm-param class-string<ArrayIterator<TKey,TValue>>|class-string<ArrayObject<TKey,TValue>> $iterator_class
*
* @since 5.0.0
*/
public function __construct($input = null, $flags = 0, $iterator_class = "ArrayIterator") { }
/**
* Returns whether the requested index exists
* @link http://php.net/manual/en/arrayobject.offsetexists.php
*
* @param TKey $index The index being checked.
* @return bool true if the requested index exists, otherwise false
*
* @since 5.0.0
*/
public function offsetExists($index) { }
/**
* Returns the value at the specified index
* @link http://php.net/manual/en/arrayobject.offsetget.php
*
* @param TKey $index The index with the value.
* @return TValue The value at the specified index or false.
*
* @since 5.0.0
*/
public function offsetGet($index) { }
/**
* Sets the value at the specified index to newval
* @link http://php.net/manual/en/arrayobject.offsetset.php
*
* @param TKey $index The index being set.
* @param TValue $newval The new value for the index.
* @return void
*
* @since 5.0.0
*/
public function offsetSet($index, $newval) { }
/**
* Unsets the value at the specified index
* @link http://php.net/manual/en/arrayobject.offsetunset.php
*
* @param TKey $index The index being unset.
* @return void
*
* @since 5.0.0
*/
public function offsetUnset($index) { }
/**
* Appends the value
* @link http://php.net/manual/en/arrayobject.append.php
*
* @param TValue $value The value being appended.
* @return void
*
* @since 5.0.0
*/
public function append($value) { }
/**
* Creates a copy of the ArrayObject.
* @link http://php.net/manual/en/arrayobject.getarraycopy.php
*
* @return array<TKey, TValue> a copy of the array. When the ArrayObject refers to an object
* an array of the public properties of that object will be returned.
*
* @since 5.0.0
*/
public function getArrayCopy() { }
/**
* Get the number of public properties in the ArrayObject
* When the ArrayObject is constructed from an array all properties are public.
* @link http://php.net/manual/en/arrayobject.count.php
*
* @return int The number of public properties in the ArrayObject.
*
* @since 5.0.0
*/
public function count() { }
/**
* Gets the behavior flags.
* @link http://php.net/manual/en/arrayobject.getflags.php
*
* @return int the behavior flags of the ArrayObject.
*
* @since 5.1.0
*/
public function getFlags() { }
/**
* Sets the behavior flags.
*
* It takes on either a bitmask, or named constants. Using named
* constants is strongly encouraged to ensure compatibility for future
* versions.
*
* The available behavior flags are listed below. The actual
* meanings of these flags are described in the
* predefined constants.
*
* <table>
* ArrayObject behavior flags
* <tr valign="top">
* <td>value</td>
* <td>constant</td>
* </tr>
* <tr valign="top">
* <td>1</td>
* <td>
* ArrayObject::STD_PROP_LIST
* </td>
* </tr>
* <tr valign="top">
* <td>2</td>
* <td>
* ArrayObject::ARRAY_AS_PROPS
* </td>
* </tr>
* </table>
*
* @link http://php.net/manual/en/arrayobject.setflags.php
*
* @param int $flags The new ArrayObject behavior.
* @return void
*
* @since 5.1.0
*/
public function setFlags($flags) { }
/**
* Sort the entries by value
* @link http://php.net/manual/en/arrayobject.asort.php
*
* @return void
*
* @since 5.2.0
*/
public function asort() { }
/**
* Sort the entries by key
* @link http://php.net/manual/en/arrayobject.ksort.php
*
* @return void
*
* @since 5.2.0
*/
public function ksort() { }
/**
* Sort the entries with a user-defined comparison function and maintain key association
* @link http://php.net/manual/en/arrayobject.uasort.php
*
* Function <i>cmp_function</i> should accept two
* parameters which will be filled by pairs of entries.
* The comparison function must return an integer less than, equal
* to, or greater than zero if the first argument is considered to
* be respectively less than, equal to, or greater than the
* second.
*
* @param callable(TValue, TValue):int $cmp_function
* @return void
*
* @since 5.2.0
*/
public function uasort($cmp_function) { }
/**
* Sort the entries by keys using a user-defined comparison function
* @link http://php.net/manual/en/arrayobject.uksort.php
*
* Function <i>cmp_function</i> should accept two
* parameters which will be filled by pairs of entry keys.
* The comparison function must return an integer less than, equal
* to, or greater than zero if the first argument is considered to
* be respectively less than, equal to, or greater than the
* second.
*
* @param callable(TKey, TKey):int $cmp_function The callable comparison function.
* @return void
*
* @since 5.2.0
*/
public function uksort($cmp_function) { }
/**
* Sort entries using a "natural order" algorithm
* @link http://php.net/manual/en/arrayobject.natsort.php
*
* @return void
*
* @since 5.2.0
*/
public function natsort() { }
/**
* Sort an array using a case insensitive "natural order" algorithm
* @link http://php.net/manual/en/arrayobject.natcasesort.php
*
* @return void
*
* @since 5.2.0
*/
public function natcasesort() { }
/**
* Unserialize an ArrayObject
* @link http://php.net/manual/en/arrayobject.unserialize.php
*
* @param string $serialized The serialized ArrayObject
* @return void The unserialized ArrayObject
*
* @since 5.3.0
*/
public function unserialize($serialized) { }
/**
* Serialize an ArrayObject
* @link http://php.net/manual/en/arrayobject.serialize.php
*
* @return string The serialized representation of the ArrayObject.
*
* @since 5.3.0
*/
public function serialize() { }
/**
* Create a new iterator from an ArrayObject instance
* @link http://php.net/manual/en/arrayobject.getiterator.php
*
* @return ArrayIterator<TKey, TValue> An iterator from an ArrayObject.
*
* @since 5.0.0
*/
public function getIterator() { }
/**
* Exchange the array for another one.
* @link http://php.net/manual/en/arrayobject.exchangearray.php
*
* @param mixed $input The new array or object to exchange with the current array.
* @return array the old array.
*
* @since 5.1.0
*/
public function exchangeArray($input) { }
/**
* Sets the iterator classname for the ArrayObject.
* @link http://php.net/manual/en/arrayobject.setiteratorclass.php
*
* @param string $iterator_class The classname of the array iterator to use when iterating over this object.
* @psalm-param class-string<ArrayIterator<TKey,TValue>>|class-string<ArrayObject<TKey,TValue>> $iterator_class
* @return void
*
* @since 5.1.0
*/
public function setIteratorClass($iterator_class) { }
/**
* Gets the iterator classname for the ArrayObject.
* @link http://php.net/manual/en/arrayobject.getiteratorclass.php
*
* @return string the iterator class name that is used to iterate over this object.
* @psalm-return class-string<ArrayIterator<TKey,TValue>>|class-string<ArrayObject<TKey,TValue>>
*
* @since 5.1.0
*/
public function getIteratorClass() { }
}
interface Serializable {
/**
* @return null|string
*/
public function serialize();
/**
* @param string $data
* @return void
*/
public function unserialize($data);
}
/**
* @template-covariant T as object
*/
final class WeakReference
{
// always fail
public function __construct() {}
/**
* @template TIn as object
* @param TIn $object
* @return WeakReference<TIn>
*/
public static function create(object $object): WeakReference {}
/** @return ?T */
public function get(): ?object {}
}
/**
* @template TKey of object
* @template TVal of mixed
* @implements ArrayAccess<TKey, TVal>
* @implements IteratorAggregate<TKey,TVal>
* @implements Traversable<TKey,TVal>
*
* @since 8.0.0
*/
final class WeakMap implements ArrayAccess, Countable, IteratorAggregate, Traversable
{
/**
* @param TKey $offset
* @return bool
*/
public function offsetExists($offset) {}
/**
* @param TKey $offset
* @return TVal|null
* @psalm-ignore-nullable-return
*/
public function offsetGet($offset) {}
/**
* @param TKey $offset
* @param TVal $value
* @return void
*/
public function offsetSet($offset, $value) {}
/**
* @param TKey $offset
* @return void
*/
public function offsetUnset($offset) {}
}
class mysqli
{
/**
* @psalm-pure
*
* @psalm-taint-escape sql
* @psalm-flow ($string) -> return
*/
function escape_string($string) {}
/**
* @psalm-pure
*
* @psalm-taint-escape sql
* @psalm-flow ($string) -> return
*/
function real_escape_string($string) {}
}
class SQLite3
{
/**
* @psalm-pure
*
* @psalm-taint-escape sql
* @psalm-flow ($string) -> return
*/
static function escapeString($string) {}
}
#[Attribute(Attribute::TARGET_METHOD)]
final class ReturnTypeWillChange
{
public function __construct() {}
}
#[Attribute(Attribute::TARGET_PARAMETER)]
final class SensitiveParameter
{
public function __construct() {}
}
#[Attribute(Attribute::TARGET_CLASS)]
final class AllowDynamicProperties
{
public function __construct() {}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,334 @@
<?php
class DateTimeImmutable implements DateTimeInterface
{
public function __construct(string $datetime = "now", DateTimeZone $timezone = null) {}
/**
* @psalm-mutation-free
* @return static|false
*/
public static function createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null) {}
/**
* @psalm-mutation-free
*
* @param string $format
*
* @return ($format is non-empty-string ? non-empty-string : string)
*/
public function format($format) {}
/**
* @psalm-mutation-free
* @return DateTimeZone
*/
public function getTimezone() {}
/**
* @psalm-mutation-free
* @return int
*/
public function getOffset() {}
/**
* @psalm-mutation-free
* @return int
*/
public function getTimestamp() {}
/**
* @psalm-mutation-free
* @param bool $absolute
* @return DateInterval
*/
public function diff(DateTimeInterface $targetObject, $absolute = false) {}
/**
* @psalm-mutation-free
* @return static|false
*/
public function modify(string $modifier) {}
/**
* @psalm-mutation-free
* @return static
*/
public function add(DateInterval $interval) {}
/**
* @psalm-mutation-free
* @return static
*/
public function sub(DateInterval $interval) {}
/**
* @psalm-mutation-free
* @return static
*/
public function setTimezone(DateTimeZone $timezone) {}
/**
* @psalm-mutation-free
* @return static
*/
public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0) {}
/**
* @psalm-mutation-free
* @return static
*/
public function setDate(int $year, int $month, int $day) {}
/**
* @psalm-mutation-free
* @return static
*/
public function setISODate(int $year, int $week, int $dayOfWeek = 1) {}
/**
* @psalm-mutation-free
* @return static
*/
public function setTimestamp(int $unixtimestamp) {}
/**
* @psalm-mutation-free
* @return static
*/
public static function createFromMutable(DateTime $object) {}
}
/**
* @psalm-immutable
*/
class DateTimeZone
{
public function __construct(string $timezone) {}
}
/**
* @psalm-immutable
*
* @template-covariant Start of string|DateTimeInterface
* @implements Traversable<int, DateTimeInterface>
*/
class DatePeriod implements Traversable
{
const EXCLUDE_START_DATE = 1;
/**
* @param Start $start
* @param (Start is string ? 0|self::EXCLUDE_START_DATE : DateInterval) $interval
* @param (Start is string ? never : DateTimeInterface|positive-int) $end
* @param (Start is string ? never : 0|self::EXCLUDE_START_DATE) $options
*/
public function __construct($start, $interval = 0, $end = 1, $options = 0) {}
}
/**
* @psalm-taint-specialize
*/
interface Throwable
{
/**
* @psalm-mutation-free
*/
public function getMessage() : string;
/**
* @psalm-mutation-free
*
* @return int|string https://www.php.net/manual/en/throwable.getcode.php
*/
public function getCode();
/**
* @psalm-mutation-free
*/
public function getFile() : string;
/**
* @psalm-mutation-free
*/
public function getLine() : int;
/**
* @psalm-mutation-free
* @return list<array{file?:string,line?:int,function?:string,class?:class-string,type?:'::'|'->',args?:array<mixed>}>
*/
public function getTrace() : array;
/**
* @psalm-mutation-free
*/
public function getPrevious() : ?Throwable;
/**
* @psalm-mutation-free
* @psalm-taint-source input
*/
public function getTraceAsString() : string;
/**
* @return string
* @psalm-taint-source input
*/
public function __toString();
}
/**
* @psalm-taint-specialize
*/
class Exception implements Throwable
{
/**
* @var string
*/
protected $message = '';
/**
* @var int
*/
protected $code = 0;
/**
* @var string
*/
protected $file = '';
/**
* @var int
*/
protected $line = 0;
/**
* @psalm-external-mutation-free
* @param string $message
* @param int $code
* @param Throwable $previous
*/
public function __construct($message = "", $code = 0, Throwable $previous = null) {}
/**
* @psalm-mutation-free
*/
public final function getMessage() : string {}
/**
* @psalm-mutation-free
*
* @return int|string https://www.php.net/manual/en/throwable.getcode.php
*/
public final function getCode() {}
/**
* @psalm-mutation-free
*/
public final function getFile(): string {}
/**
* @psalm-mutation-free
*/
public final function getLine(): int {}
/**
* @psalm-mutation-free
* @return list<array{file?:string,line?:int,function?:string,class?:class-string,type?:'::'|'->',args?:array<mixed>}>
*/
public final function getTrace() : array {}
/**
* @psalm-mutation-free
*/
public final function getPrevious() : ?Throwable {}
/**
* @psalm-mutation-free
* @psalm-taint-source input
*/
public final function getTraceAsString() : string {}
/**
* @return string
* @psalm-taint-source input
*/
public function __toString() {}
}
/**
* @psalm-taint-specialize
*/
class Error implements Throwable
{
/**
* @var string
*/
protected $message = '';
/**
* @var int
*/
protected $code = 0;
/**
* @var string
*/
protected $file = '';
/**
* @var int
*/
protected $line = 0;
/**
* @psalm-external-mutation-free
* @param string $message
* @param int $code
* @param Throwable $previous
*/
public function __construct($message = "", $code = 0, Throwable $previous = null) {}
/**
* @psalm-mutation-free
*/
public final function getMessage() : string {}
/**
* @psalm-mutation-free
*/
public final function getCode(): int {}
/**
* @psalm-mutation-free
*/
public final function getFile(): string {}
/**
* @psalm-mutation-free
*/
public final function getLine(): int{}
/**
* @psalm-mutation-free
* @return list<array{file?:string,line?:int,function?:string,class?:class-string,type?:'::'|'->',args?:array<mixed>}>
*/
public final function getTrace() : array {}
/**
* @psalm-mutation-free
*/
public final function getPrevious() : ?Throwable {}
/**
* @psalm-mutation-free
* @psalm-taint-source input
*/
public final function getTraceAsString() : string {}
/**
* @return string
* @psalm-taint-source input
*/
public function __toString() {}
}

262
vendor/vimeo/psalm/stubs/Php80.phpstub vendored Normal file
View File

@@ -0,0 +1,262 @@
<?php
interface Stringable
{
/** @return string */
function __toString();
}
/**
* @template TClass as object
*/
class ReflectionAttribute
{
const IS_INSTANCEOF = 2;
private function __construct()
{
}
/**
* @return non-empty-string
*
* @psalm-pure
*/
public function getName() : string
{
}
/**
* @psalm-pure
* @return int-mask-of<Attribute::TARGET_*>
*/
public function getTarget() : int
{
}
/** @psalm-pure */
public function isRepeated() : bool
{
}
public function getArguments() : array
{
}
/**
* @return TClass
*/
public function newInstance() : object
{
}
/**
* @return never-return
*/
private function __clone()
{
}
}
/**
* @template-covariant T as object
*
* @property-read class-string<T> $name
*/
class ReflectionClass implements Reflector {
/**
* @return non-empty-string|false
* @psalm-pure
*/
public function getFileName(): string|false {}
/**
* @return positive-int|false
* @psalm-pure
*/
public function getStartLine(): int|false {}
/**
* @return positive-int|false
* @psalm-pure
*/
public function getEndLine(): int|false {}
/**
* @return non-empty-string|false
* @psalm-pure
*/
public function getDocComment(): string|false {}
/**
* @template J as object
* @param self<J>|class-string<J> $class
* @psalm-assert-if-true self<T&J> $this
* @psalm-pure
*/
public function isSubclassOf(self|string $class): bool {}
/**
* @template J as object
* @param self<J>|interface-string<J> $interface
* @psalm-assert-if-true self<T&J> $this
* @psalm-pure
*/
public function implementsInterface(self|string $interface): bool {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getExtensionName(): string|false {}
/**
* @param list<mixed>|array<string, mixed> $args
*
* @return T
*/
public function newInstanceArgs(array $args): object {}
}
/** @psalm-immutable */
class ReflectionClassConstant
{
public const IS_PUBLIC = 1;
public const IS_PROTECTED = 2;
public const IS_PRIVATE = 4;
/** @return non-empty-string|false */
public function getDocComment(): string|false {}
}
abstract class ReflectionFunctionAbstract implements Reflector
{
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getDocComment(): string|false {}
/**
* @return positive-int|false
*
* @psalm-pure
*/
public function getStartLine(): int|false {}
/**
* @return positive-int|false
*
* @psalm-pure
*/
public function getEndLine(): int|false {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getFileName(): string|false {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getExtensionName(): string|false {}
}
/** @psalm-immutable */
class Attribute
{
public int $flags;
public const TARGET_CLASS = 1;
public const TARGET_FUNCTION = 2;
public const TARGET_METHOD = 4;
public const TARGET_PROPERTY = 8;
public const TARGET_CLASS_CONSTANT = 16;
public const TARGET_PARAMETER = 32;
public const TARGET_ALL = 63;
public const IS_REPEATABLE = 64;
/**
* @param int-mask-of<self::*> $flags
*/
public function __construct(int $flags = self::TARGET_ALL)
{
}
}
class ReflectionProperty implements Reflector
{
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getDocComment(): string|false {}
}
/** @psalm-immutable */
class ReflectionUnionType extends ReflectionType {
/** @return non-empty-list<ReflectionNamedType> */
public function getTypes(): array {}
}
class UnhandledMatchError extends Error {}
/**
* @psalm-immutable
*
* @template-covariant Start of string|DateTimeInterface
* @implements IteratorAggregate<int, DateTimeInterface>
*/
class DatePeriod implements IteratorAggregate
{
const EXCLUDE_START_DATE = 1;
/**
* @param Start $start
* @param (Start is string ? 0|self::EXCLUDE_START_DATE : DateInterval) $interval
* @param (Start is string ? never : (DateTimeInterface|positive-int)) $end
* @param (Start is string ? never : 0|self::EXCLUDE_START_DATE) $options
*/
public function __construct($start, $interval = 0, $end = 1, $options = 0) {}
/** @psalm-return (Start is string ? Iterator<int, DateTime> : Iterator<int, Start>) */
public function getIterator(): Iterator {}
}
/**
* @psalm-pure
*
* @param resource|null $context
*
* @return ($associative is false|0 ? list<string> : array<string, string|list<string>>)|false
*
* @psalm-taint-sink ssrf $url
*/
function get_headers(string $url, bool $associative = false, $context = null) : array|false {}
final class CurlHandle
{
private function __construct()
{
}
}
final class CurlMultiHandle
{
private function __construct()
{
}
}
final class CurlShareHandle
{
private function __construct()
{
}
}

119
vendor/vimeo/psalm/stubs/Php81.phpstub vendored Normal file
View File

@@ -0,0 +1,119 @@
<?php
namespace {
interface UnitEnum {
/** @var non-empty-string $name */
public readonly string $name;
/**
* @psalm-pure
* @return list<static>
*/
public static function cases(): array;
}
interface BackedEnum extends UnitEnum
{
/** @var non-empty-string $name */
public readonly string $name;
public readonly int|string $value;
/**
* @psalm-pure
*/
public static function from(string|int $value): static;
/**
* @psalm-pure
*/
public static function tryFrom(string|int $value): ?static;
/**
* @psalm-pure
* @return list<static>
*/
public static function cases(): array;
}
class ReflectionClass implements Reflector {
/** @psalm-pure */
public function isEnum(): bool {}
}
class ReflectionProperty implements Reflector
{
/**
* Starting from PHP 8.1, this method is pure, and has no effect.
*
* @psalm-pure
*/
public function setAccessible(bool $accessible): void {}
}
class ReflectionMethod extends ReflectionFunctionAbstract
{
/**
* Starting from PHP 8.1, this method is pure, and has no effect.
*
* @psalm-pure
*/
public function setAccessible(bool $accessible): void {}
}
/** @psalm-immutable */
class ReflectionEnum extends ReflectionClass implements Reflector
{
public function getBackingType(): ?ReflectionType;
public function getCase(string $name): ReflectionEnumUnitCase;
/** @return list<ReflectionEnumUnitCase> */
public function getCases(): array;
public function hasCase(string $name): bool;
public function isBacked(): bool;
}
/** @psalm-immutable */
class ReflectionEnumUnitCase extends ReflectionClassConstant implements Reflector
{
public function getEnum(): ReflectionEnum;
public function getValue(): UnitEnum;
}
/** @psalm-immutable */
class ReflectionEnumBackedCase extends ReflectionEnumUnitCase implements Reflector
{
public function getBackingValue(): int|string;
}
/** @psalm-immutable */
class ReflectionIntersectionType extends ReflectionType {
/** @return non-empty-list<ReflectionNamedType> */
public function getTypes(): array {}
/** @return false */
public function allowsNull(): bool {}
}
}
namespace FTP {
final class Connection {}
}
namespace IMAP {
final class Connection {}
}
namespace LDAP {
final class Connection {}
final class Result {}
final class ResultEntry {}
}
namespace PgSql {
final class Connection {}
final class Result {}
final class Lob {}
}
namespace PSpell {
final class Config {}
final class Dictionary {}
}

36
vendor/vimeo/psalm/stubs/Php82.phpstub vendored Normal file
View File

@@ -0,0 +1,36 @@
<?php
namespace {
class ReflectionClass implements Reflector {
/** @psalm-pure */
public function isReadOnly(): bool {}
}
/** @psalm-immutable */
class ReflectionUnionType extends ReflectionType {
/** @return non-empty-list<ReflectionNamedType|ReflectionIntersectionType> */
public function getTypes(): array {}
}
/**
* @psalm-immutable
*
* @template-covariant Start of string|DateTimeInterface
* @implements IteratorAggregate<int, DateTimeInterface>
*/
class DatePeriod implements IteratorAggregate
{
const EXCLUDE_START_DATE = 1;
const INCLUDE_END_DATE = 2;
/**
* @param Start $start
* @param (Start is string ? int-mask<self::EXCLUDE_START_DATE, self::INCLUDE_END_DATE> : DateInterval) $interval
* @param (Start is string ? never : (DateTimeInterface|positive-int)) $end
* @param (Start is string ? never : int-mask<self::EXCLUDE_START_DATE, self::INCLUDE_END_DATE>) $options
*/
public function __construct($start, $interval = 0, $end = 1, $options = 0) {}
/** @psalm-return (Start is string ? Iterator<int, DateTime> : Iterator<int, Start>) */
public function getIterator(): Iterator {}
}
}

View File

@@ -0,0 +1,672 @@
<?php
/**
* @template-covariant T as object
*
* @property-read class-string<T> $name
*/
class ReflectionClass implements Reflector {
/**
* @var class-string<T>
*/
public $name;
/**
* @param T|class-string<T>|interface-string<T>|trait-string|enum-string<T> $argument
* @psalm-pure
*/
public function __construct($argument) {}
/**
* @return class-string<T>
* @psalm-pure
*/
public function getName(): string {}
/** @psalm-pure */
public function isInternal(): bool {}
/** @psalm-pure */
public function isUserDefined(): bool {}
/** @psalm-pure */
public function isInstantiable(): bool {}
/** @psalm-pure */
public function isCloneable(): bool {}
/**
* @return non-empty-string|false
* @psalm-pure
*/
public function getFileName() {}
/**
* @return positive-int|false
* @psalm-pure
*/
public function getStartLine() {}
/**
* @return positive-int|false
* @psalm-pure
*/
public function getEndLine() {}
/**
* @return non-empty-string|false
* @psalm-pure
*/
public function getDocComment() {}
/** @psalm-pure */
public function getConstructor(): ?ReflectionMethod {}
/** @psalm-pure */
public function hasMethod(string $name): bool {}
/**
* @psalm-pure
* @throws ReflectionException
*/
public function getMethod(string $name): ReflectionMethod {}
/**
* @param int-mask-of<ReflectionMethod::IS_*>|null $filter
* @return list<ReflectionMethod>
* @psalm-pure
*/
public function getMethods(?int $filter = null): array {}
/**
* @psalm-pure
* @throws ReflectionException
*/
public function hasProperty(string $name): bool {}
/**
* @psalm-pure
* @throws ReflectionException
*/
public function getProperty(string $name): ReflectionProperty {}
/**
* @param int-mask-of<ReflectionProperty::IS_*>|null $filter
* @return list<ReflectionProperty>
*
* @psalm-pure
*/
public function getProperties(?int $filter = null): array {}
/**
* @psalm-pure
*/
public function hasConstant(string $name): bool {}
/**
* @return mixed
*
* @psalm-pure
* @throws ReflectionException
*/
public function getConstant(string $name) {}
/**
* @return ReflectionClassConstant|false
*
* @psalm-pure
* @throws ReflectionException
*/
public function getReflectionConstant(string $name) {}
/**
* @param int-mask-of<ReflectionClassConstant::IS_*>|null $filter
* @return array<non-empty-string, mixed>
*
* @psalm-pure
*/
public function getConstants(?int $filter = null): array {}
/**
* @param int-mask-of<ReflectionClassConstant::IS_*>|null $filter
* @return list<ReflectionClassConstant>
*
* @psalm-pure
*/
public function getReflectionConstants(?int $filter = null): array {}
/**
* @return array<interface-string, self>
* @psalm-pure
*/
public function getInterfaces(): array {}
/**
* @return list<interface-string>
* @psalm-pure
*/
public function getInterfaceNames(): array {}
/** @psalm-pure */
public function isInterface(): bool {}
/**
* @return array<trait-string, self>
*
* @psalm-pure
*/
public function getTraits(): array {}
/**
* @return array<non-empty-string, non-empty-string>
*
* @psalm-pure
*/
public function getTraitAliases(): array {}
/** @psalm-pure */
public function isTrait(): bool {}
/** @psalm-pure */
public function isAbstract(): bool {}
/** @psalm-pure */
public function isFinal(): bool {}
/**
* @return int-mask-of<ReflectionClass::IS_*>
* @psalm-pure
*/
public function getModifiers(): int {}
/**
* @template J as object
* @param J $object
* @psalm-assert-if-true T&J $object
* @psalm-pure
*/
public function isInstance(object $object): bool {}
/**
* @param mixed ...$args
*
* @return T
*/
public function newInstance(...$args): object {}
/**
* @param list<mixed> $args
*
* @return T
*/
public function newInstanceArgs(array $args): object {}
/**
* @return T
*/
public function newInstanceWithoutConstructor(): object {}
/**
* @psalm-pure
*
* @return ReflectionClass|false
*/
public function getParentClass() {}
/**
* @template J as object
* @param self<J>|class-string<J> $class
* @psalm-assert-if-true self<T&J> $this
* @psalm-pure
*/
public function isSubclassOf($class): bool {}
/** @return array<non-empty-string, mixed> */
public function getStaticProperties(): array {}
/**
* @return array<non-empty-string, mixed>
*
* @psalm-pure
*/
public function getDefaultProperties(): array {}
/** @psalm-pure */
public function isIterateable(): bool {}
/** @psalm-pure */
public function isIterable(): bool {}
/**
* @template J as object
* @param self<J>|interface-string<J> $interface
* @psalm-assert-if-true self<T&J> $this
* @psalm-pure
*/
public function implementsInterface($interface): bool {}
/** @psalm-pure */
public function getExtension(): ?ReflectionExtension {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getExtensionName() {}
/** @psalm-pure */
public function inNamespace(): bool {}
/** @psalm-pure */
public function getNamespaceName(): string {}
/**
* @return non-empty-string
*
* @psalm-pure
*/
public function getShortName(): string {}
/**
* @return list<trait-string>
* @psalm-pure
*/
public function getTraitNames(): array {}
/**
* @since 8.0
* @template TClass as object
* @param class-string<TClass>|null $name
* @return ($name is null ? list<ReflectionAttribute<object>> : list<ReflectionAttribute<TClass>>)
* @psalm-pure
*/
public function getAttributes(?string $name = null, int $flags = 0): array {}
}
abstract class ReflectionFunctionAbstract implements Reflector
{
/** @psalm-pure */
public function inNamespace(): bool {}
/** @psalm-pure */
public function isClosure(): bool {}
/** @psalm-pure */
public function isDeprecated(): bool {}
/** @psalm-pure */
public function isInternal(): bool {}
/** @psalm-pure */
public function isUserDefined(): bool {}
public function getClosureThis(): ?object {}
/** @psalm-pure */
public function getClosureScopeClass(): ?ReflectionClass {}
/** @psalm-pure */
public function getClosureCalledClass(): ?ReflectionClass {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getDocComment() {}
/**
* @return positive-int|false
*
* @psalm-pure
*/
public function getStartLine() {}
/**
* @return positive-int|false
*
* @psalm-pure
*/
public function getEndLine() {}
/** @psalm-pure */
public function getExtension(): ?ReflectionExtension {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getExtensionName() {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getFileName() {}
/**
* @return non-empty-string
*
* @psalm-pure
*/
public function getName(): string {}
/** @psalm-pure */
public function getNamespaceName(): string {}
/**
* @return positive-int|0
*
* @psalm-pure
*/
public function getNumberOfParameters(): int {}
/**
* @return positive-int|0
*
* @psalm-pure
*/
public function getNumberOfRequiredParameters(): int {}
/**
* @return list<ReflectionParameter>
*
* @psalm-pure
*/
public function getParameters(): array {}
/**
* @psalm-assert-if-true ReflectionType $this->getReturnType()
*
* @psalm-pure
*/
public function hasReturnType(): bool {}
/** @psalm-pure */
public function getReturnType(): ?ReflectionType {}
/**
* @return non-empty-string
*
* @psalm-pure
*/
public function getShortName(): string {}
/** @psalm-pure */
public function returnsReference(): bool {}
/** @psalm-pure */
public function isGenerator(): bool {}
/** @psalm-pure */
public function isVariadic(): bool {}
/** @psalm-pure */
public function isDisabled(): bool {}
/** @psalm-pure */
public function getClosure(): Closure {}
/**
* @since 8.0
* @template TClass as object
* @param class-string<TClass>|null $name
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
*/
public function getAttributes(?string $name = null, int $flags = 0): array {}
}
class ReflectionFunction extends ReflectionFunctionAbstract
{
/**
* @param callable-string|Closure $function
*
* @psalm-pure
*/
public function __construct(callable $function) {}
/**
* @return non-empty-string
*
* @psalm-pure
*/
public function __toString(): string {}
}
class ReflectionProperty implements Reflector
{
/**
* @var string
* @readonly
*/
public $name;
/**
* @var class-string
* @readonly
*/
public $class;
/**
* @return non-empty-string
*
* @psalm-pure
*/
public function getName(): string {}
/**
* @since 8.0
* @template TClass as object
* @param class-string<TClass>|null $name
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
*/
public function getAttributes(?string $name = null, int $flags = 0): array {}
/**
* @since 7.4
* @psalm-assert-if-true ReflectionType $this->getType()
* @psalm-pure
*/
public function hasType() : bool {}
/**
* @since 7.4
* @psalm-pure
*/
public function getType() : ?ReflectionType {}
/** @psalm-pure */
public function isPublic(): bool {}
/** @psalm-pure */
public function isPrivate(): bool {}
/** @psalm-pure */
public function isProtected(): bool {}
/** @psalm-pure */
public function isStatic(): bool {}
/** @psalm-pure */
public function isDefault(): bool {}
/**
* @return int-mask-of<self::IS_>
* @psalm-pure
*/
public function getModifiers(): int {}
/** @psalm-pure */
public function getDeclaringClass(): ReflectionClass {}
/**
* @return non-empty-string|false
*
* @psalm-pure
*/
public function getDocComment() {}
/**
* @since 8.0
* @psalm-pure
*/
public function hasDefaultValue(): bool {}
/**
* @return mixed
*
* @psalm-pure
*/
public function getDefaultValue() {}
/**
* @since 8.0
* @psalm-pure
*/
public function isPromoted(): bool {}
/**
* @since 8.1
* @psalm-pure
*/
public function isReadOnly(): bool {}
}
class ReflectionMethod extends ReflectionFunctionAbstract
{
/**
* @var string
* @readonly
*/
public $name;
/**
* @var class-string
* @readonly
*/
public $class;
/** @psalm-pure */
public function isStatic(): bool {}
/** @psalm-pure */
public function isConstructor(): bool {}
/** @psalm-pure */
public function isDestructor(): bool {}
/**
* @return int-mask-of<ReflectionMethod::IS_*>
* @psalm-pure
*/
public function getModifiers(): int {}
/** @psalm-pure */
public function getDeclaringClass(): ReflectionClass {}
/** @psalm-pure */
public function getPrototype(): ReflectionMethod {}
}
/** @psalm-immutable */
class ReflectionClassConstant implements Reflector
{
/**
* @var non-empty-string
* @readonly
*/
public $name;
/**
* @var class-string
* @readonly
*/
public $class;
/**
* @var bool
* @since 8.1
* @readonly
*/
public $isFinal;
/**
* @since 8.0
* @template TClass as object
* @param class-string<TClass>|null $name
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
*/
public function getAttributes(?string $name = null, int $flags = 0): array {}
/** @return non-empty-string */
public function getName(): string {}
/** @return int-mask-of<self::IS_*> */
public function getModifiers(): int {}
/** @return non-empty-string|false */
public function getDocComment() {}
}
/** @psalm-immutable */
class ReflectionParameter implements Reflector {
/**
* @var non-empty-string
* @readonly
*/
public $name;
/** @return non-empty-string */
public function getName(): string {}
/**
* @psalm-assert-if-true ReflectionType $this->getType()
*/
public function hasType() : bool {}
public function getType() : ?ReflectionType {}
/**
* @since 8.0
* @template TClass as object
* @param class-string<TClass>|null $name
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
*/
public function getAttributes(?string $name = null, int $flags = 0): array {}
/**
* @since 8.0
*/
public function isPromoted(): bool {}
/**
* @psalm-assert-if-true string $this->getDefaultValueConstantName()
*/
public function isDefaultValueConstant(): bool {}
public function getDefaultValueConstantName(): ?string {}
}
/** @psalm-immutable */
abstract class ReflectionType
{
}
/** @psalm-immutable */
class ReflectionNamedType extends ReflectionType
{
/** @return non-empty-string */
public function getName(): string {}
/**
* @psalm-assert-if-false class-string|'self'|'static' $this->getName()
*/
public function isBuiltin(): bool {}
/** @return non-empty-string */
public function __toString(): string {}
}

971
vendor/vimeo/psalm/stubs/SPL.phpstub vendored Normal file
View File

@@ -0,0 +1,971 @@
<?php
/**
* The SplDoublyLinkedList class provides the main functionalities of a doubly linked list.
* @link https://php.net/manual/en/class.spldoublylinkedlist.php
*
* @template TValue
* @template-implements Iterator<int, TValue>
* @template-implements ArrayAccess<int, TValue>
*/
class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable
{
public function __construct() {}
/**
* Add/insert a new value at the specified index
*
* @param int $index The index where the new value is to be inserted.
* @param TValue $newval The new value for the index.
* @return void
*
* @link https://php.net/spldoublylinkedlist.add
* @since 5.5.0
*/
public function add($index, $newval) {}
/**
* Pops a node from the end of the doubly linked list
* @link https://php.net/manual/en/spldoublylinkedlist.pop.php
*
* @return TValue The value of the popped node.
*
* @since 5.3.0
*/
public function pop() {}
/**
* Shifts a node from the beginning of the doubly linked list
* @link https://php.net/manual/en/spldoublylinkedlist.shift.php
*
* @return TValue The value of the shifted node.
*
* @since 5.3.0
*/
public function shift() {}
/**
* Pushes an element at the end of the doubly linked list
* @link https://php.net/manual/en/spldoublylinkedlist.push.php
*
* @param TValue $value The value to push.
* @return void
*
* @since 5.3.0
*/
public function push($value) {}
/**
* Prepends the doubly linked list with an element
* @link https://php.net/manual/en/spldoublylinkedlist.unshift.php
*
* @param TValue $value The value to unshift.
* @return void
*
* @since 5.3.0
*/
public function unshift($value) {}
/**
* Peeks at the node from the end of the doubly linked list
* @link https://php.net/manual/en/spldoublylinkedlist.top.php
*
* @return TValue The value of the last node.
*
* @since 5.3.0
*/
public function top() {}
/**
* Peeks at the node from the beginning of the doubly linked list
* @link https://php.net/manual/en/spldoublylinkedlist.bottom.php
*
* @return TValue The value of the first node.
*
* @since 5.3.0
*/
public function bottom() {}
/**
* Counts the number of elements in the doubly linked list.
* @link https://php.net/manual/en/spldoublylinkedlist.count.php
*
* @return int the number of elements in the doubly linked list.
*
* @since 5.3.0
*/
public function count() {}
/**
* Checks whether the doubly linked list is empty.
* @link https://php.net/manual/en/spldoublylinkedlist.isempty.php
*
* @return bool whether the doubly linked list is empty.
*
* @since 5.3.0
*/
public function isEmpty() {}
/**
* Returns whether the requested $index exists
* @link https://php.net/manual/en/spldoublylinkedlist.offsetexists.php
*
* @param int $index The index being checked.
* @return bool true if the requested index exists, otherwise false
*
* @since 5.3.0
*/
public function offsetExists($index) {}
/**
* Returns the value at the specified $index
* @link https://php.net/manual/en/spldoublylinkedlist.offsetget.php
*
* @param int $index The index with the value.
* @return TValue The value at the specified index.
*
* @since 5.3.0
*/
public function offsetGet($index) {}
/**
* Sets the value at the specified $index to $newval
* @link https://php.net/manual/en/spldoublylinkedlist.offsetset.php
*
* @param int $index The index being set.
* @param TValue $newval The new value for the index.
* @return void
*
* @since 5.3.0
*/
public function offsetSet($index, $newval) {}
/**
* Unsets the value at the specified $index
* @link https://php.net/manual/en/spldoublylinkedlist.offsetunset.php
*
* @param int $index The index being unset.
* @return void
*
* @since 5.3.0
*/
public function offsetUnset($index) {}
/**
* Return current array entry
* @link https://php.net/manual/en/spldoublylinkedlist.current.php
*
* @return TValue The current node value.
*
* @since 5.3.0
*/
public function current() {}
/**
* Return current node index
* @link https://php.net/manual/en/spldoublylinkedlist.key.php
*
* @return int The current node index.
*
* @since 5.3.0
*/
public function key() {}
}
/**
* The SplFixedArray class provides the main functionalities of array.
* The main differences between a SplFixedArray and a normal PHP array is that
* the SplFixedArray is of fixed length and allows only integers within the range as indexes.
* The advantage is that it uses less memory than a standard array.
*
* @link https://php.net/manual/en/class.splfixedarray.php
*
* @template TValue
* @template-implements ArrayAccess<int, TValue>
* @template-implements Iterator<int, TValue>
*/
class SplFixedArray implements Iterator, ArrayAccess, Countable {
/**
* Constructs a new fixed array
*
* Initializes a fixed array with a number of NULL values equal to size.
* @link https://php.net/manual/en/splfixedarray.construct.php
*
* @param int $size The size of the fixed array. This expects a number between 0 and PHP_INT_MAX.
* @since 5.3.0
*/
public function __construct(int $size = 0) {}
/**
* Import a PHP array in a new SplFixedArray instance
* @link https://php.net/manual/en/splfixedarray.fromarray.php
*
* @template TInValue
* @param array<int, TInValue> $array The array to import
* @param bool $save_indexes [optional] Try to save the numeric indexes used in the original array.
*
* @return SplFixedArray<TInValue> Instance of SplFixedArray containing the array content
* @since 5.3.0
*/
public static function fromArray(array $array, bool $save_indexes = true): SplFixedArray {}
/**
* Returns a PHP array from the fixed array
* @link https://php.net/manual/en/splfixedarray.toarray.php
*
* @return array<int, TValue>
* @since 5.3.0
*/
public function toArray(): array {}
/**
* Returns the size of the array.
* @link https://php.net/manual/en/splfixedarray.getsize.php
*
* @return int The size of the array
* @see SplFixedArray::count()
*
* @since 5.3.0
*/
public function getSize(): int {}
/**
* Returns the size of the array.
* @link https://php.net/manual/en/splfixedarray.count.php
*
* @return int The size of the array
*
* @since 5.3.0
*/
public function count(): int {}
/**
* Rewind the iterator back to the start
* @link https://php.net/manual/en/splfixedarray.rewind.php
*
* @return void
*
* @since 5.3.0
*/
public function rewind(): void {}
/**
* Check whether the array contains more elements
* @link https://php.net/manual/en/splfixedarray.valid.php
*
* @return bool true if the array contains any more elements, false otherwise.
*
* @since 5.3.0
*/
public function valid(): bool {}
/**
* Returns current array index
* @link https://php.net/manual/en/splfixedarray.key.php
*
* @return int The current array index
*
* @since 5.3.0
*/
public function key(): int {}
/**
* Returns the current array entry
* @link https://php.net/manual/en/splfixedarray.current.php
*
* @return TValue The current element value
*
* @since 5.3.0
*/
public function current() {}
/**
* Move to the next entry
* @link https://php.net/manual/en/splfixedarray.next.php
*
* @return void
*
* @since 5.3.0
*/
public function next(): void {}
/**
* Returns whether the specified index exists
* @link https://php.net/manual/en/splfixedarray.offsetexists.php
*
* @param int $index The index being checked.
* @return bool true if the requested index exists, and false otherwise.
*
* @since 5.3.0
*/
public function offsetExists(int $index): bool {}
/**
* Sets a new value at a specified index
* @link https://php.net/manual/en/splfixedarray.offsetset.php
*
* @param int $index The index being sent.
* @param TValue $newval The new value for the index
* @return void
*
* @since 5.3.0
*/
public function offsetSet(int $index, $newval): void {}
/**
* Unsets the value at the specified $index
* @link https://php.net/manual/en/splfixedarray.offsetunset.php
*
* @param int $index The index being unset
* @return void
*
* @since 5.3.0
*/
public function offsetUnset(int $index): void {}
/**
* Returns the value at the specified index
* @link https://php.net/manual/en/splfixedarray.offsetget.php
*
* @param int $index The index with the value
* @return TValue The value at the specified index
*
* @since 5.3.0
*/
public function offsetGet(int $index) {}
}
/**
* The SplStack class provides the main functionalities of a stack implemented using a doubly linked list.
* @link https://php.net/manual/en/class.splstack.php
*
* @template TValue
* @template-extends SplDoublyLinkedList<TValue>
*/
class SplStack extends SplDoublyLinkedList {
}
/**
* The SplQueue class provides the main functionalities of a queue implemented using a doubly linked list.
* @link https://php.net/manual/en/class.splqueue.php
*
* @template TValue
* @template-extends SplDoublyLinkedList<TValue>
*/
class SplQueue extends SplDoublyLinkedList {
/**
* Adds an element to the queue.
* @link https://php.net/manual/en/splqueue.enqueue.php
*
* @param TValue $value The value to enqueue.
* @return void
*
* @since 5.3.0
*/
public function enqueue($value) {}
/**
* Dequeues a node from the queue
* @link https://php.net/manual/en/splqueue.dequeue.php
*
* @return TValue The value of the dequeued node.
*
* @since 5.3.0
*/
public function dequeue() {}
}
/**
* The SplHeap class provides the main functionalities of a Heap.
* @link https://php.net/manual/en/class.splheap.php
*
* @template TValue
* @template-implements Iterator<int, TValue>
*/
abstract class SplHeap implements Iterator, Countable {
public function __construct() {}
/**
* Compare elements in order to place them correctly in the heap while sifting up
* @link https://php.net/manual/en/splheap.compare.php
*
* @param TValue $value1 The value of the first node being compared.
* @param TValue $value2 The value of the second node being compared.
* @return int Positive integer if value1 is greater than value2, 0 if they are equal, negative integer otherwise.
*
* @since 5.3.0
*/
protected abstract function compare($value1, $value2): int;
/**
* Counts the number of elements in the heap
* @link https://php.net/manual/en/splheap.count.php
*
* @return int The number of elements in the heap.
*
* @since 5.3.0
*/
public function count(): int {}
/**
* Get the current datastructure node.
* @link https://php.net/manual/en/splheap.current.php
*
* @return TValue The current node value
*
* @since 5.3.0
*/
public function current() {}
/**
* Extracts a node from top of the heap and sift up
* @link https://php.net/manual/en/splheap.extract.php
*
* @return TValue The current node value
*
* @since 5.3.0
*/
public function extract() {}
/**
* Inserts an element in the heap by sifting it up
* @link https://php.net/manual/en/splheap.insert.php
*
* @param TValue $value The value to insert.
* @return void
*
* @since 5.3.0
*/
public function insert($value): void {}
/**
* Tells if the heap is in a corrupted state
* @link https://php.net/manual/en/splheap.isCorrupted.php
*
* @return bool true if the heap is corrupted, false otherwise.
*
* @since 7.0.0
*/
public function isCorrupted(): bool {}
/**
* Checks whether the heap is empty
* @link https://php.net/manual/en/splheap.isEmpty.php
*
* @return bool Whether the heap is empty
*
* @since 5.3.0
*/
public function isEmpty(): bool {}
/**
* Return current node index
* @link https://php.net/manual/en/splheap.key.php
*
* @return int The current node index
*
* @since 5.3.0
*/
public function key() {}
/**
* Move to the next node. This will delete the top node of the heap.
* @link https://php.net/manual/en/splheap.next.php
*
* @return void
*
* @since 5.3.0
*/
public function next(): void {}
/**
* Recover from the corrupted state and allow further actions on the heap
* @link https://php.net/manual/en/splheap.recoverFromCorruption.php
*
* @return void
*
* @since 5.3.0
*/
public function recoverFromCorruption(): void {}
/**
* Rewind iterator back to the start (no-op)
* @link https://php.net/manual/en/splheap.rewind.php
*
* @return void
*
* @since 5.3.0
*/
public function rewind(): void {}
/**
* Peeks at the node from the top of the heap
* @link https://php.net/manual/en/splheap.top.php
*
* @return TValue The value of the node on the top.
*
* @since 5.3.0
*/
public function top() {}
/**
* Check whether the heap contains any more nodes
* @link https://php.net/manual/en/splheap.valid.php
*
* @return bool Returns true if the heap contains any more nodes, false otherwise.
*
* @since 5.3.0
*/
public function valid(): bool {}
}
/**
* The SplMaxHeap class provides the main functionalities of a heap, keeping the maximum on the top.
* @link https://php.net/manual/en/class.splmaxheap.php
*
* @template TValue
* @template-extends SplHeap<TValue>
*/
class SplMaxHeap extends SplHeap {
}
/**
* The SplMinHeap class provides the main functionalities of a heap, keeping the maximum on the top.
* @link https://php.net/manual/en/class.splminheap.php
*
* @template TValue
* @template-extends SplHeap<TValue>
*/
class SplMinHeap extends SplHeap {
}
/**
* The SplPriorityQueue class provides the main functionalities of a prioritized queue, implemented using a max heap.
* @link https://php.net/manual/en/class.splpriorityqueue.php
*
* @template TPriority
* @template TValue
* @template-implements Iterator<int, TValue>
*/
class SplPriorityQueue implements Iterator, Countable {
/**
* Extract the data
*/
const EXTR_DATA = 0x00000001;
/**
* Extract the priority
*/
const EXTR_PRIORITY = 0x00000002;
/**
* Extract an array containing both
*/
const EXTR_BOTH = 0x00000003;
public function __construct() {}
/**
* Compare priorities in order to place them correctly in the queue while sifting up
* @link https://php.net/manual/en/splpriorityqueue.compare.php
*
* @param TValue $priority1 The priority of the first node being compared.
* @param TValue $priority2 The priority of the second node being compared.
* @return int Positive integer if priority1 is greater than priority2, 0 if they are equal, negative integer otherwise.
*
* @since 5.3.0
*/
public function compare($priority1, $priority2): int {}
/**
* Counts the number of elements in the queue
* @link https://php.net/manual/en/splpriorityqueue.count.php
*
* @return int The number of elements in the queue.
*
* @since 5.3.0
*/
public function count(): int {}
/**
* Get the current datastructure node.
* @link https://php.net/manual/en/splpriorityqueue.current.php
*
* @return TValue The current node value
*
* @since 5.3.0
*/
public function current() {}
/**
* Extracts a node from top of the queue and sift up
* @link https://php.net/manual/en/splpriorityqueue.extract.php
*
* @return TValue The current node value
*
* @since 5.3.0
*/
public function extract() {}
/**
* Get the flags of extraction
* @link https://php.net/manual/en/splpriorityqueue.getextractflags.php
*
* @return SplPriorityQueue::EXTR_* Returns the current extraction mode
*
* @see SplPriorityQueue::setExtractFlags
*
* @since 5.3.0
*/
public function getExtractFlags(): int {}
/**
* Inserts an element in the queue by sifting it up
* @link https://php.net/manual/en/splpriorityqueue.insert.php
*
* @param TValue $value The value to insert.
* @param TPriority $priority The associated priority.
* @return true
*
* @since 5.3.0
*/
public function insert($value, $priority): bool {}
/**
* Tells if the queue is in a corrupted state
* @link https://php.net/manual/en/splpriorityqueue.isCorrupted.php
*
* @return bool true if the queue is corrupted, false otherwise.
*
* @since 7.0.0
*/
public function isCorrupted(): bool {}
/**
* Checks whether the queue is empty
* @link https://php.net/manual/en/splpriorityqueue.isEmpty.php
*
* @return bool Whether the queue is empty
*
* @since 5.3.0
*/
public function isEmpty(): bool {}
/**
* Return current node index
* @link https://php.net/manual/en/splpriorityqueue.key.php
*
* @return int The current node index
*
* @since 5.3.0
*/
public function key() {}
/**
* Move to the next node.
* @link https://php.net/manual/en/splpriorityqueue.next.php
*
* @return void
*
* @since 5.3.0
*/
public function next(): void {}
/**
* Recover from the corrupted state and allow further actions on the queue
* @link https://php.net/manual/en/splpriorityqueue.recoverFromCorruption.php
*
* @return void
*
* @since 5.3.0
*/
public function recoverFromCorruption(): void {}
/**
* Rewind iterator back to the start (no-op)
* @link https://php.net/manual/en/splpriorityqueue.rewind.php
*
* @return void
*
* @since 5.3.0
*/
public function rewind(): void {}
/**
* Sets the mode of extraction
* @link https://php.net/manual/en/splpriorityqueue.setextractflags.php
*
* @param SplPriorityQueue::EXTR_* $flags Defines what is extracted by SplPriorityQueue::current(), SplPriorityQueue::top() and SplPriorityQueue::extract().
*
* @return void
*
* @since 5.3.0
*/
public function setExtractFlags(int $flags): void {}
/**
* Peeks at the node from the top of the queue
* @link https://php.net/manual/en/splpriorityqueue.top.php
*
* @return TValue The value of the node on the top.
*
* @since 5.3.0
*/
public function top() {}
/**
* Check whether the queue contains any more nodes
* @link https://php.net/manual/en/splpriorityqueue.valid.php
*
* @return bool Returns true if the queue contains any more nodes, false otherwise.
*
* @since 5.3.0
*/
public function valid(): bool {}
}
/**
* The SplObjectStorage class provides a map from objects to data or, by
* ignoring data, an object set. This dual purpose can be useful in many
* cases involving the need to uniquely identify objects.
* @link https://php.net/manual/en/class.splobjectstorage.php
*
* @template TObject as object
* @template TArrayValue
* @template-implements ArrayAccess<TObject, TArrayValue>
* @template-implements Iterator<int, TObject>
*/
class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess {
public function __construct() {}
/**
* Adds an object in the storage
* @link https://php.net/manual/en/splobjectstorage.attach.php
*
* @param TObject $object The object to add.
* @param TArrayValue|null $data [optional] The data to associate with the object.
* @return void
*
* @since 5.1.0
*/
public function attach($object, $data = null) {}
/**
* Removes an object from the storage
* @link https://php.net/manual/en/splobjectstorage.detach.php
*
* @param TObject $object The object to remove.
* @return void
*
* @since 5.1.0
*/
public function detach($object) {}
/**
* Checks if the storage contains a specific object
* @link https://php.net/manual/en/splobjectstorage.contains.php
*
* @param TObject $object The object to look for.
* @return bool true if the object is in the storage, false otherwise.
*
* @since 5.1.0
*/
public function contains($object) {}
/**
* Adds all objects from another storage
* @link https://php.net/manual/en/splobjectstorage.addall.php
*
* @param SplObjectStorage<TObject, TArrayValue> $storage The storage you want to import.
* @return void
*
* @since 5.3.0
*/
public function addAll($storage) {}
/**
* Removes objects contained in another storage from the current storage
* @link https://php.net/manual/en/splobjectstorage.removeall.php
*
* @param SplObjectStorage<TObject, TArrayValue> $storage The storage containing the elements to remove.
* @return void
*
* @since 5.3.0
*/
public function removeAll($storage) {}
/**
* Removes all objects except for those contained in another storage from the current storage
* @link https://php.net/manual/en/splobjectstorage.removeallexcept.php
*
* @param SplObjectStorage<TObject, TArrayValue> $storage The storage containing the elements to retain in the current storage.
* @return void
*
* @since 5.3.6
*/
public function removeAllExcept($storage) {}
/**
* Returns the data associated with the current iterator entry
* @link https://php.net/manual/en/splobjectstorage.getinfo.php
*
* @return TArrayValue The data associated with the current iterator position.
*
* @since 5.3.0
*/
public function getInfo() {}
/**
* Sets the data associated with the current iterator entry
* @link https://php.net/manual/en/splobjectstorage.setinfo.php
*
* @param TArrayValue $data The data to associate with the current iterator entry.
* @return void
*
* @since 5.3.0
*/
public function setInfo($data) {}
/**
* Returns the number of objects in the storage
* @link https://php.net/manual/en/splobjectstorage.count.php
*
* @return int The number of objects in the storage.
*
* @since 5.1.0
*/
public function count() {}
/**
* Rewind the iterator to the first storage element
* @link https://php.net/manual/en/splobjectstorage.rewind.php
*
* @return void
*
* @since 5.1.0
*/
public function rewind() {}
/**
* Returns if the current iterator entry is valid
* @link https://php.net/manual/en/splobjectstorage.valid.php
*
* @return bool true if the iterator entry is valid, false otherwise.
*
* @since 5.1.0
*/
public function valid() {}
/**
* Returns the index at which the iterator currently is
* @link https://php.net/manual/en/splobjectstorage.key.php
*
* @return int The index corresponding to the position of the iterator.
*
* @since 5.1.0
*/
public function key() {}
/**
* Returns the current storage entry
* @link https://php.net/manual/en/splobjectstorage.current.php
*
* @return TObject The object at the current iterator position.
*
* @since 5.1.0
*/
public function current() {}
/**
* Move to the next entry
* @link https://php.net/manual/en/splobjectstorage.next.php
*
* @return void
*
* @since 5.1.0
*/
public function next() {}
/**
* Unserializes a storage from its string representation
* @link https://php.net/manual/en/splobjectstorage.unserialize.php
*
* @param string $serialized The serialized representation of a storage.
* @return void
*
* @since 5.2.2
*/
public function unserialize($serialized) {}
/**
* Serializes the storage
* @link https://php.net/manual/en/splobjectstorage.serialize.php
*
* @return string A string representing the storage.
*
* @since 5.2.2
*/
public function serialize() {}
/**
* Checks whether an object exists in the storage
* @link https://php.net/manual/en/splobjectstorage.offsetexists.php
*
* @param TObject $object The object to look for.
* @return bool true if the object exists in the storage, and false otherwise.
*
* @since 5.3.0
*/
public function offsetExists($object) {}
/**
* Associates data to an object in the storage
* @link https://php.net/manual/en/splobjectstorage.offsetset.php
*
* @param TObject $object The object to associate data with.
* @param TArrayValue|null $data [optional] The data to associate with the object.
* @return void
*
* @since 5.3.0
*/
public function offsetSet($object, $data = null) {}
/**
* Removes an object from the storage
* @link https://php.net/manual/en/splobjectstorage.offsetunset.php
*
* @param TObject $object The object to remove.
* @return void
*
* @since 5.3.0
*/
public function offsetUnset($object) {}
/**
* Returns the data associated with an <type>object</type>
* @link https://php.net/manual/en/splobjectstorage.offsetget.php
*
* @param TObject $object The object to look for.
* @return TArrayValue The data previously associated with the object in the storage.
*
* @since 5.3.0
*/
public function offsetGet($object) {}
/**
* Calculate a unique identifier for the contained objects
* @link https://php.net/manual/en/splobjectstorage.gethash.php
*
* @param object $object object whose identifier is to be calculated.
* @return string A string with the calculated identifier.
*
* @since 5.4.0
*/
public function getHash($object) {}
}

View File

@@ -0,0 +1,92 @@
<?php
define('APC_LIST_ACTIVE', 1);
define('APC_LIST_DELETED', 2);
define('APC_ITER_TYPE', 1);
define('APC_ITER_KEY', 2);
define('APC_ITER_FILENAME', 4);
define('APC_ITER_DEVICE', 8);
define('APC_ITER_INODE', 16);
define('APC_ITER_VALUE', 32);
define('APC_ITER_MD5', 64);
define('APC_ITER_NUM_HITS', 128);
define('APC_ITER_MTIME', 256);
define('APC_ITER_CTIME', 512);
define('APC_ITER_DTIME', 1024);
define('APC_ITER_ATIME', 2048);
define('APC_ITER_REFCOUNT', 4096);
define('APC_ITER_MEM_SIZE', 8192);
define('APC_ITER_TTL', 16384);
define('APC_ITER_NONE', 0);
define('APC_ITER_ALL', -1);
class APCUIterator implements Iterator
{
/**
* @param array<string>|null|string $search
* @param int $format
* @param int $chunk_size
* @param int $list
*
* @return void
*/
public function __construct($search, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE)
{
}
/**
* @return void
*/
public function rewind()
{
}
/**
* @return void
*/
public function next()
{
}
/**
* @return bool
*/
public function valid()
{
}
/**
* @return string
*/
public function key()
{
}
/**
* @return mixed
*/
public function current()
{
}
/**
* @return int
*/
public function getTotalHits()
{
}
/**
* @return int
*/
public function getTotalSize()
{
}
/**
* @return int
*/
public function getTotalCount()
{
}
}

View File

@@ -0,0 +1,492 @@
<?php
namespace Decimal;
/**
* Copied from https://github.com/php-decimal/stubs/blob/master/Decimal.php
*
* The MIT License (MIT)
* Copyright (c) 2018 Rudi Theunissen
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
final class Decimal implements \JsonSerializable
{
/**
* These constants are for auto-complete only.
*/
const ROUND_UP = 101; /* Round away from zero. */
const ROUND_DOWN = 102; /* Round towards zero. */
const ROUND_CEILING = 103; /* Round towards positive infinity */
const ROUND_FLOOR = 104; /* Round towards negative infinity */
const ROUND_HALF_UP = 105; /* Round to nearest, ties away from zero. */
const ROUND_HALF_DOWN = 106; /* Round to nearest, ties towards zero. */
const ROUND_HALF_EVEN = 107; /* Round to nearest, ties towards even. */
const ROUND_HALF_ODD = 108; /* Round to nearest, ties towards odd. */
const ROUND_TRUNCATE = 109; /* Truncate, keeping infinity. */
const DEFAULT_ROUNDING = Decimal::ROUND_HALF_EVEN;
const DEFAULT_PRECISION = 28;
const MIN_PRECISION = 1;
const MAX_PRECISION = 0; /* This value may change across platforms */
/**
* Constructor
*
* Initializes a new instance using a given value and minimum precision.
*
* @param Decimal|string|int $value
* @param int $precision
*
* @throws \BadMethodCallException if already constructed.
* @throws \TypeError if the value is not a decimal, string, or integer.
* @throws \DomainException is the type is supported but the value could not
* be converted to decimal.
*/
public function __construct($value, int $precision = Decimal::DEFAULT_PRECISION) {}
/**
* Sum
*
* The precision of the result will be the max of all precisions that were
* encountered during the calculation. The given precision should therefore
* be considered the minimum precision of the result.
*
* This method is equivalent to adding each value individually.
*
* @param array|\Traversable $values
* @param int $precision Minimum precision of the sum.
*
* @return Decimal the sum of all given values.
*
* @throws \TypeError if an unsupported type is encountered.
* @throws \ArithmeticError if addition is undefined, eg. INF + -INF
*/
public static function sum($values, int $precision = Decimal::DEFAULT_PRECISION): Decimal {}
/**
* Average
*
* The precision of the result will be the max of all precisions that were
* encountered during the calculation. The given precision should therefore
* be considered the minimum precision of the result.
*
* This method is equivalent to adding each value individually,
* then dividing by the number of values.
*
* @param array|\Traversable $values
* @param int $precision Minimum precision of the average.
*
* @return Decimal the average of all given values.
*
* @throws \TypeError if an unsupported type is encountered.
* @throws \ArithmeticError if addition is undefined, eg. INF + -INF
*/
public static function avg($values, int $precision = Decimal::DEFAULT_PRECISION): Decimal {}
/**
* Copy
*
* @param int $precision The precision of the return value, which defaults
* to the precision of this decimal.
*
* @return Decimal a copy of this decimal.
*/
public function copy(int $precision = null): Decimal {}
/**
* Add
*
* This method is equivalent to the `+` operator.
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
*
* @return Decimal the result of adding this decimal to the given value.
*
* @throws \TypeError if the value is not a decimal, string or integer.
*/
public function add($value): Decimal {}
/**
* Subtract
*
* This method is equivalent to the `-` operator.
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
*
* @return Decimal the result of subtracting a given value from this decimal.
*
* @throws \TypeError if the value is not a decimal, string or integer.
*/
public function sub($value): Decimal {}
/**
* Multiply
*
* This method is equivalent to the `*` operator.
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
*
* @return Decimal the result of multiplying this decimal by the given value.
*
* @throws \TypeError if the given value is not a decimal, string or integer.
*/
public function mul($value): Decimal {}
/**
* Divide
*
* This method is equivalent to the `/` operator.
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
*
* @return Decimal the result of dividing this decimal by the given value.
*
* @throws \TypeError if the value is not a decimal, string or integer.
* @throws \DivisionByZeroError if dividing by zero.
* @throws \ArithmeticError if division is undefined, eg. INF / -INF
*/
public function div($value): Decimal {}
/**
* Modulo (integer)
*
* This method is equivalent to the `%` operator.
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @see Decimal::rem for the decimal remainder.
*
* @param Decimal|string|int $value
*
* @return Decimal the remainder after dividing the integer value of this
* decimal by the integer value of the given value
*
* @throws \TypeError if the value is not a decimal, string or integer.
* @throws \DivisionByZeroError if the integer value of $value is zero.
* @throws \ArithmeticError if the operation is undefined, eg. INF % -INF
*/
public function mod($value): Decimal {}
/**
* Remainder
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
*
* @return Decimal the remainder after dividing this decimal by a given value.
*
* @throws \TypeError if the value is not a decimal, string or integer.
* @throws \DivisionByZeroError if the integer value of $value is zero.
* @throws \ArithmeticError if the operation is undefined, eg. INF, -INF
*/
public function rem($value): Decimal {}
/**
* Power
*
* This method is equivalent to the `**` operator.
*
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $exponent The power to raise this decimal to.
*
* @return Decimal the result of raising this decimal to a given power.
*
* @throws \TypeError if the exponent is not a decimal, string or integer.
*/
public function pow($exponent): Decimal {}
/**
* Natural logarithm
*
* This method is equivalent in function to PHP's `log`.
*
* @return Decimal the natural logarithm of this decimal (log base e),
* with the same precision as this decimal.
*/
public function ln(): Decimal {}
/**
* Exponent
*
* @return Decimal the exponent of this decimal, ie. e to the power of this,
* with the same precision as this decimal.
*/
public function exp(): Decimal {}
/**
* Base-10 logarithm
*
* @return Decimal the base-10 logarithm of this decimal, with the same
* precision as this decimal.
*/
public function log10(): Decimal {}
/**
* Square root
*
* @return Decimal the square root of this decimal, with the same precision
* as this decimal.
*/
public function sqrt(): Decimal {}
/**
* Floor
*
* @return Decimal the closest integer towards negative infinity.
*/
public function floor(): Decimal {}
/**
* Ceiling
*
* @return Decimal the closest integer towards positive infinity.
*/
public function ceil(): Decimal {}
/**
* Truncate
*
* @return Decimal the integer value of this decimal.
*/
public function truncate(): Decimal {}
/**
* Round
*
* @param int $places The number of places behind the decimal to round to.
* @param int $mode The rounding mode, which are constants of Decimal.
*
* @return Decimal the value of this decimal with the same precision,
* rounded according to the specified number of decimal
* places and rounding mode
*
* @throws \InvalidArgumentException if the rounding mode is not supported.
*/
public function round(int $places = 0, int $mode = Decimal::DEFAULT_ROUNDING): Decimal {}
/**
* Decimal point shift.
*
* @param int $places The number of places to shift the decimal point by.
* A positive shift moves the decimal point to the right,
* a negative shift moves the decimal point to the left.
*
* @return Decimal A copy of this decimal with its decimal place shifted.
*/
public function shift(int $places): Decimal {}
/**
* Trims trailing zeroes.
*
* @return Decimal A copy of this decimal without trailing zeroes.
*/
public function trim(): Decimal {}
/**
* Precision
*
* @return int the precision of this decimal.
*/
public function precision(): int {}
/**
* Signum
*
* @return int 0 if zero, -1 if negative, or 1 if positive.
*/
public function signum(): int {}
/**
* Parity (integer)
*
* @return int 0 if the integer value of this decimal is even, 1 if odd.
* Special numbers like NAN and INF will return 1.
*/
public function parity(): int {}
/**
* Absolute
*
* @return Decimal the absolute (positive) value of this decimal.
*/
public function abs(): Decimal {}
/**
* Negate
*
* @return Decimal the same value as this decimal, but the sign inverted.
*/
public function negate(): Decimal {}
/**
* @return bool TRUE if this decimal is an integer and even, FALSE otherwise.
*/
public function isEven(): bool {}
/**
* @return bool TRUE if this decimal is an integer and odd, FALSE otherwise.
*/
public function isOdd(): bool {}
/**
* @return bool TRUE if this decimal is positive, FALSE otherwise.
*/
public function isPositive(): bool {}
/**
* @return bool TRUE if this decimal is negative, FALSE otherwise.
*/
public function isNegative(): bool {}
/**
* @return bool TRUE if this decimal is not a defined number.
*/
public function isNaN(): bool {}
/**
* @return bool TRUE if this decimal represents infinity, FALSE otherwise.
*/
public function isInf(): bool {}
/**
* @return bool TRUE if this decimal is an integer, ie. does not have
* significant figures behind the decimal point, otherwise FALSE.
*/
public function isInteger(): bool {}
/**
* @return bool TRUE if this decimal is either positive or negative zero.
*/
public function isZero(): bool {}
/**
* @param int $places The number of places behind the decimal point.
* @param bool $commas TRUE if thousands should be separated by a comma.
* @param int $rounding
*
* @return string the value of this decimal formatted to a fixed number of
* decimal places, optionally with thousands comma-separated,
* using a given rounding mode.
*/
public function toFixed(int $places = 0, bool $commas = false, int $rounding = Decimal::DEFAULT_ROUNDING): string {}
/**
* String representation.
*
* This method is equivalent to a cast to string.
*
* This method should not be used as a canonical representation of this
* decimal, because values can be represented in more than one way. However,
* this method does guarantee that a decimal instantiated by its output with
* the same precision will be exactly equal to this decimal.
*
* @return string the value of this decimal represented exactly, in either
* fixed or scientific form, depending on the value.
*/
public function toString(): string {}
/**
* Integer representation.
*
* This method is equivalent to a cast to int.
*
* @return int the integer value of this decimal.
*
* @throws \OverflowException if the value is greater than PHP_INT_MAX.
*/
public function toInt(): int {}
/**
* Binary floating point representation.
*
* This method is equivalent to a cast to float, and is not affected by the
* 'precision' INI setting.
*
* @return float the native PHP floating point value of this decimal.
*
* @throws \OverflowException if the value is greater than PHP_FLOAT_MAX.
* @throws \UnderflowException if the value is smaller than PHP_FLOAT_MIN.
*/
public function toFloat(): float {}
/**
* Equality
*
* This method is equivalent to the `==` operator.
*
* @param mixed $other
*
* @return bool TRUE if this decimal is considered equal to the given value.
* Equal decimal values tie-break on precision.
*/
public function equals($other): bool {}
/**
* Ordering
*
* This method is equivalent to the `<=>` operator.
*
* @param mixed $other
*
* @return int 0 if this decimal is considered is equal to $other,
* -1 if this decimal should be placed before $other,
* 1 if this decimal should be placed after $other.
*/
public function compareTo($other): int {}
/**
* String representation.
*
* This method is equivalent to a cast to string, as well as `toString`.
*
* @return string the value of this decimal represented exactly, in either
* fixed or scientific form, depending on the value.
*/
public function __toString(): string {}
/**
* JSON
*
* This method is only here to honour the interface, and is equivalent to
* `toString`. JSON does not have a decimal type so all decimals are encoded
* as strings in the same format as `toString`.
*
* @return string
*/
public function jsonSerialize() {}
}

View File

@@ -0,0 +1,985 @@
<?php
// This file is the result of combining the stubs from the
// [documentation](https://www.php.net/manual/en/class.domattr.php), the stubs from
// [php-src](https://github.com/php/php-src/blob/master/ext/dom/php_dom.stub.php), the reflection-generated stubs, and
// further updates for Psalm.
const XML_ELEMENT_NODE = 1;
const XML_ATTRIBUTE_NODE = 2;
const XML_TEXT_NODE = 3;
const XML_CDATA_SECTION_NODE = 4;
const XML_ENTITY_REF_NODE = 5;
const XML_ENTITY_NODE = 6;
const XML_PI_NODE = 7;
const XML_COMMENT_NODE = 8;
const XML_DOCUMENT_NODE = 9;
const XML_DOCUMENT_TYPE_NODE = 10;
const XML_DOCUMENT_FRAG_NODE = 11;
const XML_NOTATION_NODE = 12;
const XML_HTML_DOCUMENT_NODE = 13;
const XML_DTD_NODE = 14;
const XML_ELEMENT_DECL_NODE = 15;
const XML_ATTRIBUTE_DECL_NODE = 16;
const XML_ENTITY_DECL_NODE = 17;
const XML_NAMESPACE_DECL_NODE = 18;
const XML_LOCAL_NAMESPACE = 18;
const XML_ATTRIBUTE_CDATA = 1;
const XML_ATTRIBUTE_ID = 2;
const XML_ATTRIBUTE_IDREF = 3;
const XML_ATTRIBUTE_IDREFS = 4;
const XML_ATTRIBUTE_ENTITY = 6;
const XML_ATTRIBUTE_NMTOKEN = 7;
const XML_ATTRIBUTE_NMTOKENS = 8;
const XML_ATTRIBUTE_ENUMERATION = 9;
const XML_ATTRIBUTE_NOTATION = 10;
const DOM_PHP_ERR = 0;
const DOM_INDEX_SIZE_ERR = 1;
const DOMSTRING_SIZE_ERR = 2;
const DOM_HIERARCHY_REQUEST_ERR = 3;
const DOM_WRONG_DOCUMENT_ERR = 4;
const DOM_INVALID_CHARACTER_ERR = 5;
const DOM_NO_DATA_ALLOWED_ERR = 6;
const DOM_NO_MODIFICATION_ALLOWED_ERR = 7;
const DOM_NOT_FOUND_ERR = 8;
const DOM_NOT_SUPPORTED_ERR = 9;
const DOM_INUSE_ATTRIBUTE_ERR = 10;
const DOM_INVALID_STATE_ERR = 11;
const DOM_SYNTAX_ERR = 12;
const DOM_INVALID_MODIFICATION_ERR = 13;
const DOM_NAMESPACE_ERR = 14;
const DOM_INVALID_ACCESS_ERR = 15;
const DOM_VALIDATION_ERR = 16;
final class DOMException extends Exception
{
public int $code;
}
/** @php-from 8.0 */
interface DOMParentNode
{
/**
* @param DOMNode|string ...$nodes
*/
public function append(...$nodes) : void;
/**
* @param DOMNode|string ...$nodes
*/
public function prepend(...$nodes) : void;
}
/** @php-from 8.0 */
interface DOMChildNode
{
public function remove() : void;
/**
* @param DOMNode|string ...$nodes
*/
public function before(...$nodes) : void;
/**
* @param DOMNode|string ...$nodes
*/
public function after(...$nodes) : void;
/**
* @param DOMNode|string ...$nodes
*/
public function replaceWith(...$nodes) : void;
}
class DOMImplementation
{
// Not implemented: https://github.com/php/php-src/blob/c53455ffd78179feb6f5cef180fa638890699266/ext/dom/domimplementation.c#L230
// public function getFeature(string $feature, string $version)
// {
// }
public function hasFeature(string $feature, string $version): bool {}
/**
* @return DOMDocumentType|false
* @psalm-ignore-falsable-return
*/
public function createDocumentType(string $qualifiedName, string $publicId = '', string $systemId = '') {}
/**
* @return DOMDocument|false
* @psalm-ignore-falsable-return
*/
public function createDocument(string $namespace = '', string $qualifiedName = '', DOMDocumentType $doctype = null) {}
/**
* @return DOMDocument|false
* @psalm-ignore-falsable-return
* @php-from 8.0
*/
public function createDocument(string $namespace = '', string $qualifiedName = '', ?DOMDocumentType $doctype = null) {}
/**
* @return DOMDocument|false
* @psalm-ignore-falsable-return
* @php-from 8.0.3
*/
public function createDocument(?string $namespace = null, string $qualifiedName = '', ?DOMDocumentType $doctype = null) {}
}
class DOMNode
{
/** @readonly */
public string $nodeName;
public ?string $nodeValue;
/** @readonly */
public int $nodeType;
/** @readonly */
public ?DOMNode $parentNode;
/**
* @readonly
* @var DOMNodeList<DOMNode>
*/
public DOMNodeList $childNodes;
/** @readonly */
public ?DOMNode $firstChild;
/** @readonly */
public ?DOMNode $lastChild;
/** @readonly */
public ?DOMNode $previousSibling;
/** @readonly */
public ?DOMNode $nextSibling;
/**
* @readonly
* @var DOMNamedNodeMap<DOMAttr>|null
*/
public ?DOMNamedNodeMap $attributes;
/** @readonly */
public ?DOMDocument $ownerDocument;
/** @readonly */
public ?string $namespaceURI;
public string $prefix;
/** @readonly */
public ?string $localName;
/** @readonly */
public ?string $baseURI;
public string $textContent;
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function appendChild(DOMNode $node) {}
/**
* @return string|false
* @psalm-ignore-falsable-return
*/
public function C14N(bool $exclusive = false, bool $withComments = false, ?array $xpath = null, ?array $nsPrefixes = null) {}
/**
* @return int|false
* @psalm-ignore-falsable-return
*/
public function C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, ?array $xpath = null, ?array $nsPrefixes = null) {}
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function cloneNode(bool $deep = false) {}
public function getLineNo(): int {}
public function getNodePath(): ?string {}
public function hasAttributes(): bool {}
public function hasChildNodes(): bool {}
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function insertBefore(DOMNode $node, ?DOMNode $child = null) {}
public function isDefaultNamespace(string $namespace): bool {}
public function isSameNode(DOMNode $otherNode): bool {}
public function isSupported(string $feature, string $version): bool {}
public function lookupNamespaceURI(?string $prefix): ?string {}
public function lookupPrefix(string $namespace): ?string {}
public function normalize(): void {}
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function removeChild(DOMNode $child) {}
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function replaceChild(DOMNode $node, DOMNode $child) {}
}
class DOMNameSpaceNode
{
/** @readonly */
public string $nodeName;
/** @readonly */
public ?string $nodeValue;
/** @readonly */
public int $nodeType;
/** @readonly */
public string $prefix;
/** @readonly */
public ?string $localName;
/** @readonly */
public ?string $namespaceURI;
/** @readonly */
public ?DOMDocument $ownerDocument;
/** @readonly */
public ?DOMNode $parentNode;
}
class DOMDocumentFragment extends DOMNode implements DOMParentNode
{
/** @readonly */
public ?DOMElement $firstElementChild;
/** @readonly */
public ?DOMElement $lastElementChild;
/** @readonly */
public int $childElementCount;
public function __construct() {}
public function appendXML(string $data): bool {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function append(...$nodes): void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function prepend(...$nodes): void {}
}
class DOMDocument extends DOMNode implements DOMParentNode
{
/** @readonly */
public ?DOMDocumentType $doctype;
/** @readonly */
public DOMImplementation $implementation;
/** @readonly */
public ?DOMElement $documentElement;
/**
* @deprecated
* @readonly
*/
public ?string $actualEncoding;
/**
* @var ?string
*/
public $encoding;
/** @readonly */
public ?string $xmlEncoding;
/**
* @var bool
*/
public $standalone;
/**
* @var bool
*/
public $xmlStandalone;
/**
* @var ?string
*/
public $version;
/**
* @var ?string
*/
public $xmlVersion;
/**
* @var bool
*/
public $strictErrorChecking;
/**
* @var ?string
*/
public $documentURI;
/**
* @var mixed
* @readonly
* @deprecated
*/
public $config;
/**
* @var bool
*/
public $formatOutput;
/**
* @var bool
*/
public $validateOnParse;
/**
* @var bool
*/
public $resolveExternals;
/**
* @var bool
*/
public $preserveWhiteSpace;
/**
* @var bool
*/
public $recover;
/**
* @var bool
*/
public $substituteEntities;
/** @readonly */
public ?DOMElement $firstElementChild;
/** @readonly */
public ?DOMElement $lastElementChild;
/** @readonly */
public int $childElementCount;
public function __construct(string $version = '1.0', string $encoding = '') {}
/**
* @return DOMAttr|false
* @psalm-ignore-falsable-return
*/
public function createAttribute(string $localName) {}
/**
* @return DOMAttr|false
* @psalm-ignore-falsable-return
*/
public function createAttributeNS(?string $namespace, string $qualifiedName) {}
/**
* @return DOMCdataSection|false
* @psalm-ignore-falsable-return
*/
public function createCDATASection(string $data) {}
/**
* @return DOMComment|false
* @psalm-ignore-falsable-return
*/
public function createComment(string $data) {}
/**
* @throws DOMException
* @php-from 8.1
*/
public function createComment(string $data): DOMComment {}
/**
* @return DOMDocumentFragment|false
* @psalm-ignore-falsable-return
*/
public function createDocumentFragment() {}
/**
* @throws DOMException
* @php-from 8.1
*/
public function createDocumentFragment(): DOMDocumentFragment {}
/**
* @return DOMElement|false
* @psalm-ignore-falsable-return
*/
public function createElement(string $localName, string $value = '') {}
/**
* @return DOMElement|false
* @psalm-ignore-falsable-return
*/
public function createElementNS(?string $namespace, string $qualifiedName, string $value = '') {}
/**
* @return DOMEntityReference|false
* @psalm-ignore-falsable-return
*/
public function createEntityReference(string $name) {}
/**
* @return DOMProcessingInstruction|false
* @psalm-ignore-falsable-return
*/
public function createProcessingInstruction(string $target, string $data = '') {}
/**
* @return DOMText|false
* @psalm-ignore-falsable-return
*/
public function createTextNode(string $data) {}
/**
* @throws DOMException
* @php-from 8.1
*/
public function createTextNode(string $data): DOMText {}
public function getElementById(string $elementId): ?DOMElement {}
/** @return DOMNodeList<DOMElement> */
public function getElementsByTagName(string $qualifiedName): DOMNodeList {}
/** @return DOMNodeList<DOMElement> */
public function getElementsByTagNameNS(string $namespace, string $localName): DOMNodeList {}
/**
* @return DOMNodeList<DOMElement>
* @php-from 8.0.3
*/
public function getElementsByTagNameNS(?string $namespace, string $localName): DOMNodeList {}
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function importNode(DOMNode $node, bool $deep = false) {}
/**
* @return DOMDocument|false
* @psalm-ignore-falsable-return
**/
public function load(string $filename, int $options = 0) {}
/**
* @return DOMDocument|false
* @psalm-ignore-falsable-return
*/
public function loadXML(string $source, int $options = 0) {}
public function normalizeDocument(): void {}
public function registerNodeClass(string $baseClass, ?string $extendedClass): bool {}
/**
* @return int|false
* @psalm-ignore-falsable-return
*/
public function save(string $filename, int $options = 0) {}
/** @return DOMDocument|bool */
public function loadHTML(string $source, int $options = 0) {}
/** @return DOMDocument|bool */
public function loadHTMLFile(string $filename, int $options = 0) {}
/**
* @return string|false
* @psalm-ignore-falsable-return
*/
public function saveHTML(?DOMNode $node = null) {}
/**
* @return int|false
* @psalm-ignore-falsable-return
*/
public function saveHTMLFile(string $filename) {}
/**
* @return string|false
* @psalm-ignore-falsable-return
*/
public function saveXML(?DOMNode $node = null, int $options = 0) {}
public function schemaValidate(string $filename, int $flags = 0): bool {}
public function schemaValidateSource(string $source, int $flags = 0): bool {}
public function relaxNGValidate(string $filename): bool {}
public function relaxNGValidateSource(string $source): bool {}
public function validate(): bool {}
/**
* @return int|false
* @psalm-ignore-falsable-return
*/
public function xinclude(int $options = 0) {}
/**
* @return DOMNode|false
* @psalm-ignore-falsable-return
*/
public function adoptNode(DOMNode $node) {}
/**
* @return DOMNode|string ...$nodes
* @php-from 8.0
*/
public function append(...$nodes) : void {}
/**
* @return DOMNode|string ...$nodes
* @php-from 8.0
*/
public function prepend(...$nodes) : void {}
}
/**
* @template-covariant TNode as DOMNode
* @template-implements Traversable<int, TNode>
*/
class DOMNodeList implements Traversable
{
/** @readonly */
public int $length;
/**
* @return TNode|null
* @psalm-ignore-nullable-return
*/
public function item(int $index) {}
}
/**
* @template-covariant TNode as DOMNode
* @template-implements Traversable<int, TNode>
*
* @php-from 7.2
*/
class DOMNodeList implements Traversable, Countable
{
/** @readonly */
public int $length;
public function count(): int {}
/**
* @return TNode|null
* @psalm-ignore-nullable-return
*/
public function item(int $index) {}
}
/**
* @template-covariant TNode as DOMNode
* @template-implements IteratorAggregate<int, TNode>
*
* @php-from 8.0
*/
class DOMNodeList implements IteratorAggregate, Countable
{
/** @readonly */
public int $length;
public function count(): int {}
/** @return Iterator<int, TNode> */
public function getIterator() : Iterator {}
/**
* @return TNode|null
* @psalm-ignore-nullable-return
*/
public function item(int $index) {}
}
/**
* @template-covariant TNode as DOMNode
* @template-implements Traversable<string, TNode>
*/
class DOMNamedNodeMap implements Traversable, Countable
{
/** @readonly */
public int $length;
/** @return TNode|null */
public function getNamedItem(string $qualifiedName): ?DOMNode {}
/** @return TNode|null */
public function getNamedItemNS(?string $namespace, string $localName): ?DOMNode {}
/**
* @return TNode|null
* @psalm-ignore-nullable-return
*/
public function item(int $index): ?DOMNode {}
public function count(): int {}
}
/**
* @template-covariant TNode as DOMNode
* @template-implements IteratorAggregate<string, TNode>
*
* @php-from 8.0
*/
class DOMNamedNodeMap implements IteratorAggregate, Countable
{
/** @readonly */
public int $length;
/** @return TNode|null */
public function getNamedItem(string $qualifiedName): ?DOMNode {}
/** @return TNode|null */
public function getNamedItemNS(?string $namespace, string $localName): ?DOMNode {}
/**
* @return TNode|null
* @psalm-ignore-nullable-return
*/
public function item(int $index): ?DOMNode {}
public function count(): int {}
/** @return Iterator<string, TNode> */
public function getIterator() : Iterator {}
}
class DOMCharacterData extends DOMNode implements DOMChildNode
{
public string $data;
/** @readonly */
public int $length;
/** @readonly */
public ?DOMElement $previousElementSibling;
/** @readonly */
public ?DOMElement $nextElementSibling;
public function appendData(string $data): bool {}
/**
* @return string|false
* @psalm-ignore-falsable-return
*/
public function substringData(int $offset, int $count) {}
public function insertData(int $offset, string $data): bool {}
public function deleteData(int $offset, int $count): bool {}
public function replaceData(int $offset, int $count, string $data): bool {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function replaceWith(...$nodes) : void {}
/** @php-from 8.0 */
public function remove() : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function before(...$nodes) : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function after(...$nodes) : void {}
}
class DOMAttr extends DOMNode
{
/** @readonly */
public string $name;
/** @readonly */
public bool $specified;
public string $value;
/** @readonly */
public ?DOMElement $ownerElement;
/** @readonly */
public mixed $schemaTypeInfo;
/**
* Inherited from DOMNode, but always non-null
* @readonly
*/
public string $localName;
public function __construct(string $name, string $value = '') {}
public function isId(): bool {}
}
class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode
{
/** @readonly */
public string $tagName;
/** @readonly */
public mixed $schemaTypeInfo;
/** @readonly */
public ?DOMElement $firstElementChild;
/** @readonly */
public ?DOMElement $lastElementChild;
/** @readonly */
public int $childElementCount;
/** @readonly */
public ?DOMElement $previousElementSibling;
/** @readonly */
public ?DOMElement $nextElementSibling;
/**
* Inherited from DOMNode, but always non-null.
*
* @readonly
* @var DOMNamedNodeMap<DOMAttr>
*/
public DOMNamedNodeMap $attributes;
/**
* Inherited from DOMNode, but always non-null
* @readonly
*/
public string $localName;
public function __construct(string $qualifiedName, ?string $value = null, string $namespace = '') {}
public function getAttribute(string $qualifiedName): string {}
public function getAttributeNS(?string $namespace, string $localName): string {}
/**
* @return DOMAttr|DOMNameSpaceNode|false
* @psalm-ignore-falsable-return
*/
public function getAttributeNode(string $qualifiedName) {}
/**
* @return DOMAttr|DOMNameSpaceNode|false
* @psalm-ignore-falsable-return
*/
public function getAttributeNodeNS(?string $namespace, string $localName) {}
/** @return DOMNodeList<DOMElement> */
public function getElementsByTagName(string $qualifiedName): DOMNodeList {}
/** @return DOMNodeList<DOMElement> */
public function getElementsByTagNameNS(string $namespace, string $localName): DOMNodeList {}
/**
* @return DOMNodeList<DOMElement>
* @php-from 8.0.3
*/
public function getElementsByTagNameNS(?string $namespace, string $localName): DOMNodeList {}
public function hasAttribute(string $qualifiedName): bool {}
public function hasAttributeNS(?string $namespace, string $localName): bool {}
public function removeAttribute(string $qualifiedName): bool {}
public function removeAttributeNS(?string $namespace, string $localName): void {}
/**
* @return DOMAttr|false
* @psalm-ignore-falsable-return
*/
public function removeAttributeNode(DOMAttr $attr) {}
/**
* @return DOMAttr|false
* @psalm-ignore-falsable-return
*/
public function setAttribute(string $qualifiedName, string $value) {}
public function setAttributeNS(?string $namespace, string $qualifiedName, string $value): void {}
/**
* @return DOMAttr|null|false
* @psalm-ignore-falsable-return
*/
public function setAttributeNode(DOMAttr $attr) {}
/**
* @return DOMAttr|null|false
* @psalm-ignore-falsable-return
*/
public function setAttributeNodeNS(DOMAttr $attr) {}
public function setIdAttribute(string $qualifiedName, bool $isId): void {}
public function setIdAttributeNS(string $namespace, string $qualifiedName, bool $isId): void {}
public function setIdAttributeNode(DOMAttr $attr, bool $isId): void {}
/** @php-from 8.0 */
public function remove() : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function before(...$nodes) : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function after(...$nodes) : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function replaceWith(...$nodes) : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function append(...$nodes) : void {}
/**
* @param DOMNode|string ...$nodes
* @php-from 8.0
*/
public function prepend(...$nodes) : void {}
}
class DOMText extends DOMCharacterData
{
/** @readonly */
public string $wholeText;
public function __construct(string $data = '') {}
public function isWhitespaceInElementContent(): bool {}
/**
* @alias DOMText::isWhitespaceInElementContent
*/
public function isElementContentWhitespace(): bool {}
/**
* @return DOMText|false
* @psalm-ignore-falsable-return
*/
public function splitText(int $offset) {}
}
class DOMComment extends DOMCharacterData
{
public function __construct(string $data = '') {}
}
class DOMCdataSection extends DOMText
{
public function __construct(string $data) {}
}
class DOMDocumentType extends DOMNode
{
/** @readonly */
public string $name;
/** @readonly */
public DOMNamedNodeMap $entities;
/** @readonly */
public DOMNamedNodeMap $notations;
/** @readonly */
public string $publicId;
/** @readonly */
public string $systemId;
/** @readonly */
public ?string $internalSubset;
}
class DOMNotation extends DOMNode
{
/** @readonly */
public string $publicId;
/** @readonly */
public string $systemId;
}
class DOMEntity extends DOMNode
{
/** @readonly */
public ?string $publicId;
/** @readonly */
public ?string $systemId;
/** @readonly */
public ?string $notationName;
/**
* @readonly
* @deprecated
*/
public ?string $actualEncoding;
/**
* @readonly
* @deprecated
*/
public ?string $encoding;
/**
* @readonly
* @deprecated
*/
public ?string $version;
}
class DOMEntityReference extends DOMNode
{
public function __construct(string $name) {}
}
class DOMProcessingInstruction extends DOMNode
{
/** @readonly */
public string $target;
public string $data;
public function __construct(string $name, string $value = '') {}
}
class DOMXPath
{
/** @readonly */
public DOMDocument $document;
public bool $registerNodeNamespaces;
public function __construct(DOMDocument $document, bool $registerNodeNS = true) {}
public function evaluate(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed {}
/**
* @return DOMNodeList<DOMNode>|false
*/
public function query(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed {}
public function registerNamespace(string $prefix, string $namespace): bool {}
public function registerPhpFunctions(string|array|null $restrict = null): void {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,451 @@
<?php
namespace {
/**
* @since 7.4.0
*/
final class FFI
{
public static function cdef(string $code = "", ?string $lib = null): FFI
{
}
public static function load(string $filename): ?FFI
{
}
public static function scope(string $name): FFI
{
}
/**
* @param \FFI\CType|string $type
*/
public static function new($type, bool $owned = true, bool $persistent = false): ?\FFI\CData
{
}
public static function free(\FFI\CData $ptr): void
{
}
/**
* @param \FFI\CType $type
* @param \FFI\CData|int|float|bool|null $ptr
*/
public static function cast($type, &$ptr): ?\FFI\CData
{
}
public static function type(string $type): ?\FFI\CType
{
}
public static function typeof(\FFI\CData $ptr): \FFI\CType
{
}
/**
* @param array<int<0,max>> $dimensions
*/
public static function arrayType(\FFI\CType $type, array $dimensions): \FFI\CType
{
}
public static function addr(\FFI\CData $ptr): \FFI\CData
{
}
/**
* @param \FFI\CData|\FFI\CType $ptr
* @return int<0,max>
*/
public static function sizeof($ptr): int
{
}
/**
* @param \FFI\CData|\FFI\CType $ptr
* @return positive-int
*/
public static function alignof($ptr): int
{
}
/**
* @param \FFI\CData|string $from
* @param int<0,max> $size
*/
public static function memcpy(\FFI\CData $to, $from, int $size): void
{
}
/**
* @param string|\FFI\CData $ptr1
* @param string|\FFI\CData $ptr2
* @param int<0,max> $size
*/
public static function memcmp(&$ptr1, &$ptr2, int $size): int
{
}
/**
* @param int<0,max> $size
*/
public static function memset(\FFI\CData $ptr, int $value, int $size): void
{
}
/**
* @param int<0,max>|null $size
*/
public static function string(\FFI\CData $ptr, ?int $size = null): string
{
}
public static function isNull(\FFI\CData $ptr): bool
{
}
}
}
namespace FFI {
/**
* @since 7.4.0
*/
final class CData
{
}
/**
* @since 7.4.0
*/
final class CType
{
/**
* @since 8.1
*/
public const TYPE_VOID = 0;
/**
* @since 8.1
*/
public const TYPE_FLOAT = 1;
/**
* @since 8.1
*/
public const TYPE_DOUBLE = 2;
/**
* @since 8.1
*/
public const TYPE_LONGDOUBLE = 3;
/**
* @since 8.1
*/
public const TYPE_UINT8 = 4;
/**
* @since 8.1
*/
public const TYPE_SINT8 = 5;
/**
* @since 8.1
*/
public const TYPE_UINT16 = 6;
/**
* @since 8.1
*/
public const TYPE_SINT16 = 7;
/**
* @since 8.1
*/
public const TYPE_UINT32 = 8;
/**
* @since 8.1
*/
public const TYPE_SINT32 = 9;
/**
* @since 8.1
*/
public const TYPE_UINT64 = 10;
/**
* @since 8.1
*/
public const TYPE_SINT64 = 11;
/**
* @since 8.1
*/
public const TYPE_ENUM = 12;
/**
* @since 8.1
*/
public const TYPE_BOOL = 13;
/**
* @since 8.1
*/
public const TYPE_CHAR = 14;
/**
* @since 8.1
*/
public const TYPE_POINTER = 15;
/**
* @since 8.1
*/
public const TYPE_FUNC = 16;
/**
* @since 8.1
*/
public const TYPE_ARRAY = 17;
/**
* @since 8.1
*/
public const TYPE_STRUCT = 18;
/**
* @since 8.1
*/
public const ATTR_CONST = 1;
/**
* @since 8.1
*/
public const ATTR_INCOMPLETE_TAG = 2;
/**
* @since 8.1
*/
public const ATTR_VARIADIC = 4;
/**
* @since 8.1
*/
public const ATTR_INCOMPLETE_ARRAY = 8;
/**
* @since 8.1
*/
public const ATTR_VLA = 16;
/**
* @since 8.1
*/
public const ATTR_UNION = 32;
/**
* @since 8.1
*/
public const ATTR_PACKED = 64;
/**
* @since 8.1
*/
public const ATTR_MS_STRUCT = 128;
/**
* @since 8.1
*/
public const ATTR_GCC_STRUCT = 256;
/**
* @since 8.1
*/
public const ABI_DEFAULT = 0;
/**
* @since 8.1
*/
public const ABI_CDECL = 1;
/**
* @since 8.1
*/
public const ABI_FASTCALL = 2;
/**
* @since 8.1
*/
public const ABI_THISCALL = 3;
/**
* @since 8.1
*/
public const ABI_STDCALL = 4;
/**
* @since 8.1
*/
public const ABI_PASCAL = 5;
/**
* @since 8.1
*/
public const ABI_REGISTER = 6;
/**
* @since 8.1
*/
public const ABI_MS = 7;
/**
* @since 8.1
*/
public const ABI_SYSV = 8;
/**
* @since 8.1
*/
public const ABI_VECTORCALL = 9;
public function getName(): string
{
}
/**
* @since 8.1.0
* @return self::TYPE_*
*/
public function getKind(): int
{
}
/**
* @since 8.1.0
* @return int<0,max>
*/
public function getSize(): int
{
}
/**
* @since 8.1.0
* @return int<0,max>
*/
public function getAlignment(): int
{
}
/**
* @since 8.1.0
*/
public function getAttributes(): int
{
}
/**
* @since 8.1.0
* @return self::TYPE_UINT32|self::TYPE_UINT64
*/
public function getEnumKind(): int
{
}
/**
* @since 8.1.0
*/
public function getArrayElementType(): CType
{
}
/**
* @since 8.1.0
* @return int<0,max>
*/
public function getArrayLength(): int
{
}
/**
* @since 8.1.0
*/
public function getPointerType(): CType
{
}
/**
* @since 8.1.0
* @return string[]
*/
public function getStructFieldNames(): array
{
}
/**
* @since 8.1.0
* @return int<0,max>
*/
public function getStructFieldOffset(string $name): int
{
}
/**
* @since 8.1.0
*/
public function getStructFieldType(string $name): CType
{
}
/**
* @since 8.1.0
* @return self::ABI_*
*/
public function getFuncABI(): int
{
}
/**
* @since 8.1.0
*/
public function getFuncReturnType(): CType
{
}
/**
* @since 8.1.0
* @return int<0,max>
*/
public function getFuncParameterCount(): int
{
}
/**
* @param int<0,max> $index
* @since 8.1.0
*/
public function getFuncParameterType(int $index): CType
{
}
}
/**
* @since 7.4.0
*/
class Exception extends \Error
{
}
/**
* @since 7.4.0
*/
final class ParserException extends Exception
{
}
}

View File

@@ -0,0 +1,25 @@
<?php
define('GEOSBUF_CAP_ROUND', 1);
define('GEOSBUF_CAP_FLAT', 2);
define('GEOSBUF_CAP_SQUARE', 3);
define('GEOSBUF_JOIN_ROUND', 1);
define('GEOSBUF_JOIN_MITRE', 2);
define('GEOSBUF_JOIN_BEVEL', 3);
define('GEOS_POINT', 0);
define('GEOS_LINESTRING', 1);
define('GEOS_LINEARRING', 2);
define('GEOS_POLYGON', 3);
define('GEOS_MULTIPOINT', 4);
define('GEOS_MULTILINESTRING', 5);
define('GEOS_MULTIPOLYGON', 6);
define('GEOS_GEOMETRYCOLLECTION', 7);
define('GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE', 1);
define('GEOSRELATE_BNR_MOD2', 1);
define('GEOSRELATE_BNR_OGC', 1);
define('GEOSRELATE_BNR_ENDPOINT', 2);
define('GEOSRELATE_BNR_MULTIVALENT_ENDPOINT', 3);
define('GEOSRELATE_BNR_MONOVALENT_ENDPOINT', 4);

View File

@@ -0,0 +1,11 @@
<?php
class GMP implements Serializable {
private function __construct() {}
public function __toString(): string {}
public function serialize(): string {}
public function unserialize(string $data): void {}
}

View File

@@ -0,0 +1,59 @@
<?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() {}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* @template TValue
*
* @template-implements Traversable<int, TValue>
*/
class mysqli_result implements Traversable
{
/**
* @psalm-taint-sink callable $class
*
* @template T of object
* @param class-string<T> $class
* @param array $constructor_args
* @return T|null|false
*/
function fetch_object(string $class = stdClass::class, array $constructor_args = []): object|false|null {}
}
/**
* @psalm-taint-sink callable $class
*
* @template T of object
* @template TValue
*
* @param mysqli_result<TValue> $result
* @param class-string<T> $class
* @param array $constructor_args
* @return T|null|false
*/
function mysqli_fetch_object(mysqli_result $result, string $class = stdClass::class, array $constructor_args = []): object|false|null {}

View File

@@ -0,0 +1,158 @@
<?php
class PDO
{
public const PARAM_NULL = 0;
public const PARAM_INT = 1;
public const PARAM_STR = 2;
public const PARAM_LOB = 3;
public const PARAM_STMT = 4;
public const PARAM_BOOL = 5;
// public const PARAM_STR_NATL = 1073741824; since 7.2
// public const PARAM_STR_CHAR = 536870912; since 7.2
public const PARAM_INPUT_OUTPUT = 2147483648;
// public const FETCH_DEFAULT = 0; since 8.0.7
public const FETCH_LAZY = 1;
public const FETCH_ASSOC = 2;
public const FETCH_NAMED = 11;
public const FETCH_NUM = 3;
public const FETCH_BOTH = 4;
public const FETCH_OBJ = 5;
public const FETCH_BOUND = 6;
public const FETCH_COLUMN = 7;
public const FETCH_CLASS = 8;
public const FETCH_INTO = 9;
public const FETCH_FUNC = 10;
public const FETCH_GROUP = 65536;
public const FETCH_UNIQUE = 196608;
public const FETCH_KEY_PAIR = 12;
public const FETCH_CLASSTYPE = 262144;
public const FETCH_SERIALIZE = 524288; // Deprecated 8.1
public const FETCH_PROPS_LATE = 1048576;
public const ATTR_AUTOCOMMIT = 0;
public const ATTR_PREFETCH = 1;
public const ATTR_TIMEOUT = 2;
public const ATTR_ERRMODE = 3;
public const ATTR_SERVER_VERSION = 4;
public const ATTR_CLIENT_VERSION = 5;
public const ATTR_SERVER_INFO = 6;
public const ATTR_CONNECTION_STATUS = 7;
public const ATTR_CASE = 8;
public const ATTR_CURSOR_NAME = 9;
public const ATTR_CURSOR = 10;
public const ATTR_DRIVER_NAME = 16;
public const ATTR_ORACLE_NULLS = 11;
public const ATTR_PERSISTENT = 12;
public const ATTR_STATEMENT_CLASS = 13;
public const ATTR_FETCH_CATALOG_NAMES = 15;
public const ATTR_FETCH_TABLE_NAMES = 14;
public const ATTR_STRINGIFY_FETCHES = 17;
public const ATTR_MAX_COLUMN_LEN = 18;
public const ATTR_DEFAULT_FETCH_MODE = 19;
public const ATTR_EMULATE_PREPARES = 20;
// public const ATTR_DEFAULT_STR_PARAM = 21; since 7.2
public const ERRMODE_SILENT = 0;
public const ERRMODE_WARNING = 1;
public const ERRMODE_EXCEPTION = 2;
public const CASE_NATURAL = 0;
public const CASE_LOWER = 2;
public const CASE_UPPER = 1;
public const NULL_NATURAL = 0;
public const NULL_EMPTY_STRING = 1;
public const NULL_TO_STRING = 2;
public const FETCH_ORI_NEXT = 0;
public const FETCH_ORI_PRIOR = 1;
public const FETCH_ORI_FIRST = 2;
public const FETCH_ORI_LAST = 3;
public const FETCH_ORI_ABS = 4;
public const FETCH_ORI_REL = 5;
public const CURSOR_FWDONLY = 0;
public const CURSOR_SCROLL = 1;
public const ERR_NONE = 00000;
public const PARAM_EVT_ALLOC = 0;
public const PARAM_EVT_FREE = 1;
public const PARAM_EVT_EXEC_PRE = 2;
public const PARAM_EVT_EXEC_POST = 3;
public const PARAM_EVT_FETCH_PRE = 4;
public const PARAM_EVT_FETCH_POST = 5;
public const PARAM_EVT_NORMALIZE = 6;
// public const SQLITE_DETERMINISTIC = ???; since 7.1.4 with pdo_sqlite
public function __construct(
string $dsn,
?string $username = null,
?string $password = null,
?array $options = null
) {}
public function beginTransaction(): bool {}
public function commit(): bool {}
public function errorCode(): ?string {}
public function errorInfo(): array {}
/**
* @psalm-taint-sink sql $statement
*
* @return int|false
*/
public function exec(string $statement) {}
/** @return bool|int|string|array|null */
public function getAttribute(int $attribute) {}
public static function getAvailableDrivers(): array {}
public function inTransaction(): bool {}
/** @return string|false */
public function lastInsertId(?string $name = null) {}
/**
* @psalm-taint-sink sql $query
*
* @return PDOStatement|false
*/
public function prepare(string $query, array $options = []) {}
/**
* @psalm-taint-sink sql $query
*
* @return PDOStatement|false
*/
public function query(string $query, ?int $fetchMode = null) {}
/**
* @return string|false
*/
public function quote(string $string, int $type = PDO::PARAM_STR) {}
public function rollBack(): bool {}
public function setAttribute(int $attribute, mixed $value): bool {}
}
/**
* @template TValue
*
* @template-implements Traversable<int, TValue>
*/
class PDOStatement implements Traversable
{
/**
* @psalm-taint-sink callable $class
*
* @template T of object
* @param class-string<T> $class
* @param array $ctorArgs
* @return false|T
*/
public function fetchObject($class = \stdclass::class, array $ctorArgs = array()) {}
}
class PDOException extends RuntimeException {
protected string $code;
public ?array $errorInfo = null;
}

View File

@@ -0,0 +1,112 @@
<?php
/**
* PHP 8.2 introduces a new PHP extension named "random".
* @see https://github.com/php/php-src/blob/master/ext/random/random.stub.php
* @see https://php.watch/versions/8.2/ext-random
*/
namespace Random\Engine
{
final class Mt19937 implements \Random\Engine
{
public function __construct(int|null $seed = null, int $mode = MT_RAND_MT19937) {}
/** @return non-empty-string */
public function generate(): string {}
public function __serialize(): array {}
public function __unserialize(array $data): void {}
public function __debugInfo(): array {}
}
final class PcgOneseq128XslRr64 implements \Random\Engine
{
public function __construct(string|int|null $seed = null) {}
public function generate(): string {}
public function jump(int $advance): void {}
public function __serialize(): array {}
public function __unserialize(array $data): void {}
public function __debugInfo(): array {}
}
final class Xoshiro256StarStar implements \Random\Engine
{
public function __construct(string|int|null $seed = null) {}
public function generate(): string {}
public function jump(): void {}
public function jumpLong(): void {}
public function __serialize(): array {}
public function __unserialize(array $data): void {}
public function __debugInfo(): array {}
}
final class Secure implements \Random\CryptoSafeEngine
{
public function generate(): string {}
}
}
namespace Random
{
interface Engine
{
public function generate(): string;
}
interface CryptoSafeEngine extends Engine
{
}
final class Randomizer
{
public readonly Engine $engine;
public function __construct(?Engine $engine = null) {}
public function nextInt(): int {}
public function getInt(int $min, int $max): int {}
/**
* @param positive-int $length
* @return non-empty-string
*/
public function getBytes(int $length): string {}
public function shuffleArray(array $array): array {}
public function shuffleBytes(string $bytes): string {}
public function pickArrayKeys(array $array, int $num): array {}
public function __serialize(): array {}
public function __unserialize(array $data): void {}
}
class RandomError extends \Error
{
}
class BrokenRandomEngineError extends RandomError
{
}
class RandomException extends \Exception
{
}
}

View File

@@ -0,0 +1,556 @@
<?php
/**
* @see https://github.com/phpredis/phpredis/blob/develop/redis.stub.php
* @see https://github.com/phpredis/phpredis/blob/develop/redis_array.stub.php
* @see https://github.com/phpredis/phpredis/blob/develop/redis_cluster.stub.php
* @see https://github.com/phpredis/phpredis/blob/develop/redis_sentinel.stub.php
*/
class Redis {
public function __construct(array $options = null) {}
public function _compress(string $value): string {}
public function __destruct() {}
public function _pack(mixed $value): string {}
public function _prefix(string $key): string {}
public function _serialize(mixed $value): string {}
public function _uncompress(string $value): string {}
public function _unpack(string $value): mixed {}
public function _unserialize(string $value): mixed {}
/**
* @param string $args
* @return mixed|Redis
*/
public function acl(string $subcmd, ...$args) {}
/** @return false|int|Redis */
public function append(string $key, string $value) {}
public function auth(mixed $credentials): bool {}
public function bgSave(): bool {}
public function bgrewriteaof(): bool {}
/** @return false|int|Redis */
public function bitcount(string $key, int $start = 0, int $end = -1) {}
/**
* @return false|int|Redis
*/
public function bitop(string $operation, string $deskey, string $srckey, string ...$other_keys): int {}
/** @return false|int|Redis */
public function bitpos(string $key, int $bit, int $start = 0, int $end = -1) {}
public function blPop(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array|null|false {}
public function brPop(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array|null|false {}
public function brpoplpush(string $src, string $dst, int $timeout): Redis|string|false {}
public function bzPopMax(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array|false {}
public function bzPopMin(string|array $key, string|int $timeout_or_key, mixed ...$extra_args): array|false {}
public function clearLastError(): bool {}
public function client(string $opt, string $arg = null): mixed {}
public function close(): bool {}
public function command(string $opt = null, string|array $arg): mixed {}
public function config(string $operation, string $key, mixed $value = null): mixed {}
public function connect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array $context = null): bool {}
public function copy(string $src, string $dst, array $options = null): bool {}
public function dbSize(): int {}
public function debug(string $key): string {}
/** @return false|int|Redis */
public function decr(string $key, int $by = 1) {}
/** @return false|int|Redis */
public function decrBy(string $key, int $value) {}
/**
* @return false|int|Redis
*/
public function del(array|string $key, string ...$other_keys) {}
/**
* @deprecated
* @alias Redis::del
* @return false|int|Redis
*/
public function delete(array|string $key, string ...$other_keys) {}
public function discard(): bool {}
public function dump(string $key): string {}
/** @return false|string|Redis */
public function echo(string $str) {}
public function eval(string $script, array $keys = null, int $num_keys = 0): mixed {}
public function evalsha(string $sha1, array $keys = null, int $num_keys = 0): mixed {}
public function exec(): Redis|array|false {}
/** @return int|Redis|bool */
public function exists(mixed $key, mixed ...$other_keys) {}
public function expire(string $key, int $timeout): Redis|bool {}
public function expireAt(string $key, int $timestamp): Redis|bool {}
public function flushAll(bool $async = false): bool {}
public function flushDB(bool $async = false): bool {}
public function geoadd(string $key, float $lng, float $lat, string $member, mixed ...$other_triples): int {}
public function geodist(string $key, string $src, string $dst, ?string $unit = null): Redis|float|false {}
public function geohash(string $key, string $member, string ...$other_members): array|false {}
public function geopos(string $key, string $member, string ...$other_members): Redis|array|false {}
public function georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): Redis|mixed|false {}
public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): Redis|mixed|false {}
public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): Redis|mixed|false {}
public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): Redis|mixed|false {}
public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false {}
public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false {}
/** @return false|string|Redis */
public function get(string $key) {}
public function getAuth(): mixed {}
/** @return false|int|Redis */
public function getBit(string $key, int $idx) {}
public function getDBNum(): int {}
public function getHost(): string {}
public function getLastError(): ?string {}
public function getMode(): int {}
public function getOption(int $option): mixed {}
public function getPersistentID(): ?string {}
public function getPort(): int {}
/** @return false|string|Redis */
public function getRange(string $key, int $start, int $end) {}
public function getReadTimeout(): int {}
/** @return false|string|Redis */
public function getset(string $key, string $value) {}
public function getTimeout(): int {}
public function hDel(string $key, string $member, string ...$other_members): Redis|int|false {}
public function hExists(string $key, string $member): Redis|bool {}
public function hGet(string $key, string $member): Redis|mixed|false {}
public function hGetAll(string $key): Redis|array|false {}
public function hIncrBy(string $key, string $member, int $value): Redis|int|false {}
public function hIncrByFloat(string $key, string $member, float $value): Redis|float|false {}
public function hKeys(string $key): Redis|array|false {}
public function hLen(string $key): Redis|int|false {}
public function hMget(string $key, array $keys): Redis|array|false {}
public function hMset(string $key, array $keyvals): Redis|bool|false {}
public function hSet(string $key, string $member, string $value): Redis|int|false {}
public function hSetNx(string $key, string $member, string $value): Redis|bool {}
public function hStrLen(string $key, string $member): int {}
public function hVals(string $key): Redis|array|false {}
public function hscan(string $key, ?int &$iterator, ?string $pattern = null, int $count = 0): bool|array {}
/** @return false|int|Redis */
public function incr(string $key, int $by = 1) {}
/** @return false|int|Redis */
public function incrBy(string $key, int $value) {}
/** @return false|int|Redis */
public function incrByFloat(string $key, float $value) {}
public function info(string $opt = null): Redis|array|false {}
public function isConnected(): bool {}
/** @return false|array|Redis */
public function keys(string $pattern) {}
/**
* @param mixed $elements
* @return false|int|Redis
*/
public function lInsert(string $key, string $pos, mixed $pivot, mixed $value) {}
public function lLen(string $key): Redis|int|false {}
public function lMove(string $src, string $dst, string $wherefrom, string $whereto): string {}
/** @return false|string|Redis */
public function lPop(string $key) {}
/**
* @param mixed $elements
* @return false|int|Redis
*/
public function lPush(string $key, ...$elements) {}
/**
* @param mixed $elements
* @return false|int|Redis
*/
public function rPush(string $key, ...$elements) {}
/** @return false|int|Redis */
public function lPushx(string $key, string $value) {}
/** @return false|int|Redis */
public function rPushx(string $key, string $value) {}
public function lSet(string $key, int $index, string $value): Redis|bool {}
public function lastSave(): int {}
public function lindex(string $key, int $index): Redis|mixed|false {}
public function lrange(string $key, int $start , int $end): Redis|array|false {}
/**
* @return int|Redis|false
*/
public function lrem(string $key, string $value, int $count = 0) {}
public function ltrim(string $key, int $start , int $end): Redis|bool {}
/** @return false|list<false|string>|Redis */
public function mget(array $keys) {}
public function migrate(string $host, int $port, string $key, string $dst, int $timeout, bool $copy = false, bool $replace = false): bool {}
public function move(string $key, int $index): bool {}
/**
* @param array<string, string>
*/
public function mset($key_values): Redis|bool {}
/**
* @param array<string, string>
*/
public function msetnx($key_values): Redis|bool {}
public function multi(int $value = Redis::MULTI): bool|Redis {}
public function object(string $subcommand, string $key): Redis|int|string|false {}
/**
* @deprecated
* @alias Redis::connect
*/
public function open(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool {}
public function pconnect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool {}
public function persist(string $key): bool {}
public function pexpire(string $key, int $timeout): bool {}
public function pexpireAt(string $key, int $timestamp): bool {}
public function pfadd(string $key, array $elements): int {}
public function pfcount(string $key): int {}
public function pfmerge(string $dst, array $keys): bool {}
/** @return false|string|Redis */
public function ping(string $key = NULL) {}
public function pipeline(): bool|Redis {}
/**
* @deprecated
* @alias Redis::pconnect
*/
public function popen(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool {}
/** @return bool|Redis */
public function psetex(string $key, int $expire, string $value) {}
public function psubscribe(array $patterns): void {}
public function pttl(string $key): Redis|int|false {}
public function publish(string $channel, string $message): mixed {}
public function pubsub(string $command, mixed $arg = null): mixed {}
public function punsubscribe(array $patterns): array|false {}
/** @return false|string|Redis */
public function rPop(string $key) {}
/** @return false|string|Redis */
public function randomKey() {}
public function rawcommand(string $command, mixed ...$args): mixed {}
/** @return bool|Redis */
public function rename(string $key_src, string $key_dst) {}
/** @return bool|Redis */
public function renameNx(string $key_src, string $key_dst) {}
public function restore(string $key, int $timeout, string $value): bool {}
public function role(): mixed {}
public function rpoplpush(string $src, string $dst): Redis|string|false {}
public function sAdd(string $key, string $value, mixed ...$other_values): Redis|int|false {}
public function sAddArray(string $key, array $values): int {}
public function sDiff(string $key, string ...$other_keys): Redis|array|false {}
public function sDiffStore(string $dst, string $key, string ...$other_keys): Redis|int|false {}
public function sInter(array|string $key, string ...$other_keys): Redis|array|false {}
public function sInterStore(array|string $key, string ...$other_keys): Redis|int|false {}
public function sMembers(string $key): Redis|array|false {}
public function sMisMember(string $key, string $member, string ...$other_members): array|false {}
public function sMove(string $src, string $dst, string $value): Redis|bool {}
public function sPop(string $key, int $count = 0): Redis|string|array|false {}
public function sRandMember(string $key, int $count = 0): Redis|string|array|false {}
public function sUnion(string $key, string ...$other_keys): Redis|array|false {}
public function sUnionStore(string $dst, string $key, string ...$other_keys): Redis|int|false {}
public function save(): bool {}
public function scan(?int &$iterator, ?string $pattern = null, int $count = 0, string $type = NULL): array|false {}
public function scard(string $key): Redis|int|false {}
public function script(string $command, mixed ...$args): mixed {}
public function select(int $db): bool {}
/** @return bool|Redis */
public function set(string $key, string $value, mixed $opt = NULL) {}
/** @return false|int|Redis */
public function setBit(string $key, int $idx, bool $value) {}
/** @return false|int|Redis */
public function setRange(string $key, int $start, string $value) {}
public function setOption(int $option, mixed $value): bool {}
/** @return bool|Redis */
public function setex(string $key, int $expire, string $value) {}
/** @return bool|array|Redis */
public function setnx(string $key, string $value) {}
public function sismember(string $key, string $value): Redis|bool {}
public function slaveof(string $host = null, int $port = 6379): bool {}
public function slowlog(string $mode, int $option = 0): mixed {}
public function sort(string $key, array $options = null): mixed {}
/**
* @deprecated
*/
public function sortAsc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array {}
/**
* @deprecated
*/
public function sortAscAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array {}
/**
* @deprecated
*/
public function sortDesc(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array {}
/**
* @deprecated
*/
public function sortDescAlpha(string $key, ?string $pattern = null, mixed $get = null, int $offset = -1, int $count = -1, ?string $store = null): array {}
public function srem(string $key, string $value, mixed ...$other_values): Redis|int|false {}
public function sscan(string $key, int &$iterator, ?string $pattern = null, int $count = 0): array|false {}
/** @return false|int|Redis */
public function strlen(string $key) {}
public function subscribe(string $channel, string ...$other_channels): array|false {}
public function swapdb(string $src, string $dst): bool {}
public function time(): array|false {}
public function ttl(string $key): Redis|int|false {}
/** @return false|int|Redis */
public function type(string $key) {}
/**
* @return false|int|Redis
*/
public function unlink(array|string $key, string ...$other_keys) {}
public function unsubscribe(string $channel, string ...$other_channels): array|false {}
/** @return bool|Redis */
public function unwatch() {}
/**
* @return bool|Redis
*/
public function watch(array|string $key, string ...$other_keys) {}
public function wait(int $count, int $timeout): int|false {}
public function xack(string $key, string $group, array $ids): int|false {}
public function xadd(string $key, string $id, array $values, int $maxlen = 0, bool $approx = false): string|false {}
public function xclaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options): string|array|false {}
public function xdel(string $key, array $ids): Redis|int|false {}
public function xgroup(string $operation, string $key = null, string $arg1 = null, string $arg2 = null, bool $arg3 = false): mixed {}
public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed {}
public function xlen(string $key): int {}
public function xpending(string $key, string $group, string $start = null, string $end = null, int $count = -1, string $consumer = null): Redis|array|false {}
public function xrange(string $key, string $start, string $end, int $count = -1): bool|array {}
public function xread(array $streams, int $count = -1, int $block = -1): bool|array {}
public function xreadgroup(string $group, string $consumer, array $streams, int $count = 1, int $block = 1): bool|array {}
public function xrevrange(string $key, string $start, string $end, int $count = -1): bool|array {}
public function xtrim(string $key, int $maxlen, bool $approx = false): int {}
public function zAdd(string $key, array|float $score_or_options, mixed ...$more_scores_and_mems): Redis|int|false {}
public function zCard(string $key): Redis|int|false {}
public function zCount(string $key, string $start , string $end): Redis|int|false {}
public function zIncrBy(string $key, float $value, mixed $member): Redis|float|false {}
public function zLexCount(string $key, string $min, string $max): Redis|int|false {}
public function zMscore(string $key, string $member, string ...$other_members): array|false {}
public function zPopMax(string $key, int $value = null): array|false {}
public function zPopMin(string $key, int $value = null): array|false {}
public function zRange(string $key, int $start, int $end, mixed $scores = null): Redis|array|false {}
public function zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1): array|false {}
public function zRangeByScore(string $key, string $start, string $end, array $options = []): Redis|array|false {}
public function zRandMember(string $key, array $options = null): string|array|false {}
public function zRank(string $key, mixed $member): Redis|int|false {}
public function zRem(mixed $key, mixed $member, mixed ...$other_members): Redis|int|false {}
public function zRemRangeByLex(string $key, string $min, string $max): int|false {}
public function zRemRangeByRank(string $key, int $start, int $end): Redis|int|false {}
public function zRemRangeByScore(string $key, string $start, string $end): Redis|int|false {}
public function zRevRange(string $key, int $start, int $end, mixed $scores = null): Redis|array|false {}
public function zRevRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1): array|false {}
public function zRevRangeByScore(string $key, string $start, string $end, array $options = []): array|false {}
public function zRevRank(string $key, mixed $member): Redis|int|false {}
public function zScore(string $key, mixed $member): Redis|float|false {}
public function zdiff(array $keys, array $options = null): array|false {}
public function zdiffstore(string $dst, array $keys, array $options = null): int {}
public function zinter(array $keys, ?array $weights = null, ?array $options = null): Redis|array|false {}
public function zinterstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null): Redis|int|false {}
public function zscan(string $key, ?int &$iterator, ?string $pattern = null, int $count = 0): bool|array {}
public function zunion(array $keys, ?array $weights = null, ?array $options = null): Redis|array|false {}
public function zunionstore(string $dst, array $keys, ?array $weights = NULL, ?string $aggregate = NULL): Redis|int|false {}
}

View File

@@ -0,0 +1,118 @@
<?php
/**
* @param class-string<SimpleXMLElement> $class_name
* @return SimpleXMLElement|false
*/
function simplexml_load_file(string $filename, ?string $class_name = SimpleXMLElement::class, int $options = 0, string $namespace_or_prefix = '', bool $is_prefix = false) {}
/**
* @param class-string<SimpleXMLElement> $class_name
* @return SimpleXMLElement|false
*/
function simplexml_load_string(string $data, ?string $class_name = 'SimpleXMLElement', int $options = 0, string $namespace_or_prefix = '', bool $is_prefix = false) {}
/**
* @param class-string<SimpleXMLElement> $class_name
*/
function simplexml_import_dom(DOMNode $node, ?string $class_name = 'SimpleXMLElement'): ?SimpleXMLElement {}
/**
* @param class-string<SimpleXMLElement> $class_name
* @php-from 8.1
*/
function simplexml_import_dom(SimpleXMLElement|DOMNode $node, ?string $class_name = 'SimpleXMLElement'): ?SimpleXMLElement {}
/**
* @implements Traversable<string, SimpleXMLElement>
*/
class SimpleXMLElement implements Traversable, Countable
{
/** @return array<array-key, SimpleXMLElement>|null|false */
public function xpath(string $expression) {}
public function registerXPathNamespace(string $prefix, string $namespace): bool {}
/** @return ($filename is null ? string|false : bool) */
public function asXML(?string $filename = null) {}
/**
* @return ($filename is null ? string|false : bool)
* @alias SimpleXMLElement::asXML
*/
public function saveXML(?string $filename = null) {}
public function getNamespaces(bool $recursive = false): array {}
/** @return array|false */
public function getDocNamespaces(bool $recursive = false, bool $fromRoot = true) {}
public function children(?string $namespaceOrPrefix = null, bool $isPrefix = false): ?SimpleXMLElement {}
public function attributes(?string $namespaceOrPrefix = null, bool $isPrefix = false): ?SimpleXMLElement {}
final public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = '', bool $isPrefix = false) {}
public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElement {}
public function addAttribute(string $qualifiedName, string $value, ?string $namespace = null): void {}
public function getName(): string {}
public function __toString(): string {}
public function count(): int {}
}
/**
* @implements RecursiveIterator<string, SimpleXMLElement>
*/
class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, Countable
{
public function count(): int {}
public function rewind(): void {}
public function valid(): bool {}
public function current(): SimpleXMLIterator {}
public function key(): ?string {}
public function next(): void {}
public function hasChildren(): bool {}
public function getChildren(): SimpleXMLIterator {}
}
/**
* @implements RecursiveIterator<string, SimpleXMLElement>
* @php-from 8.0
*/
class SimpleXMLElement implements Stringable, Countable, RecursiveIterator
{
public function count(): int {}
public function rewind(): void {}
public function valid(): bool {}
public function current(): SimpleXMLElement {}
public function key(): ?string {}
public function next(): void {}
public function hasChildren(): bool {}
public function getChildren(): ?SimpleXMLElement {}
}
/** @php-from 8.0 */
class SimpleXMLIterator extends SimpleXMLElement
{
public function current(): SimpleXMLElement {}
public function getChildren(): ?SimpleXMLElement {}
}

View File

@@ -0,0 +1,311 @@
<?php
/**
* The SoapClient class provides a client for SOAP 1.1, SOAP 1.2 servers. It can be used in WSDL
* or non-WSDL mode.
* @link https://php.net/manual/en/class.soapclient.php
*/
class SoapClient {
/**
* SoapClient constructor
* @link https://php.net/manual/en/soapclient.soapclient.php
* @param mixed $wsdl <p>
* URI of the WSDL file or <b>NULL</b> if working in
* non-WSDL mode.
* </p>
* <p>
* During development, WSDL caching may be disabled by the
* use of the soap.wsdl_cache_ttl <i>php.ini</i> setting
* otherwise changes made to the WSDL file will have no effect until
* soap.wsdl_cache_ttl is expired.
* </p>
* @param array $options [optional] <p>
* An array of options. If working in WSDL mode, this parameter is optional.
* If working in non-WSDL mode, the location and
* uri options must be set, where location
* is the URL of the SOAP server to send the request to, and uri
* is the target namespace of the SOAP service.
* </p>
* <p>
* The style and use options only work in
* non-WSDL mode. In WSDL mode, they come from the WSDL file.
* </p>
* <p>
* The soap_version option should be one of either
* <b>SOAP_1_1</b> or <b>SOAP_1_2</b> to
* select SOAP 1.1 or 1.2, respectively. If omitted, 1.1 is used.
* </p>
* <p>
* For HTTP authentication, the login and
* password options can be used to supply credentials.
* For making an HTTP connection through
* a proxy server, the options proxy_host,
* proxy_port, proxy_login
* and proxy_password are also available.
* For HTTPS client certificate authentication use
* local_cert and passphrase options. An
* authentication may be supplied in the authentication
* option. The authentication method may be either
* <b>SOAP_AUTHENTICATION_BASIC</b> (default) or
* <b>SOAP_AUTHENTICATION_DIGEST</b>.
* </p>
* <p>
* The compression option allows to use compression
* of HTTP SOAP requests and responses.
* </p>
* <p>
* The encoding option defines internal character
* encoding. This option does not change the encoding of SOAP requests (it is
* always utf-8), but converts strings into it.
* </p>
* <p>
* The trace option enables tracing of request so faults
* can be backtraced. This defaults to <b>FALSE</b>
* </p>
* <p>
* The classmap option can be used to map some WSDL
* types to PHP classes. This option must be an array with WSDL types
* as keys and names of PHP classes as values.
* </p>
* <p>
* Setting the boolean trace option enables use of the
* methods
* SoapClient->__getLastRequest,
* SoapClient->__getLastRequestHeaders,
* SoapClient->__getLastResponse and
* SoapClient->__getLastResponseHeaders.
* </p>
* <p>
* The exceptions option is a boolean value defining whether
* soap errors throw exceptions of type
* SoapFault.
* </p>
* <p>
* The connection_timeout option defines a timeout in seconds
* for the connection to the SOAP service. This option does not define a timeout
* for services with slow responses. To limit the time to wait for calls to finish the
* default_socket_timeout setting
* is available.
* </p>
* <p>
* The typemap option is an array of type mappings.
* Type mapping is an array with keys type_name,
* type_ns (namespace URI), from_xml
* (callback accepting one string parameter) and to_xml
* (callback accepting one object parameter).
* </p>
* <p>
* The cache_wsdl option is one of
* <b>WSDL_CACHE_NONE</b>,
* <b>WSDL_CACHE_DISK</b>,
* <b>WSDL_CACHE_MEMORY</b> or
* <b>WSDL_CACHE_BOTH</b>.
* </p>
* <p>
* The user_agent option specifies string to use in
* User-Agent header.
* </p>
* <p>
* The stream_context option is a resource
* for context.
* </p>
* <p>
* The features option is a bitmask of
* <b>SOAP_SINGLE_ELEMENT_ARRAYS</b>,
* <b>SOAP_USE_XSI_ARRAY_TYPE</b>,
* <b>SOAP_WAIT_ONE_WAY_CALLS</b>.
* </p>
* <p>
* The keep_alive option is a boolean value defining whether
* to send the Connection: Keep-Alive header or
* Connection: close.
* </p>
* <p>
* The ssl_method option is one of
* <b>SOAP_SSL_METHOD_TLS</b>,
* <b>SOAP_SSL_METHOD_SSLv2</b>,
* <b>SOAP_SSL_METHOD_SSLv3</b> or
* <b>SOAP_SSL_METHOD_SSLv23</b>.
* </p>
* @throws SoapFault A SoapFault exception will be thrown if the wsdl URI cannot be loaded.
* @since 5.0.1
*/
public function __construct ($wsdl, array $options = null) {}
/**
* Calls a SOAP function (deprecated)
* @link https://php.net/manual/en/soapclient.call.php
* @param string $function_name
* @param array $arguments
* @return mixed
* @since 5.0.1
*/
public function __call ($function_name, $arguments) {}
/**
* Calls a SOAP function
* @link https://php.net/manual/en/soapclient.soapcall.php
* @param string $function_name <p>
* The name of the SOAP function to call.
* </p>
* @param array $arguments <p>
* An array of the arguments to pass to the function. This can be either
* an ordered or an associative array. Note that most SOAP servers require
* parameter names to be provided, in which case this must be an
* associative array.
* </p>
* @param array $options [optional] <p>
* An associative array of options to pass to the client.
* </p>
* <p>
* The location option is the URL of the remote Web service.
* </p>
* <p>
* The uri option is the target namespace of the SOAP service.
* </p>
* <p>
* The soapaction option is the action to call.
* </p>
* @param mixed $input_headers [optional] <p>
* An array of headers to be sent along with the SOAP request.
* </p>
* @param array $output_headers [optional] <p>
* If supplied, this array will be filled with the headers from the SOAP response.
* </p>
* @return mixed SOAP functions may return one, or multiple values. If only one value is returned
* by the SOAP function, the return value of __soapCall will be
* a simple value (e.g. an integer, a string, etc). If multiple values are
* returned, __soapCall will return
* an associative array of named output parameters.
* </p>
* <p>
* On error, if the SoapClient object was constructed with the exceptions
* option set to <b>FALSE</b>, a SoapFault object will be returned.
* @since 5.0.1
*/
public function __soapCall (string $function_name, array $arguments, array $options = null, $input_headers = null, &$output_headers = null) {}
/**
* Returns last SOAP request
* @link https://php.net/manual/en/soapclient.getlastrequest.php
* @return string|null The last SOAP request, as an XML string.
* @since 5.0.1
*/
public function __getLastRequest () {}
/**
* Returns last SOAP response
* @link https://php.net/manual/en/soapclient.getlastresponse.php
* @return string|null The last SOAP response, as an XML string.
* @since 5.0.1
*/
public function __getLastResponse () {}
/**
* Returns the SOAP headers from the last request
* @link https://php.net/manual/en/soapclient.getlastrequestheaders.php
* @return string|null The last SOAP request headers.
* @since 5.0.1
*/
public function __getLastRequestHeaders () {}
/**
* Returns the SOAP headers from the last response
* @link https://php.net/manual/en/soapclient.getlastresponseheaders.php
* @return string|null The last SOAP response headers.
* @since 5.0.1
*/
public function __getLastResponseHeaders () {}
/**
* Returns list of available SOAP functions
* @link https://php.net/manual/en/soapclient.getfunctions.php
* @return array|null The array of SOAP function prototypes, detailing the return type,
* the function name and type-hinted parameters.
* @since 5.0.1
*/
public function __getFunctions () {}
/**
* Returns a list of SOAP types
* @link https://php.net/manual/en/soapclient.gettypes.php
* @return array|null The array of SOAP types, detailing all structures and types.
* @since 5.0.1
*/
public function __getTypes () {}
/**
* Returns a list of all cookies
* @link https://php.net/manual/en/soapclient.getcookies.php
* @return array The array of all cookies
* @since 5.4.3
*/
public function __getCookies () {}
/**
* The __setCookie purpose
* @link https://php.net/manual/en/soapclient.setcookie.php
* @param string $name <p>
* The name of the cookie.
* </p>
* @param string $value [optional] <p>
* The value of the cookie. If not specified, the cookie will be deleted.
* </p>
* @return void No value is returned.
* @since 5.0.4
*/
public function __setCookie ($name, $value = null) {}
/**
* Sets the location of the Web service to use
* @link https://php.net/manual/en/soapclient.setlocation.php
* @param string $new_location [optional] <p>
* The new endpoint URL.
* </p>
* @return string The old endpoint URL.
* @since 5.0.1
*/
public function __setLocation ($new_location = null) {}
/**
* Sets SOAP headers for subsequent calls
* @link https://php.net/manual/en/soapclient.setsoapheaders.php
* @param mixed $soapheaders [optional] <p>
* The headers to be set. It could be <b>SoapHeader</b>
* object or array of <b>SoapHeader</b> objects.
* If not specified or set to <b>NULL</b>, the headers will be deleted.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.0.5
*/
public function __setSoapHeaders ($soapheaders = null) {}
}
class SoapFault extends Exception {
/**
* @param array|string|null $code
*/
public function __construct(
$code,
string $string,
?string $actor = null,
mixed $details = null,
?string $name = null,
mixed $headerFault = null
) {}
}
class SoapHeader {
public function __construct(
string $namespace,
string $name,
// Actually doesn't have a default, not specifying results in no SoapHeader::$data property. Specifying null
// results in a SoapHeader::$data property with null as the value. This probably makes no difference.
mixed $data = null,
bool $mustUnderstand = false,
// Same as $data, no default. The documentation specifies this as a `string` but it accepts null.
?string $actor = null
) {}
}

View File

@@ -0,0 +1,43 @@
<?php
const XDEBUG_TRACE_APPEND = 1;
const XDEBUG_TRACE_COMPUTERIZED = 2;
const XDEBUG_TRACE_HTML = 4;
const XDEBUG_TRACE_NAKED_FILENAME = 8;
const XDEBUG_CC_UNUSED = 1;
const XDEBUG_CC_DEAD_CODE = 2;
const XDEBUG_CC_BRANCH_CHECK = 4;
const XDEBUG_STACK_NO_DESC = 1;
const XDEBUG_FILTER_TRACING = 256;
const XDEBUG_FILTER_CODE_COVERAGE = 512;
const XDEBUG_FILTER_NONE = 0;
const XDEBUG_PATH_WHITELIST = 1;
const XDEBUG_PATH_BLACKLIST = 2;
const XDEBUG_NAMESPACE_WHITELIST = 17;
const XDEBUG_NAMESPACE_BLACKLIST = 18;
function xdebug_code_coverage_started() : bool
{
}
/**
* @return array<string, array<int, int>>
*/
function xdebug_get_code_coverage() : array
{
}
/**
* @param array<int, string> $configuration
*/
function xdebug_set_filter(int $group, int $list_type, array $configuration) : array
{
}
function xdebug_start_code_coverage(int $options) : void
{
}
function xdebug_stop_code_coverage(int $cleanup = 1) : void
{
}

View File

@@ -0,0 +1,22 @@
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\VariadicPlaceholder;
abstract class CallLike extends Expr {
/**
* @return list<Arg|VariadicPlaceholder>
*/
abstract public function getRawArgs(): array;
public function isFirstClassCallable(): bool {}
/**
* @psalm-pure
* @return list<Arg>
*/
public function getArgs(): array {}
}