diff --git a/Core/Core_c.php b/Core/Core_c.php index 066bfcc70..1610bc3f8 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -3,6 +3,7 @@ // Start of Core v.5.3.6-13ubuntu3.2 use JetBrains\PhpStorm\ExpectedValues; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -40,7 +41,8 @@ interface IteratorAggregate extends Traversable * Traversable * @throws Exception on failure. */ - public function getIterator(); + #[TentativeType] + public function getIterator(): Traversable; } /** @@ -55,21 +57,24 @@ interface Iterator extends Traversable * @link https://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ - public function current(); + #[TentativeType] + public function current(): mixed; /** * Move forward to next element * @link https://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ - public function next(); + #[TentativeType] + public function next(): void; /** * Return the key of the current element * @link https://php.net/manual/en/iterator.key.php * @return string|float|int|bool|null scalar on success, or null on failure. */ - public function key(); + #[TentativeType] + public function key(): mixed; /** * Checks if current position is valid @@ -77,14 +82,16 @@ public function key(); * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ - public function valid(); + #[TentativeType] + public function valid(): bool; /** * Rewind the Iterator to the first element * @link https://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ - public function rewind(); + #[TentativeType] + public function rewind(): void; } /** @@ -104,7 +111,8 @@ interface ArrayAccess *

* The return value will be casted to boolean if non-boolean was returned. */ - public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset); + #[TentativeType] + public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset): bool; /** * Offset to retrieve @@ -114,7 +122,8 @@ public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], defaul *

* @return mixed Can return all value types. */ - public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset); + #[TentativeType] + public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset): mixed; /** * Offset to set @@ -127,10 +136,11 @@ public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: *

* @return void */ + #[TentativeType] public function offsetSet( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value - ); + ): void; /** * Offset to unset @@ -140,7 +150,8 @@ public function offsetSet( *

* @return void */ - public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset); + #[TentativeType] + public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $offset): void; } /** @@ -180,7 +191,7 @@ interface Throwable extends Stringable * @return string * @since 7.0 */ - public function getMessage(); + public function getMessage(): string; /** * Gets the exception code @@ -201,7 +212,7 @@ public function getCode(); * @return string Returns the name of the file from which the object was thrown. * @since 7.0 */ - public function getFile(); + public function getFile(): string; /** * Gets the line on which the object was instantiated @@ -209,7 +220,7 @@ public function getFile(); * @return int Returns the line number where the thrown object was instantiated. * @since 7.0 */ - public function getLine(); + public function getLine(): int; /** * Gets the stack trace @@ -220,7 +231,7 @@ public function getLine(); *

* @since 7.0 */ - public function getTrace(); + public function getTrace(): array; /** * Gets the stack trace as a string @@ -228,7 +239,7 @@ public function getTrace(); * @return string Returns the stack trace as a string. * @since 7.0 */ - public function getTraceAsString(); + public function getTraceAsString(): string; /** * Returns the previous Throwable @@ -236,6 +247,7 @@ public function getTraceAsString(); * @return null|Throwable Returns the previous {@see Throwable} if available, or NULL otherwise. * @since 7.0 */ + #[LanguageLevelTypeAware(['8.0' => 'Throwable|null'], default: '')] public function getPrevious(); /** @@ -246,6 +258,7 @@ public function getPrevious(); */ public function __toString(); } + /** * Exception is the base class for * all Exceptions. @@ -270,7 +283,7 @@ class Exception implements Throwable * @link https://php.net/manual/en/exception.clone.php * @return void */ - final private function __clone() {} + final private function __clone(): void {} /** * Construct the exception. Note: The message is NOT binary safe. @@ -292,7 +305,7 @@ public function __construct( * @return string the Exception message as a string. */ #[Pure] - final public function getMessage() {} + final public function getMessage(): string {} /** * Gets the Exception code @@ -311,7 +324,7 @@ final public function getCode() {} * @return string the filename in which the exception was created. */ #[Pure] - final public function getFile() {} + final public function getFile(): string {} /** * Gets the line in which the exception occurred @@ -319,7 +332,7 @@ final public function getFile() {} * @return int the line number where the exception was created. */ #[Pure] - final public function getLine() {} + final public function getLine(): int {} /** * Gets the stack trace @@ -327,7 +340,7 @@ final public function getLine() {} * @return array the Exception stack trace as an array. */ #[Pure] - final public function getTrace() {} + final public function getTrace(): array {} /** * Returns previous Exception @@ -336,7 +349,7 @@ final public function getTrace() {} * or null otherwise. */ #[Pure] - final public function getPrevious() {} + final public function getPrevious(): ?Throwable {} /** * Gets the stack trace as a string @@ -344,16 +357,18 @@ final public function getPrevious() {} * @return string the Exception stack trace as a string. */ #[Pure] - final public function getTraceAsString() {} + final public function getTraceAsString(): string {} /** * String representation of the exception * @link https://php.net/manual/en/exception.tostring.php * @return string the string representation of the exception. */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} } /** @@ -394,7 +409,7 @@ public function __construct( * @return string * @since 7.0 */ - final public function getMessage() {} + final public function getMessage(): string {} /** * Gets the exception code @@ -415,7 +430,7 @@ final public function getCode() {} * @return string Returns the name of the file from which the object was thrown. * @since 7.0 */ - final public function getFile() {} + final public function getFile(): string {} /** * Gets the line on which the object was instantiated @@ -423,7 +438,7 @@ final public function getFile() {} * @return int Returns the line number where the thrown object was instantiated. * @since 7.0 */ - final public function getLine() {} + final public function getLine(): int {} /** * Gets the stack trace @@ -434,7 +449,7 @@ final public function getLine() {} *

* @since 7.0 */ - final public function getTrace() {} + final public function getTrace(): array {} /** * Gets the stack trace as a string @@ -442,7 +457,7 @@ final public function getTrace() {} * @return string Returns the stack trace as a string. * @since 7.0 */ - final public function getTraceAsString() {} + final public function getTraceAsString(): string {} /** * Returns the previous Throwable @@ -450,7 +465,7 @@ final public function getTraceAsString() {} * @return null|Throwable Returns the previous {@see Throwable} if available, or NULL otherwise. * @since 7.0 */ - final public function getPrevious() {} + final public function getPrevious(): ?Throwable {} /** * Gets a string representation of the thrown object @@ -458,7 +473,7 @@ final public function getPrevious() {} * @return string

Returns the string representation of the thrown object.

* @since 7.0 */ - public function __toString() {} + public function __toString(): string {} /** * Clone the error @@ -466,9 +481,10 @@ public function __toString() {} * @return void * @link https://php.net/manual/en/error.clone.php */ - final private function __clone() {} + final private function __clone(): void {} - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} } class ValueError extends Error {} @@ -546,7 +562,7 @@ class ErrorException extends Exception * @param int $line [optional] The line number where the exception is thrown. * @param Exception $previous [optional] The previous exception used for the exception chaining. */ - #[\JetBrains\PhpStorm\Pure] + #[Pure] public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $message = "", #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $code = 0, @@ -561,7 +577,7 @@ public function __construct( * @link https://php.net/manual/en/errorexception.getseverity.php * @return int the severity level of the exception. */ - final public function getSeverity() {} + final public function getSeverity(): int {} } /** @@ -600,7 +616,7 @@ public function __invoke(...$_) {} * This determines the visibility of protected and private methods of the bound object. * @return Closure|false Returns the newly created Closure object or FALSE on failure */ - public function bindTo(?object $newThis, object|string|null $newScope = 'static') {} + public function bindTo(?object $newThis, object|string|null $newScope = 'static'): ?Closure {} /** * This method is a static version of Closure::bindTo(). @@ -613,7 +629,7 @@ public function bindTo(?object $newThis, object|string|null $newScope = 'static' * This determines the visibility of protected and private methods of the bound object. * @return Closure|false Returns the newly created Closure object or FALSE on failure */ - public static function bind(Closure $closure, ?object $newThis, object|string|null $newScope = 'static') {} + public static function bind(Closure $closure, ?object $newThis, object|string|null $newScope = 'static'): ?Closure {} /** * Temporarily binds the closure to newthis, and calls it with any given parameters. @@ -623,14 +639,14 @@ public static function bind(Closure $closure, ?object $newThis, object|string|nu * @return mixed * @since 7.0 */ - public function call(object $newThis, mixed ...$args) {} + public function call(object $newThis, mixed ...$args): mixed {} /** * @param callable $callback * @return Closure * @since 7.1 */ - public static function fromCallable(callable $callback) {} + public static function fromCallable(callable $callback): Closure {} } /** @@ -648,7 +664,8 @@ interface Countable * The return value is cast to an integer. *

*/ - public function count(); + #[TentativeType] + public function count(): int; } /** @@ -682,7 +699,7 @@ public static function create($referent) {} * @return object|null * @since 7.4 */ - public function get() {} + public function get(): ?object {} } /** @@ -693,7 +710,7 @@ public function get() {} * * @since 8.0 */ -final class WeakMap implements \ArrayAccess, \Countable, \IteratorAggregate +final class WeakMap implements ArrayAccess, Countable, IteratorAggregate { /** * Returns {@see true} if the value for the object is contained in @@ -702,7 +719,7 @@ final class WeakMap implements \ArrayAccess, \Countable, \IteratorAggregate * @param object $object Any object * @return bool */ - public function offsetExists($object) {} + public function offsetExists($object): bool {} /** * Returns the existsing value by an object. @@ -710,7 +727,7 @@ public function offsetExists($object) {} * @param object $object Any object * @return mixed Value associated with the key object */ - public function offsetGet($object) {} + public function offsetGet($object): mixed {} /** * Sets a new value for an object. @@ -719,7 +736,7 @@ public function offsetGet($object) {} * @param mixed $value Any value * @return void */ - public function offsetSet($object, mixed $value) {} + public function offsetSet($object, mixed $value): void {} /** * Force removes an object value from the {@see WeakMap} instance. @@ -727,21 +744,21 @@ public function offsetSet($object, mixed $value) {} * @param object $object Any object * @return void */ - public function offsetUnset($object) {} + public function offsetUnset($object): void {} /** * Returns an iterator in the "[object => mixed]" format. * * @return Traversable */ - public function getIterator() {} + public function getIterator(): Iterator {} /** * Returns the number of items in the {@see WeakMap} instance. * * @return int */ - public function count() {} + public function count(): int {} } /** @@ -759,7 +776,7 @@ interface Stringable * @return string Returns string representation of the object that * implements this interface (and/or "__toString" magic method). */ - public function __toString(); + public function __toString(): string; } /** @@ -823,15 +840,16 @@ public function __construct(#[ExpectedValues(flagsFromClass: Attribute::class)] final class InternalIterator implements Iterator { private function __construct() {} - public function current() {} - public function next() {} + public function current(): mixed {} + + public function next(): void {} - public function key() {} + public function key(): mixed {} - public function valid() {} + public function valid(): bool {} - public function rewind() {} + public function rewind(): void {} } /** @@ -844,7 +862,7 @@ interface UnitEnum /** * @return static[] */ - public static function cases(); + public static function cases(): array; } /** @@ -858,13 +876,13 @@ interface BackedEnum extends UnitEnum * @param int|string $value * @return static */ - public static function from(int|string $value); + public static function from(int|string $value): static; /** * @param int|string $value * @return static|null */ - public static function tryFrom(int|string $value); + public static function tryFrom(int|string $value): ?static; } /** @@ -881,13 +899,13 @@ interface IntBackedEnum extends BackedEnum * @param int $value * @return static */ - public static function from(int $value); + public static function from(int $value): static; /** * @param int $value * @return static|null */ - public static function tryFrom(int $value); + public static function tryFrom(int $value): ?static; } /** @@ -925,7 +943,7 @@ public function __construct(callable $callback) {} * @throws FiberError If the fiber has already been started. * @throws Throwable If the fiber callable throws an uncaught exception. */ - public function start(mixed ...$args) {} + public function start(mixed ...$args): mixed {} /** * Resumes the fiber, returning the given value from {@see Fiber::suspend()}. @@ -938,7 +956,7 @@ public function start(mixed ...$args) {} * @throws FiberError If the fiber has not started, is running, or has terminated. * @throws Throwable If the fiber callable throws an uncaught exception. */ - public function resume(mixed $value = null) {} + public function resume(mixed $value = null): mixed {} /** * Throws the given exception into the fiber from {@see Fiber::suspend()}. @@ -951,36 +969,36 @@ public function resume(mixed $value = null) {} * @throws FiberError If the fiber has not started, is running, or has terminated. * @throws Throwable If the fiber callable throws an uncaught exception. */ - public function throw(Throwable $exception) {} + public function throw(Throwable $exception): mixed {} /** * @return bool True if the fiber has been started. */ - public function isStarted() {} + public function isStarted(): bool {} /** * @return bool True if the fiber is suspended. */ - public function isSuspended() {} + public function isSuspended(): bool {} /** * @return bool True if the fiber is currently running. */ - public function isRunning() {} + public function isRunning(): bool {} /** * @return bool True if the fiber has completed execution (returned or threw). */ - public function isTerminated() {} + public function isTerminated(): bool {} /** * @return mixed Return value of the fiber callback. NULL is returned if the fiber does not have a return statement. * * @throws FiberError If the fiber has not terminated or the fiber threw an exception. */ - public function getReturn() {} + public function getReturn(): mixed {} - public static function getCurrent() {} + public static function getCurrent(): ?Fiber {} /** * @return self|null Returns the currently executing fiber instance or NULL if in {main}. @@ -999,7 +1017,7 @@ public static function this() {} * @throws FiberError Thrown if not within a fiber (i.e., if called from {main}). * @throws Throwable Exception provided to {@see Fiber::throw()}. */ - public static function suspend(mixed $value = null) {} + public static function suspend(mixed $value = null): mixed {} } /** @@ -1013,7 +1031,8 @@ public function __construct() {} /** * @since 8.1 */ -#[Attribute(Attribute::TARGET_METHOD)] final class ReturnTypeWillChange +#[Attribute(Attribute::TARGET_METHOD)] +final class ReturnTypeWillChange { public function __construct() {} } diff --git a/PDO/PDO.php b/PDO/PDO.php index dabf03bd3..c854f4686 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -5,6 +5,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -938,7 +939,8 @@ public function __construct( * Emulated prepared statements does not communicate with the database server * so PDO::prepare does not check the statement. */ - public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []) {} + #[TentativeType] + public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []): PDOStatement|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -964,7 +966,8 @@ public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ' * Note: An exception is raised even when the PDO::ATTR_ERRMODE * attribute is not PDO::ERRMODE_EXCEPTION. */ - public function beginTransaction() {} + #[TentativeType] + public function beginTransaction(): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -973,7 +976,8 @@ public function beginTransaction() {} * @return bool TRUE on success or FALSE on failure. * @throws PDOException if there is no active transaction. */ - public function commit() {} + #[TentativeType] + public function commit(): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -982,7 +986,8 @@ public function commit() {} * @return bool TRUE on success or FALSE on failure. * @throws PDOException if there is no active transaction. */ - public function rollBack() {} + #[TentativeType] + public function rollBack(): bool {} /** * (PHP 5 >= 5.3.3, Bundled pdo_pgsql, PHP 7)
@@ -990,7 +995,8 @@ public function rollBack() {} * @link https://php.net/manual/en/pdo.intransaction.php * @return bool TRUE if a transaction is currently active, and FALSE if not. */ - public function inTransaction() {} + #[TentativeType] + public function inTransaction(): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1000,10 +1006,11 @@ public function inTransaction() {} * @param mixed $value * @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function setAttribute( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: '')] $value - ) {} + ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1033,7 +1040,8 @@ public function setAttribute( * $db->exec() or die(print_r($db->errorInfo(), true)); * */ - public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement) {} + #[TentativeType] + public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1109,7 +1117,8 @@ public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetc * PDO::lastInsertId triggers an * IM001 SQLSTATE. */ - public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null) {} + #[TentativeType] + public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1137,7 +1146,8 @@ public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], *

* Returns NULL if no operation has been run on the database handle. */ - public function errorCode() {} + #[TentativeType] + public function errorCode(): ?string {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1179,7 +1189,8 @@ public function errorCode() {} * information for an operation performed on a particular statement handle. */ #[ArrayShape([0 => "string", 1 => "int", 2 => "string"])] - public function errorInfo() {} + #[TentativeType] + public function errorInfo(): array {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1204,7 +1215,8 @@ public function errorInfo() {} * @return mixed A successful call returns the value of the requested PDO attribute. * An unsuccessful call returns null. */ - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute) {} + #[TentativeType] + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.1)
@@ -1220,10 +1232,11 @@ public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * SQL statement. Returns FALSE if the driver does not support quoting in * this way. */ + #[TentativeType] public function quote( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT - ) {} + ): string|false {} final public function __wakeup() {} @@ -1236,7 +1249,8 @@ final public function __sleep() {} * @return array PDO::getAvailableDrivers returns an array of PDO driver names. If * no drivers are available, it returns an empty array. */ - public static function getAvailableDrivers() {} + #[TentativeType] + public static function getAvailableDrivers(): array {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo_sqlite >= 1.0.0)
@@ -1297,9 +1311,10 @@ class PDOStatement implements IteratorAggregate * fail and an error is emitted. *

* @return bool TRUE on success or FALSE on failure. - * @throws \PDOException On error if PDO::ERRMODE_EXCEPTION option is true. + * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true. */ - public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $params = null) {} + #[TentativeType] + public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $params = null): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1329,11 +1344,12 @@ public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], defaul * @return mixed The return value of this function on success depends on the fetch type. In * all cases, FALSE is returned on failure. */ + #[TentativeType] public function fetch( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOrientation = PDO::FETCH_ORI_NEXT, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOffset = 0 - ) {} + ): mixed {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1365,13 +1381,14 @@ public function fetch( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function bindParam( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1396,13 +1413,14 @@ public function bindParam( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function bindColumn( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 1.0.0)
@@ -1424,11 +1442,12 @@ public function bindColumn( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function bindValue( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT - ) {} + ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1436,7 +1455,8 @@ public function bindValue( * @link https://php.net/manual/en/pdostatement.rowcount.php * @return int the number of rows. */ - public function rowCount() {} + #[TentativeType] + public function rowCount(): int {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)
@@ -1454,7 +1474,8 @@ public function rowCount() {} * There is no way to return another column from the same row if you * use PDOStatement::fetchColumn to retrieve data. */ - public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0) {} + #[TentativeType] + public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0): mixed {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1500,11 +1521,12 @@ public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * ORDER BY clauses in SQL to restrict results before retrieving and * processing them with PHP. */ + #[TentativeType] public function fetchAll( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $fetch_argument = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args - ) {} + ): array {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.4)
@@ -1519,7 +1541,8 @@ public function fetchAll( * @return mixed an instance of the required class with property names that * correspond to the column names or FALSE on failure. */ - public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []) {} + #[TentativeType] + public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []): object|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1529,7 +1552,8 @@ public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], d * PDOStatement::errorCode only retrieves error codes * for operations performed with PDOStatement objects. */ - public function errorCode() {} + #[TentativeType] + public function errorCode(): ?string {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1557,7 +1581,8 @@ public function errorCode() {} * */ #[ArrayShape([0 => "string", 1 => "int", 2 => "string"])] - public function errorInfo() {} + #[TentativeType] + public function errorInfo(): array {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1567,10 +1592,11 @@ public function errorInfo() {} * @param mixed $value * @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function setAttribute( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value - ) {} + ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1579,7 +1605,8 @@ public function setAttribute( * @param int $name * @return mixed the attribute value. */ - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $name) {} + #[TentativeType] + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $name): mixed {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1589,7 +1616,8 @@ public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * PDOStatement object. If there is no result set, * PDOStatement::columnCount returns 0. */ - public function columnCount() {} + #[TentativeType] + public function columnCount(): int {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1651,7 +1679,8 @@ public function columnCount() {} * Returns FALSE if the requested column does not exist in the result set, * or if no result set exists. */ - public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column) {} + #[TentativeType] + public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1691,7 +1720,8 @@ public function setFetchMode($mode, $className = null, ...$params) {} * @link https://php.net/manual/en/pdostatement.nextrowset.php * @return bool TRUE on success or FALSE on failure. */ - public function nextRowset() {} + #[TentativeType] + public function nextRowset(): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)
@@ -1699,25 +1729,27 @@ public function nextRowset() {} * @link https://php.net/manual/en/pdostatement.closecursor.php * @return bool TRUE on success or FALSE on failure. */ - public function closeCursor() {} + #[TentativeType] + public function closeCursor(): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)
* Dump an SQL prepared command * @link https://php.net/manual/en/pdostatement.debugdumpparams.php - * @return bool No value is returned. + * @return bool|null No value is returned. */ - public function debugDumpParams() {} + #[TentativeType] + public function debugDumpParams(): ?bool {} final public function __wakeup() {} final public function __sleep() {} /** + * @return Iterator * @since 8.0 - * @return Traversable */ - public function getIterator() {} + public function getIterator(): Iterator {} } final class PDORow diff --git a/Phar/Phar.php b/Phar/Phar.php index 27b05a970..b8ecbb676 100644 --- a/Phar/Phar.php +++ b/Phar/Phar.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; /** * The PharException class provides a phar-specific exception class @@ -71,7 +72,8 @@ public function __destruct() {} *

* @return void no return value, exception is thrown on failure. */ - public function addEmptyDir(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory) {} + #[TentativeType] + public function addEmptyDir(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory): void {} /** * (Unknown)
@@ -86,10 +88,11 @@ public function addEmptyDir(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul *

* @return void no return value, exception is thrown on failure. */ + #[TentativeType] public function addFile( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $localName = null - ) {} + ): void {} /** * (Unknown)
@@ -103,10 +106,11 @@ public function addFile( *

* @return void no return value, exception is thrown on failure. */ + #[TentativeType] public function addFromString( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $contents - ) {} + ): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -125,10 +129,11 @@ public function addFromString( * mapping internal path of file to the full path of the file on the * filesystem. */ + #[TentativeType] public function buildFromDirectory( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = null - ) {} + ): array {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -146,10 +151,11 @@ public function buildFromDirectory( * mapping internal path of file to the full path of the file on the * filesystem. */ + #[TentativeType] public function buildFromIterator( Traversable $iterator, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $baseDirectory = null - ) {} + ): array {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -162,7 +168,8 @@ public function buildFromIterator( *

* @return void No value is returned. */ - public function compressFiles(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $compression) {} + #[TentativeType] + public function compressFiles(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $compression): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -188,12 +195,13 @@ public function decompressFiles() {} * compressing tar archives. For decompressing, the default file extensions * are .phar and .phar.tar. *

- * @return static a Phar object. + * @return static|null a Phar object. */ + #[TentativeType] public function compress( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $compression, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null - ) {} + ): ?Phar {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -206,9 +214,10 @@ public function compress( * that all executable phar archives must contain .phar * in their filename. *

- * @return static A Phar object is returned. + * @return static|null A Phar object is returned. */ - public function decompress(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null) {} + #[TentativeType] + public function decompress(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null): ?Phar {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -238,14 +247,15 @@ public function decompress(#[LanguageLevelTypeAware(['8.0' => 'string|null'], de * and .phar.tar.bz2. For zip-based phar archives, the * default extension is .phar.zip. *

- * @return Phar The method returns a Phar object on success and throws an + * @return Phar|null The method returns a Phar object on success and throws an * exception on failure. */ + #[TentativeType] public function convertToExecutable( #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976, #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null - ) {} + ): ?Phar {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -273,14 +283,15 @@ public function convertToExecutable( * For zip-based archives, the * default extension is .zip. *

- * @return PharData The method returns a PharData object on success and throws an + * @return PharData|null The method returns a PharData object on success and throws an * exception on failure. */ + #[TentativeType] public function convertToData( #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976, #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null - ) {} + ): ?PharData {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -304,7 +315,8 @@ public function copy( * @return int The number of files contained within this phar, or 0 (the number zero) * if none. */ - public function count(#[PhpStormStubsElementAvailable(from: '8.0')] int $mode = COUNT_NORMAL) {} + #[TentativeType] + public function count(#[PhpStormStubsElementAvailable(from: '8.0')] int $mode = COUNT_NORMAL): int {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -343,17 +355,19 @@ public function delMetadata() {} * @return bool returns TRUE on success, but it is better to check for thrown exception, * and assume success if none is thrown. */ + #[TentativeType] public function extractTo( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory, #[LanguageLevelTypeAware(['8.0' => 'array|string|null'], default: '')] $files = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $overwrite = false - ) {} + ): bool {} - /** - * @see setAlias - * @return string - */ - public function getAlias() {} + /** + * @return string|null + * @see setAlias + */ + #[TentativeType] + public function getAlias(): ?string {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -364,7 +378,8 @@ public function getAlias() {} * @return mixed any PHP variable that can be serialized and is stored as meta-data for the Phar archive, * or NULL if no meta-data is stored. */ - public function getMetadata(#[PhpStormStubsElementAvailable(from: '8.0')] array $unserializeOptions = []) {} + #[TentativeType] + public function getMetadata(#[PhpStormStubsElementAvailable(from: '8.0')] array $unserializeOptions = []): mixed {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -372,7 +387,8 @@ public function getMetadata(#[PhpStormStubsElementAvailable(from: '8.0')] array * @link https://php.net/manual/en/phar.getmodified.php * @return bool TRUE if the phar has been modified since opened, FALSE if not. */ - public function getModified() {} + #[TentativeType] + public function getModified(): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -388,7 +404,8 @@ public function getModified() {} * is set to true. */ #[ArrayShape(["hash" => "string", "hash_type" => "string"])] - public function getSignature() {} + #[TentativeType] + public function getSignature(): array|false {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -397,7 +414,8 @@ public function getSignature() {} * @return string a string containing the contents of the bootstrap loader (stub) of * the current Phar archive. */ - public function getStub() {} + #[TentativeType] + public function getStub(): string {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -409,7 +427,8 @@ public function getStub() {} * its manifest. See Phar file format * documentation for more information. */ - public function getVersion() {} + #[TentativeType] + public function getVersion(): string {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.0)
@@ -417,7 +436,8 @@ public function getVersion() {} * @link https://php.net/manual/en/phar.hasmetadata.php * @return bool TRUE if meta-data has been set, and FALSE if not. */ - public function hasMetadata() {} + #[TentativeType] + public function hasMetadata(): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -425,7 +445,8 @@ public function hasMetadata() {} * @link https://php.net/manual/en/phar.isbuffering.php * @return bool TRUE if the write operations are being buffer, FALSE otherwise. */ - public function isBuffering() {} + #[TentativeType] + public function isBuffering(): bool {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -433,7 +454,8 @@ public function isBuffering() {} * @link https://php.net/manual/en/phar.iscompressed.php * @return mixed Phar::GZ, Phar::BZ2 or FALSE */ - public function isCompressed() {} + #[TentativeType] + public function isCompressed(): int|false {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -445,7 +467,8 @@ public function isCompressed() {} *

* @return bool TRUE if the phar archive matches the file format requested by the parameter */ - public function isFileFormat(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format) {} + #[TentativeType] + public function isFileFormat(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format): bool {} /** * (Unknown)
@@ -453,7 +476,8 @@ public function isFileFormat(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * @link https://php.net/manual/en/phar.iswritable.php * @return bool TRUE if the phar archive can be modified */ - public function isWritable() {} + #[TentativeType] + public function isWritable(): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -464,7 +488,8 @@ public function isWritable() {} *

* @return bool TRUE if the file exists within the phar, or FALSE if not. */ - public function offsetExists($localName) {} + #[TentativeType] + public function offsetExists($localName): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -476,7 +501,8 @@ public function offsetExists($localName) {} * @return PharFileInfo A PharFileInfo object is returned that can be used to * iterate over a file's contents or to retrieve information about the current file. */ - public function offsetGet($localName) {} + #[TentativeType] + public function offsetGet($localName): SplFileInfo {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -490,7 +516,8 @@ public function offsetGet($localName) {} *

* @return void No return values. */ - public function offsetSet($localName, $value) {} + #[TentativeType] + public function offsetSet($localName, $value): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -501,7 +528,8 @@ public function offsetSet($localName, $value) {} *

* @return bool TRUE on success or FALSE on failure. */ - public function offsetUnset($localName) {} + #[TentativeType] + public function offsetUnset($localName): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.1)
@@ -513,7 +541,8 @@ public function offsetUnset($localName) {} *

* @return bool */ - public function setAlias(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $alias) {} + #[TentativeType] + public function setAlias(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $alias): bool {} /** * (Unknown)
@@ -527,10 +556,11 @@ public function setAlias(#[LanguageLevelTypeAware(['8.0' => 'string'], default: *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function setDefaultStub( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $index = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $webIndex = null - ) {} + ): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -541,7 +571,8 @@ public function setDefaultStub( *

* @return void No value is returned. */ - public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $metadata) {} + #[TentativeType] + public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $metadata): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.1.0)
@@ -566,10 +597,11 @@ public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default *

* @return void No value is returned. */ + #[TentativeType] public function setSignatureAlgorithm( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $algo, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $privateKey = null - ) {} + ): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -594,7 +626,8 @@ public function setStub( * @link https://php.net/manual/en/phar.startbuffering.php * @return void No value is returned. */ - public function startBuffering() {} + #[TentativeType] + public function startBuffering(): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -602,7 +635,8 @@ public function startBuffering() {} * @link https://php.net/manual/en/phar.stopbuffering.php * @return void No value is returned. */ - public function stopBuffering() {} + #[TentativeType] + public function stopBuffering(): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -610,7 +644,7 @@ public function stopBuffering() {} * @link https://php.net/manual/en/phar.apiversion.php * @return string The API version string as in "1.0.0". */ - final public static function apiVersion() {} + final public static function apiVersion(): string {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -623,7 +657,7 @@ final public static function apiVersion() {} *

* @return bool TRUE if compression/decompression is available, FALSE if not. */ - final public static function canCompress(int $compression = 0) {} + final public static function canCompress(int $compression = 0): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -631,7 +665,7 @@ final public static function canCompress(int $compression = 0) {} * @link https://php.net/manual/en/phar.canwrite.php * @return bool TRUE if write access is enabled, FALSE if it is disabled. */ - final public static function canWrite() {} + final public static function canWrite(): bool {} /** * (Unknown)
@@ -643,7 +677,7 @@ final public static function canWrite() {} * that allows the created Phar archive to work with or without the Phar extension * enabled. */ - final public static function createDefaultStub(?string $index = null, ?string $webIndex = null) {} + final public static function createDefaultStub(?string $index = null, ?string $webIndex = null): string {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.0)
@@ -654,7 +688,7 @@ final public static function createDefaultStub(?string $index = null, ?string $w * the zlib extension or the * bz2 extension. */ - final public static function getSupportedCompression() {} + final public static function getSupportedCompression(): array {} /** * (PHP >= 5.3.0, PECL phar >= 1.1.0)
@@ -663,7 +697,7 @@ final public static function getSupportedCompression() {} * @return string[] an array containing any of "MD5", "SHA-1", * "SHA-256", "SHA-512", or "OpenSSL". */ - final public static function getSupportedSignatures() {} + final public static function getSupportedSignatures(): array {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -671,7 +705,7 @@ final public static function getSupportedSignatures() {} * @link https://php.net/manual/en/phar.interceptfilefuncs.php * @return void */ - final public static function interceptFileFuncs() {} + final public static function interceptFileFuncs(): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.0)
@@ -686,7 +720,7 @@ final public static function interceptFileFuncs() {} *

* @return bool TRUE if the filename is valid, FALSE if not. */ - final public static function isValidPharFilename(string $filename, bool $executable = true) {} + final public static function isValidPharFilename(string $filename, bool $executable = true): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -703,7 +737,7 @@ final public static function isValidPharFilename(string $filename, bool $executa *

* @return bool TRUE on success or FALSE on failure. */ - final public static function loadPhar(string $filename, ?string $alias = null) {} + final public static function loadPhar(string $filename, ?string $alias = null): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -718,7 +752,7 @@ final public static function loadPhar(string $filename, ?string $alias = null) { *

* @return bool TRUE on success or FALSE on failure. */ - final public static function mapPhar(?string $alias = null, int $offset = 0) {} + final public static function mapPhar(?string $alias = null, int $offset = 0): bool {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -730,7 +764,7 @@ final public static function mapPhar(?string $alias = null, int $offset = 0) {} *

* @return string the filename if valid, empty string otherwise. */ - final public static function running(bool $returnPhar = true) {} + final public static function running(bool $returnPhar = true): string {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -745,7 +779,7 @@ final public static function running(bool $returnPhar = true) {} *

* @return void No return. PharException is thrown on failure. */ - final public static function mount(string $pharPath, string $externalPath) {} + final public static function mount(string $pharPath, string $externalPath): void {} /** * (Unknown)
@@ -760,7 +794,7 @@ final public static function mount(string $pharPath, string $externalPath) {} *

* @return void No return. */ - final public static function mungServer(array $variables) {} + final public static function mungServer(array $variables): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -772,7 +806,7 @@ final public static function mungServer(array $variables) {} * @throws PharException * @return bool TRUE on success or FALSE on failure. */ - final public static function unlinkArchive(string $filename) {} + final public static function unlinkArchive(string $filename): bool {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -858,7 +892,7 @@ final public static function webPhar( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $fileNotFoundScript = null, array $mimeTypes = null, ?callable $rewrite = null - ) {} + ): void {} /** * Returns whether current entry is a directory and not '.' or '..' @@ -970,13 +1004,15 @@ public function __construct( * @param string $localName * @return bool */ - public function offsetExists($localName) {} + #[TentativeType] + public function offsetExists($localName): bool {} /** * @param string $localName - * @return string + * @return SplFileInfo */ - public function offsetGet($localName) {} + #[TentativeType] + public function offsetGet($localName): SplFileInfo {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -990,7 +1026,8 @@ public function offsetGet($localName) {} *

* @return void No return values. */ - public function offsetSet($localName, $value) {} + #[TentativeType] + public function offsetSet($localName, $value): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -999,9 +1036,10 @@ public function offsetSet($localName, $value) {} * @param string $localName

* The filename (relative path) to modify in the tar/zip archive. *

- * @return bool TRUE on success or FALSE on failure. + * @return void */ - public function offsetUnset($localName) {} + #[TentativeType] + public function offsetUnset($localName): void {} /** * Returns whether current entry is a directory and not '.' or '..' @@ -1099,7 +1137,8 @@ public function __destruct() {} *

* @return void No value is returned. */ - public function chmod(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $perms) {} + #[TentativeType] + public function chmod(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $perms): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
@@ -1137,7 +1176,8 @@ public function delMetadata() {} * @link https://php.net/manual/en/pharfileinfo.getcompressedsize.php * @return int The size in bytes of the file within the Phar archive on disk. */ - public function getCompressedSize() {} + #[TentativeType] + public function getCompressedSize(): int {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -1145,9 +1185,11 @@ public function getCompressedSize() {} * @link https://php.net/manual/en/pharfileinfo.getcrc32.php * @return int The crc32 checksum of the file within the Phar archive. */ - public function getCRC32() {} + #[TentativeType] + public function getCRC32(): int {} - public function getContent() {} + #[TentativeType] + public function getContent(): string {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -1158,7 +1200,8 @@ public function getContent() {} * @return mixed any PHP variable that can be serialized and is stored as meta-data for the file, * or NULL if no meta-data is stored. */ - public function getMetadata(#[PhpStormStubsElementAvailable(from: '8.0')] array $unserializeOptions = []) {} + #[TentativeType] + public function getMetadata(#[PhpStormStubsElementAvailable(from: '8.0')] array $unserializeOptions = []): mixed {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -1166,7 +1209,8 @@ public function getMetadata(#[PhpStormStubsElementAvailable(from: '8.0')] array * @link https://php.net/manual/en/pharfileinfo.getpharflags.php * @return int The Phar flags (always 0 in the current implementation) */ - public function getPharFlags() {} + #[TentativeType] + public function getPharFlags(): int {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.0)
@@ -1174,7 +1218,8 @@ public function getPharFlags() {} * @link https://php.net/manual/en/pharfileinfo.hasmetadata.php * @return bool FALSE if no metadata is set or is NULL, TRUE if metadata is not NULL */ - public function hasMetadata() {} + #[TentativeType] + public function hasMetadata(): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -1186,7 +1231,8 @@ public function hasMetadata() {} *

* @return bool TRUE if the file is compressed within the Phar archive, FALSE if not. */ - public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976) {} + #[TentativeType] + public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -1194,7 +1240,8 @@ public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], def * @link https://php.net/manual/en/pharfileinfo.iscrcchecked.php * @return bool TRUE if the file has had its CRC verified, FALSE if not. */ - public function isCRCChecked() {} + #[TentativeType] + public function isCRCChecked(): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
@@ -1205,6 +1252,7 @@ public function isCRCChecked() {} *

* @return void No value is returned. */ - public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $metadata) {} + #[TentativeType] + public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $metadata): void {} } // End of Phar v.2.0.1 diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 57986c65d..0a79de1d4 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -5786,6 +5786,7 @@ final class PhpStormStubsMap 'xdebug_call_line' => 'xdebug/xdebug.php', 'xdebug_clear_aggr_profiling_data' => 'xdebug/xdebug.php', 'xdebug_code_coverage_started' => 'xdebug/xdebug.php', + 'xdebug_connect_to_client' => 'xdebug/xdebug.php', 'xdebug_debug_zval' => 'xdebug/xdebug.php', 'xdebug_debug_zval_stdout' => 'xdebug/xdebug.php', 'xdebug_disable' => 'xdebug/xdebug.php', @@ -5810,6 +5811,7 @@ final class PhpStormStubsMap 'xdebug_is_debugger_active' => 'xdebug/xdebug.php', 'xdebug_is_enabled' => 'xdebug/xdebug.php', 'xdebug_memory_usage' => 'xdebug/xdebug.php', + 'xdebug_notify' => 'xdebug/xdebug.php', 'xdebug_peak_memory_usage' => 'xdebug/xdebug.php', 'xdebug_print_function_stack' => 'xdebug/xdebug.php', 'xdebug_set_filter' => 'xdebug/xdebug.php', diff --git a/Reflection/Reflection.php b/Reflection/Reflection.php index df3865e0a..545839c76 100644 --- a/Reflection/Reflection.php +++ b/Reflection/Reflection.php @@ -2,6 +2,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; /** * The reflection class. @@ -17,7 +18,8 @@ class Reflection * @param int $modifiers Bitfield of the modifiers to get. * @return array An array of modifier names. */ - public static function getModifierNames(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $modifiers) {} + #[TentativeType] + public static function getModifierNames(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $modifiers): array {} /** * Exports diff --git a/Reflection/ReflectionAttribute.php b/Reflection/ReflectionAttribute.php index d45f0cead..cedc70fb5 100644 --- a/Reflection/ReflectionAttribute.php +++ b/Reflection/ReflectionAttribute.php @@ -30,7 +30,7 @@ private function __construct() {} * @since 8.0 */ #[Pure] - public function getName() {} + public function getName(): string {} /** * Returns the target of the attribute as a bit mask format. @@ -39,7 +39,7 @@ public function getName() {} * @since 8.0 */ #[Pure] - public function getTarget() {} + public function getTarget(): int {} /** * Returns {@see true} if the attribute is repeated. @@ -48,7 +48,7 @@ public function getTarget() {} * @since 8.0 */ #[Pure] - public function isRepeated() {} + public function isRepeated(): bool {} /** * Gets list of passed attribute's arguments. @@ -57,7 +57,7 @@ public function isRepeated() {} * @since 8.0 */ #[Pure] - public function getArguments() {} + public function getArguments(): array {} /** * Creates a new instance of the attribute with passed arguments @@ -65,7 +65,7 @@ public function getArguments() {} * @return object * @since 8.0 */ - public function newInstance() {} + public function newInstance(): object {} /** * ReflectionAttribute cannot be cloned @@ -73,9 +73,9 @@ public function newInstance() {} * @return void * @since 8.0 */ - private function __clone() {} + private function __clone(): void {} - public function __toString() {} + public function __toString(): string {} public static function export() {} } diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index a61a32cdc..a9182a5de 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -2,8 +2,9 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Immutable; -use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -47,7 +48,7 @@ class ReflectionClass implements Reflector * @link https://php.net/manual/en/reflectionclass.construct.php * @param string|object $objectOrClass Either a string containing the name of * the class to reflect, or an object. - * @throws \ReflectionException if the class does not exist. + * @throws ReflectionException if the class does not exist. */ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'object|string'], default: '')] $objectOrClass) {} @@ -71,6 +72,7 @@ public static function export($argument, $return = false) {} * @link https://php.net/manual/en/reflectionclass.tostring.php * @return string A string representation of this {@see ReflectionClass} instance. */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -80,7 +82,8 @@ public function __toString() {} * @return string The class name. */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Checks if class is defined internally by an extension, or the core @@ -89,7 +92,8 @@ public function getName() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isInternal() {} + #[TentativeType] + public function isInternal(): bool {} /** * Checks if user defined @@ -98,7 +102,8 @@ public function isInternal() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isUserDefined() {} + #[TentativeType] + public function isUserDefined(): bool {} /** * Checks if the class is instantiable @@ -107,7 +112,8 @@ public function isUserDefined() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isInstantiable() {} + #[TentativeType] + public function isInstantiable(): bool {} /** * Returns whether this class is cloneable @@ -117,7 +123,8 @@ public function isInstantiable() {} * @since 5.4 */ #[Pure] - public function isCloneable() {} + #[TentativeType] + public function isCloneable(): bool {} /** * Gets the filename of the file in which the class has been defined @@ -128,7 +135,8 @@ public function isCloneable() {} * is returned. */ #[Pure] - public function getFileName() {} + #[TentativeType] + public function getFileName(): string|false {} /** * Gets starting line number @@ -137,7 +145,8 @@ public function getFileName() {} * @return int The starting line number, as an integer. */ #[Pure] - public function getStartLine() {} + #[TentativeType] + public function getStartLine(): int|false {} /** * Gets end line @@ -147,7 +156,8 @@ public function getStartLine() {} * {@see false} if unknown. */ #[Pure] - public function getEndLine() {} + #[TentativeType] + public function getEndLine(): int|false {} /** * Gets doc comments @@ -156,7 +166,8 @@ public function getEndLine() {} * @return string|false The doc comment if it exists, otherwise {@see false} */ #[Pure] - public function getDocComment() {} + #[TentativeType] + public function getDocComment(): string|false {} /** * Gets the constructor of the class @@ -166,7 +177,8 @@ public function getDocComment() {} * the class' constructor, or {@see null} if the class has no constructor. */ #[Pure] - public function getConstructor() {} + #[TentativeType] + public function getConstructor(): ?ReflectionMethod {} /** * Checks if method is defined @@ -175,7 +187,8 @@ public function getConstructor() {} * @param string $name Name of the method being checked for. * @return bool Returns {@see true} if it has the method, otherwise {@see false} */ - public function hasMethod(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function hasMethod(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Gets a ReflectionMethod for a class method. @@ -183,10 +196,11 @@ public function hasMethod(#[LanguageLevelTypeAware(['8.0' => 'string'], default: * @link https://php.net/manual/en/reflectionclass.getmethod.php * @param string $name The method name to reflect. * @return ReflectionMethod A {@see ReflectionMethod} - * @throws \ReflectionException if the method does not exist. + * @throws ReflectionException if the method does not exist. */ #[Pure] - public function getMethod(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function getMethod(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): ReflectionMethod {} /** * Gets an array of methods for the class. @@ -198,7 +212,8 @@ public function getMethod(#[LanguageLevelTypeAware(['8.0' => 'string'], default: * reflecting each method. */ #[Pure] - public function getMethods(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $filter = null) {} + #[TentativeType] + public function getMethods(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $filter = null): array {} /** * Checks if property is defined @@ -207,7 +222,8 @@ public function getMethods(#[LanguageLevelTypeAware(['8.0' => 'int|null'], defau * @param string $name Name of the property being checked for. * @return bool Returns {@see true} if it has the property, otherwise {@see false} */ - public function hasProperty(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function hasProperty(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Gets a ReflectionProperty for a class's property @@ -218,7 +234,8 @@ public function hasProperty(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @throws ReflectionException If no property exists by that name. */ #[Pure] - public function getProperty(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function getProperty(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): ReflectionProperty {} /** * Gets properties @@ -230,18 +247,20 @@ public function getProperty(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return ReflectionProperty[] */ #[Pure] - public function getProperties(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $filter = null) {} + #[TentativeType] + public function getProperties(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $filter = null): array {} /** * Gets a ReflectionClassConstant for a class's property * * @link https://php.net/manual/en/reflectionclass.getreflectionconstant.php * @param string $name The class constant name. - * @return ReflectionClassConstant A {@see ReflectionClassConstant}. + * @return ReflectionClassConstant|false A {@see ReflectionClassConstant}. * @since 7.1 */ #[Pure] - public function getReflectionConstant(string $name) {} + #[TentativeType] + public function getReflectionConstant(string $name): ReflectionClassConstant|false {} /** * Gets class constants @@ -252,7 +271,8 @@ public function getReflectionConstant(string $name) {} * @since 7.1 */ #[Pure] - public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE) {} + #[TentativeType] + public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE): array {} /** * Checks if constant is defined @@ -261,7 +281,8 @@ public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8. * @param string $name The name of the constant being checked for. * @return bool Returns {@see true} if the constant is defined, otherwise {@see false} */ - public function hasConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function hasConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Gets constants @@ -272,7 +293,8 @@ public function hasConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * the values the value of the constants. */ #[Pure] - public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE) {} + #[TentativeType] + public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE): array {} /** * Gets defined constant @@ -283,7 +305,8 @@ public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int * Returns {@see false} if the constant was not found in the class. */ #[Pure] - public function getConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function getConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): mixed {} /** * Gets the interfaces @@ -293,7 +316,8 @@ public function getConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * names and the array values as {@see ReflectionClass} objects. */ #[Pure] - public function getInterfaces() {} + #[TentativeType] + public function getInterfaces(): array {} /** * Gets the interface names @@ -302,7 +326,8 @@ public function getInterfaces() {} * @return string[] A numerical array with interface names as the values. */ #[Pure] - public function getInterfaceNames() {} + #[TentativeType] + public function getInterfaceNames(): array {} /** * Checks if the class is anonymous @@ -312,7 +337,8 @@ public function getInterfaceNames() {} * @since 7.0 */ #[Pure] - public function isAnonymous() {} + #[TentativeType] + public function isAnonymous(): bool {} /** * Checks if the class is an interface @@ -321,19 +347,20 @@ public function isAnonymous() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isInterface() {} + #[TentativeType] + public function isInterface(): bool {} /** * Returns an array of traits used by this class * * @link https://php.net/manual/en/reflectionclass.gettraits.php - * @return ReflectionClass[]|null an array with trait names in keys and + * @return ReflectionClass[] an array with trait names in keys and * instances of trait's {@see ReflectionClass} in values. - * Returns {@see null} in case of an error. * @since 5.4 */ #[Pure] - public function getTraits() {} + #[TentativeType] + public function getTraits(): array {} /** * Returns an array of names of traits used by this class @@ -344,7 +371,8 @@ public function getTraits() {} * @since 5.4 */ #[Pure] - public function getTraitNames() {} + #[TentativeType] + public function getTraitNames(): array {} /** * Returns an array of trait aliases @@ -356,7 +384,8 @@ public function getTraitNames() {} * @since 5.4 */ #[Pure] - public function getTraitAliases() {} + #[TentativeType] + public function getTraitAliases(): array {} /** * Returns whether this is a trait @@ -367,7 +396,8 @@ public function getTraitAliases() {} * @since 5.4 */ #[Pure] - public function isTrait() {} + #[TentativeType] + public function isTrait(): bool {} /** * Checks if class is abstract @@ -376,7 +406,8 @@ public function isTrait() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isAbstract() {} + #[TentativeType] + public function isAbstract(): bool {} /** * Checks if class is final @@ -385,7 +416,8 @@ public function isAbstract() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isFinal() {} + #[TentativeType] + public function isFinal(): bool {} /** * Gets modifiers @@ -394,7 +426,8 @@ public function isFinal() {} * @return int bitmask of modifier constants. */ #[Pure] - public function getModifiers() {} + #[TentativeType] + public function getModifiers(): int {} /** * Checks class for instance @@ -404,7 +437,8 @@ public function getModifiers() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isInstance(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object) {} + #[TentativeType] + public function isInstance(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object): bool {} /** * Creates a new class instance from given arguments. @@ -429,20 +463,22 @@ public function newInstance(...$args) {} * onwards, this exception is limited only to internal classes that are final. * @since 5.4 */ - public function newInstanceWithoutConstructor() {} + #[TentativeType] + public function newInstanceWithoutConstructor(): object {} /** * Creates a new class instance from given arguments. * * @link https://php.net/manual/en/reflectionclass.newinstanceargs.php * @param array $args The parameters to be passed to the class constructor as an array. - * @return object a new instance of the class. + * @return object|null a new instance of the class. * @throws ReflectionException if the class constructor is not public or if * the class does not have a constructor and the $args parameter contains * one or more parameters. * @since 5.1.3 */ - public function newInstanceArgs(array $args = []) {} + #[TentativeType] + public function newInstanceArgs(array $args = []): ?object {} /** * Gets parent class @@ -452,7 +488,8 @@ public function newInstanceArgs(array $args = []) {} * if there's no parent. */ #[Pure] - public function getParentClass() {} + #[TentativeType] + public function getParentClass(): ReflectionClass|false {} /** * Checks if a subclass @@ -463,17 +500,19 @@ public function getParentClass() {} * @return bool {@see true} on success or {@see false} on failure. */ #[Pure] - public function isSubclassOf(#[LanguageLevelTypeAware(['8.0' => 'ReflectionClass|string'], default: '')] $class) {} + #[TentativeType] + public function isSubclassOf(#[LanguageLevelTypeAware(['8.0' => 'ReflectionClass|string'], default: '')] $class): bool {} /** * Gets static properties * * @link https://php.net/manual/en/reflectionclass.getstaticproperties.php - * @return mixed[] The static properties, as an array where the keys hold + * @return array|null The static properties, as an array where the keys hold * the name and the values the value of the properties. */ #[Pure] - public function getStaticProperties() {} + #[TentativeType] + public function getStaticProperties(): ?array {} /** * Gets static property value @@ -486,10 +525,11 @@ public function getStaticProperties() {} * @return mixed The value of the static property. */ #[Pure] + #[TentativeType] public function getStaticPropertyValue( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $default = null - ) {} + ): mixed {} /** * Sets static property value @@ -499,10 +539,11 @@ public function getStaticPropertyValue( * @param mixed $value New property value. * @return void No value is returned. */ + #[TentativeType] public function setStaticPropertyValue( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value - ) {} + ): void {} /** * Gets default properties @@ -515,7 +556,8 @@ public function setStaticPropertyValue( * not take visibility modifiers into account. */ #[Pure] - public function getDefaultProperties() {} + #[TentativeType] + public function getDefaultProperties(): array {} /** * An alias of {@see ReflectionClass::isIterable} method. @@ -524,7 +566,8 @@ public function getDefaultProperties() {} * @return bool Returns {@see true} on success or {@see false} on failure. */ #[Pure] - public function isIterateable() {} + #[TentativeType] + public function isIterateable(): bool {} /** * Check whether this class is iterable @@ -534,7 +577,8 @@ public function isIterateable() {} * @since 7.2 */ #[Pure] - public function isIterable() {} + #[TentativeType] + public function isIterable(): bool {} /** * Checks whether it implements an interface. @@ -543,17 +587,19 @@ public function isIterable() {} * @param string $interface The interface name. * @return bool Returns {@see true} on success or {@see false} on failure. */ - public function implementsInterface(#[LanguageLevelTypeAware(['8.0' => 'ReflectionClass|string'], default: '')] $interface) {} + #[TentativeType] + public function implementsInterface(#[LanguageLevelTypeAware(['8.0' => 'ReflectionClass|string'], default: '')] $interface): bool {} /** * Gets a ReflectionExtension object for the extension which defined the class * * @link https://php.net/manual/en/reflectionclass.getextension.php - * @return ReflectionExtension A {@see ReflectionExtension} object representing + * @return ReflectionExtension|null A {@see ReflectionExtension} object representing * the extension which defined the class, or {@see null} for user-defined classes. */ #[Pure] - public function getExtension() {} + #[TentativeType] + public function getExtension(): ?ReflectionExtension {} /** * Gets the name of the extension which defined the class @@ -563,7 +609,8 @@ public function getExtension() {} * or {@see false} for user-defined classes. */ #[Pure] - public function getExtensionName() {} + #[TentativeType] + public function getExtensionName(): string|false {} /** * Checks if in namespace @@ -571,7 +618,8 @@ public function getExtensionName() {} * @link https://php.net/manual/en/reflectionclass.innamespace.php * @return bool {@see true} on success or {@see false} on failure. */ - public function inNamespace() {} + #[TentativeType] + public function inNamespace(): bool {} /** * Gets namespace name @@ -580,7 +628,8 @@ public function inNamespace() {} * @return string The namespace name. */ #[Pure] - public function getNamespaceName() {} + #[TentativeType] + public function getNamespaceName(): string {} /** * Gets short name @@ -589,7 +638,8 @@ public function getNamespaceName() {} * @return string The class short name. */ #[Pure] - public function getShortName() {} + #[TentativeType] + public function getShortName(): string {} /** * Returns an array of function attributes. @@ -600,7 +650,7 @@ public function getShortName() {} * @since 8.0 */ #[Pure] - public function getAttributes(?string $name = null, int $flags = 0) {} + public function getAttributes(?string $name = null, int $flags = 0): array {} /** * Clones object @@ -608,8 +658,8 @@ public function getAttributes(?string $name = null, int $flags = 0) {} * @link https://php.net/manual/en/reflectionclass.clone.php * @return void */ - final private function __clone() {} + final private function __clone(): void {} #[PhpStormStubsElementAvailable('8.1')] - public function isEnum() {} + public function isEnum(): bool {} } diff --git a/Reflection/ReflectionClassConstant.php b/Reflection/ReflectionClassConstant.php index 6432e9e1e..0308e17fd 100644 --- a/Reflection/ReflectionClassConstant.php +++ b/Reflection/ReflectionClassConstant.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\Immutable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -92,7 +93,8 @@ public static function export($class, $name, $return = false) {} * @since 7.1 */ #[Pure] - public function getDeclaringClass() {} + #[TentativeType] + public function getDeclaringClass(): ReflectionClass {} /** * Gets doc comments @@ -102,7 +104,8 @@ public function getDeclaringClass() {} * @since 7.1 */ #[Pure] - public function getDocComment() {} + #[TentativeType] + public function getDocComment(): string|false {} /** * Gets the class constant modifiers @@ -113,7 +116,8 @@ public function getDocComment() {} * @since 7.1 */ #[Pure] - public function getModifiers() {} + #[TentativeType] + public function getModifiers(): int {} /** * Get name of the constant @@ -123,7 +127,8 @@ public function getModifiers() {} * @since 7.1 */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Gets value @@ -133,7 +138,8 @@ public function getName() {} * @since 7.1 */ #[Pure] - public function getValue() {} + #[TentativeType] + public function getValue(): mixed {} /** * Checks if class constant is private @@ -143,7 +149,8 @@ public function getValue() {} * @since 7.1 */ #[Pure] - public function isPrivate() {} + #[TentativeType] + public function isPrivate(): bool {} /** * Checks if class constant is protected @@ -153,7 +160,8 @@ public function isPrivate() {} * @since 7.1 */ #[Pure] - public function isProtected() {} + #[TentativeType] + public function isProtected(): bool {} /** * Checks if class constant is public @@ -163,7 +171,8 @@ public function isProtected() {} * @since 7.1 */ #[Pure] - public function isPublic() {} + #[TentativeType] + public function isPublic(): bool {} /** * Returns the string representation of the ReflectionClassConstant object. @@ -172,7 +181,7 @@ public function isPublic() {} * @return string * @since 7.1 */ - public function __toString() {} + public function __toString(): string {} /** * Returns an array of constant attributes. @@ -183,21 +192,21 @@ public function __toString() {} * @since 8.0 */ #[Pure] - public function getAttributes(?string $name = null, int $flags = 0) {} + public function getAttributes(?string $name = null, int $flags = 0): array {} /** * ReflectionClassConstant cannot be cloned * * @return void */ - final private function __clone() {} + final private function __clone(): void {} #[PhpStormStubsElementAvailable('8.1')] - public function isEnumCase() {} + public function isEnumCase(): bool {} /** - * @since 8.1 * @return bool + * @since 8.1 */ public function isFinal(): bool {} } diff --git a/Reflection/ReflectionEnum.php b/Reflection/ReflectionEnum.php index 11bb9af2b..4ffa87d49 100644 --- a/Reflection/ReflectionEnum.php +++ b/Reflection/ReflectionEnum.php @@ -12,26 +12,26 @@ public function __construct(object|string $objectOrClass) {} * @param string $name * @return bool */ - public function hasCase(string $name) {} + public function hasCase(string $name): bool {} /** * @return ReflectionEnumPureCase[]|ReflectionEnumBackedCase[] */ - public function getCases() {} + public function getCases(): array {} /** - * @throws ReflectionException If no found single reflection object for the corresponding case * @return ReflectionEnumPureCase|ReflectionEnumBackedCase + * @throws ReflectionException If no found single reflection object for the corresponding case */ - public function getCase(string $name) {} + public function getCase(string $name): ReflectionEnumUnitCase {} /** * @return bool */ - public function isBacked() {} + public function isBacked(): bool {} /** * @return ReflectionType|null */ - public function getBackingType() {} + public function getBackingType(): ?ReflectionType {} } diff --git a/Reflection/ReflectionEnumBackedCase.php b/Reflection/ReflectionEnumBackedCase.php index e59b5ec2e..4db1bbc1a 100644 --- a/Reflection/ReflectionEnumBackedCase.php +++ b/Reflection/ReflectionEnumBackedCase.php @@ -8,8 +8,5 @@ class ReflectionEnumBackedCase extends ReflectionEnumUnitCase { public function __construct(object|string $class, string $constant) {} - /** - * @return int|string - */ - public function getBackingValue() {} + public function getBackingValue(): int|string {} } diff --git a/Reflection/ReflectionEnumUnitCase.php b/Reflection/ReflectionEnumUnitCase.php index 757f08070..8875b3264 100644 --- a/Reflection/ReflectionEnumUnitCase.php +++ b/Reflection/ReflectionEnumUnitCase.php @@ -8,10 +8,10 @@ class ReflectionEnumUnitCase extends ReflectionClassConstant { public function __construct(object|string $class, string $constant) {} - public function getValue() {} + public function getValue(): UnitEnum {} /** * @return ReflectionEnum */ - public function getEnum() {} + public function getEnum(): ReflectionEnum {} } diff --git a/Reflection/ReflectionExtension.php b/Reflection/ReflectionExtension.php index f342432fc..357f90244 100644 --- a/Reflection/ReflectionExtension.php +++ b/Reflection/ReflectionExtension.php @@ -3,6 +3,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Immutable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -24,7 +25,7 @@ class ReflectionExtension implements Reflector * * @link https://php.net/manual/en/reflectionextension.construct.php * @param string $name Name of the extension. - * @throws \ReflectionException if the extension does not exist. + * @throws ReflectionException if the extension does not exist. */ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} @@ -51,6 +52,7 @@ public static function export($name, $return = false) {} * @return string the exported extension as a string, in the same way as * the {@see ReflectionExtension::export()}. */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -60,16 +62,18 @@ public function __toString() {} * @return string The extensions name. */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Gets extension version * * @link https://php.net/manual/en/reflectionextension.getversion.php - * @return string The version of the extension. + * @return string|null The version of the extension. */ #[Pure] - public function getVersion() {} + #[TentativeType] + public function getVersion(): ?string {} /** * Gets extension functions @@ -80,7 +84,8 @@ public function getVersion() {} * names. If no function are defined, an empty array is returned. */ #[Pure] - public function getFunctions() {} + #[TentativeType] + public function getFunctions(): array {} /** * Gets constants @@ -89,7 +94,8 @@ public function getFunctions() {} * @return array An associative array with constant names as keys. */ #[Pure] - public function getConstants() {} + #[TentativeType] + public function getConstants(): array {} /** * Gets extension ini entries @@ -99,7 +105,8 @@ public function getConstants() {} * with their defined values as values. */ #[Pure] - public function getINIEntries() {} + #[TentativeType] + public function getINIEntries(): array {} /** * Gets classes @@ -110,7 +117,8 @@ public function getINIEntries() {} * an empty array is returned. */ #[Pure] - public function getClasses() {} + #[TentativeType] + public function getClasses(): array {} /** * Gets class names @@ -120,7 +128,8 @@ public function getClasses() {} * If no classes are defined, an empty array is returned. */ #[Pure] - public function getClassNames() {} + #[TentativeType] + public function getClassNames(): array {} /** * Gets dependencies @@ -130,7 +139,8 @@ public function getClassNames() {} * either Required, Optional or Conflicts as the values. */ #[Pure] - public function getDependencies() {} + #[TentativeType] + public function getDependencies(): array {} /** * Print extension info @@ -138,7 +148,8 @@ public function getDependencies() {} * @link https://php.net/manual/en/reflectionextension.info.php * @return void Print extension info */ - public function info() {} + #[TentativeType] + public function info(): void {} /** * Returns whether this extension is persistent @@ -148,7 +159,8 @@ public function info() {} * @since 5.4 */ #[Pure] - public function isPersistent() {} + #[TentativeType] + public function isPersistent(): bool {} /** * Returns whether this extension is temporary @@ -158,7 +170,8 @@ public function isPersistent() {} * @since 5.4 */ #[Pure] - public function isTemporary() {} + #[TentativeType] + public function isTemporary(): bool {} /** * Clones @@ -166,5 +179,5 @@ public function isTemporary() {} * @link https://php.net/manual/en/reflectionextension.clone.php * @return void No value is returned, if called a fatal error will occur. */ - final private function __clone() {} + final private function __clone(): void {} } diff --git a/Reflection/ReflectionFiber.php b/Reflection/ReflectionFiber.php index dd1e19143..f590fa197 100644 --- a/Reflection/ReflectionFiber.php +++ b/Reflection/ReflectionFiber.php @@ -7,29 +7,13 @@ final class ReflectionFiber { public function __construct(Fiber $fiber) {} - /** - * @return Fiber - */ - public function getFiber() {} + public function getFiber(): Fiber {} - /** - * @return string - */ - public function getExecutingFile() {} + public function getExecutingFile(): string {} - /** - * @return int - */ - public function getExecutingLine() {} + public function getExecutingLine(): int {} - /** - * @return callable - */ - public function getCallable() {} + public function getCallable(): callable {} - /** - * @param int $options - * @return array - */ - public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) {} + public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {} } diff --git a/Reflection/ReflectionFunction.php b/Reflection/ReflectionFunction.php index 0647bd866..9fd435d6c 100644 --- a/Reflection/ReflectionFunction.php +++ b/Reflection/ReflectionFunction.php @@ -3,6 +3,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Immutable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -40,6 +41,7 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'Closure|string'] * * @link https://php.net/manual/en/reflectionfunction.tostring.php */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -65,7 +67,8 @@ public static function export($name, $return = false) {} */ #[Deprecated(since: '8.0')] #[Pure] - public function isDisabled() {} + #[TentativeType] + public function isDisabled(): bool {} /** * Invokes function @@ -76,7 +79,8 @@ public function isDisabled() {} * like {@see call_user_func} is. * @return mixed Returns the result of the invoked function call. */ - public function invoke(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args) {} + #[TentativeType] + public function invoke(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args): mixed {} /** * Invokes function args @@ -86,7 +90,8 @@ public function invoke(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '') * like {@see call_user_func_array} works. * @return mixed the result of the invoked function */ - public function invokeArgs(array $args) {} + #[TentativeType] + public function invokeArgs(array $args): mixed {} /** * Returns a dynamically created closure for the function @@ -95,5 +100,6 @@ public function invokeArgs(array $args) {} * @return Closure Returns {@see Closure} or {@see null} in case of an error. */ #[Pure] - public function getClosure() {} + #[TentativeType] + public function getClosure(): Closure {} } diff --git a/Reflection/ReflectionFunctionAbstract.php b/Reflection/ReflectionFunctionAbstract.php index e68ad3502..05e79065b 100644 --- a/Reflection/ReflectionFunctionAbstract.php +++ b/Reflection/ReflectionFunctionAbstract.php @@ -3,6 +3,7 @@ use JetBrains\PhpStorm\Immutable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -26,7 +27,7 @@ abstract class ReflectionFunctionAbstract implements Reflector * @link https://php.net/manual/en/reflectionfunctionabstract.clone.php * @return void */ - final private function __clone() {} + final private function __clone(): void {} /** * Checks if function in namespace @@ -34,7 +35,8 @@ final private function __clone() {} * @link https://php.net/manual/en/reflectionfunctionabstract.innamespace.php * @return bool {@see true} if it's in a namespace, otherwise {@see false} */ - public function inNamespace() {} + #[TentativeType] + public function inNamespace(): bool {} /** * Checks if closure @@ -43,7 +45,8 @@ public function inNamespace() {} * @return bool {@see true} if it's a closure, otherwise {@see false} */ #[Pure] - public function isClosure() {} + #[TentativeType] + public function isClosure(): bool {} /** * Checks if deprecated @@ -52,7 +55,8 @@ public function isClosure() {} * @return bool {@see true} if it's deprecated, otherwise {@see false} */ #[Pure] - public function isDeprecated() {} + #[TentativeType] + public function isDeprecated(): bool {} /** * Checks if is internal @@ -61,7 +65,8 @@ public function isDeprecated() {} * @return bool {@see true} if it's internal, otherwise {@see false} */ #[Pure] - public function isInternal() {} + #[TentativeType] + public function isInternal(): bool {} /** * Checks if user defined @@ -70,7 +75,8 @@ public function isInternal() {} * @return bool {@see true} if it's user-defined, otherwise {@see false} */ #[Pure] - public function isUserDefined() {} + #[TentativeType] + public function isUserDefined(): bool {} /** * Returns whether this function is a generator @@ -80,7 +86,8 @@ public function isUserDefined() {} * @since 5.5 */ #[Pure] - public function isGenerator() {} + #[TentativeType] + public function isGenerator(): bool {} /** * Returns whether this function is variadic @@ -90,7 +97,8 @@ public function isGenerator() {} * @since 5.6 */ #[Pure] - public function isVariadic() {} + #[TentativeType] + public function isVariadic(): bool {} /** * Returns this pointer bound to closure @@ -99,7 +107,8 @@ public function isVariadic() {} * @return object|null Returns $this pointer or {@see null} in case of an error. */ #[Pure] - public function getClosureThis() {} + #[TentativeType] + public function getClosureThis(): ?object {} /** * Returns the scope associated to the closure @@ -110,7 +119,8 @@ public function getClosureThis() {} * @since 5.4 */ #[Pure] - public function getClosureScopeClass() {} + #[TentativeType] + public function getClosureScopeClass(): ?ReflectionClass {} /** * Gets doc comment @@ -119,7 +129,8 @@ public function getClosureScopeClass() {} * @return string|false The doc comment if it exists, otherwise {@see false} */ #[Pure] - public function getDocComment() {} + #[TentativeType] + public function getDocComment(): string|false {} /** * Gets end line number @@ -129,7 +140,8 @@ public function getDocComment() {} * or {@see false} if unknown. */ #[Pure] - public function getEndLine() {} + #[TentativeType] + public function getEndLine(): int|false {} /** * Gets extension info @@ -139,16 +151,18 @@ public function getEndLine() {} * {@see ReflectionExtension} object or {@see null} instead. */ #[Pure] - public function getExtension() {} + #[TentativeType] + public function getExtension(): ?ReflectionExtension {} /** * Gets extension name * * @link https://php.net/manual/en/reflectionfunctionabstract.getextensionname.php - * @return string|null The extension's name or {@see null} instead. + * @return string|false The extension's name or {@see false} instead. */ #[Pure] - public function getExtensionName() {} + #[TentativeType] + public function getExtensionName(): string|false {} /** * Gets file name @@ -157,7 +171,8 @@ public function getExtensionName() {} * @return string|false The file name or {@see false} in case of error. */ #[Pure] - public function getFileName() {} + #[TentativeType] + public function getFileName(): string|false {} /** * Gets function name @@ -166,7 +181,8 @@ public function getFileName() {} * @return string The name of the function. */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Gets namespace name @@ -175,7 +191,8 @@ public function getName() {} * @return string The namespace name. */ #[Pure] - public function getNamespaceName() {} + #[TentativeType] + public function getNamespaceName(): string {} /** * Gets number of parameters @@ -185,7 +202,8 @@ public function getNamespaceName() {} * @since 5.0.3 */ #[Pure] - public function getNumberOfParameters() {} + #[TentativeType] + public function getNumberOfParameters(): int {} /** * Gets number of required parameters @@ -195,7 +213,8 @@ public function getNumberOfParameters() {} * @since 5.0.3 */ #[Pure] - public function getNumberOfRequiredParameters() {} + #[TentativeType] + public function getNumberOfRequiredParameters(): int {} /** * Gets parameters @@ -204,7 +223,8 @@ public function getNumberOfRequiredParameters() {} * @return ReflectionParameter[] The parameters, as a ReflectionParameter objects. */ #[Pure] - public function getParameters() {} + #[TentativeType] + public function getParameters(): array {} /** * Gets the specified return type of a function @@ -223,7 +243,8 @@ public function getParameters() {} ], default: 'ReflectionType|null' )] - public function getReturnType() {} + #[TentativeType] + public function getReturnType(): ?ReflectionType {} /** * Gets function short name @@ -232,7 +253,8 @@ public function getReturnType() {} * @return string The short name of the function. */ #[Pure] - public function getShortName() {} + #[TentativeType] + public function getShortName(): string {} /** * Gets starting line number @@ -241,7 +263,8 @@ public function getShortName() {} * @return int|false The starting line number or {@see false} if unknown. */ #[Pure] - public function getStartLine() {} + #[TentativeType] + public function getStartLine(): int|false {} /** * Gets static variables @@ -250,7 +273,8 @@ public function getStartLine() {} * @return array An array of static variables. */ #[Pure] - public function getStaticVariables() {} + #[TentativeType] + public function getStaticVariables(): array {} /** * Checks if returns reference @@ -258,7 +282,8 @@ public function getStaticVariables() {} * @link https://php.net/manual/en/reflectionfunctionabstract.returnsreference.php * @return bool {@see true} if it returns a reference, otherwise {@see false} */ - public function returnsReference() {} + #[TentativeType] + public function returnsReference(): bool {} /** * Checks if the function has a specified return type @@ -268,7 +293,8 @@ public function returnsReference() {} * type, otherwise {@see false}. * @since 7.0 */ - public function hasReturnType() {} + #[TentativeType] + public function hasReturnType(): bool {} /** * Returns an array of function attributes. @@ -279,7 +305,7 @@ public function hasReturnType() {} * @since 8.0 */ #[Pure] - public function getAttributes(?string $name = null, int $flags = 0) {} + public function getAttributes(?string $name = null, int $flags = 0): array {} #[PhpStormStubsElementAvailable('8.1')] #[Pure] @@ -295,5 +321,6 @@ public function getTentativeReturnType(): ?ReflectionType {} #[PhpStormStubsElementAvailable('8.1')] #[Pure] + #[TentativeType] public function isStatic(): bool {} } diff --git a/Reflection/ReflectionGenerator.php b/Reflection/ReflectionGenerator.php index be56f600c..608a007a1 100644 --- a/Reflection/ReflectionGenerator.php +++ b/Reflection/ReflectionGenerator.php @@ -1,5 +1,6 @@ 'object|string'], default: '')] $objectOrMethod, @@ -101,6 +102,7 @@ public static function export($class, $name, $return = false) {} * @link https://php.net/manual/en/reflectionmethod.tostring.php * @return string A string representation of this {@see ReflectionMethod} instance. */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -110,7 +112,8 @@ public function __toString() {} * @return bool Returns {@see true} if the method is public, otherwise {@see false} */ #[Pure] - public function isPublic() {} + #[TentativeType] + public function isPublic(): bool {} /** * Checks if method is private @@ -119,7 +122,8 @@ public function isPublic() {} * @return bool Returns {@see true} if the method is private, otherwise {@see false} */ #[Pure] - public function isPrivate() {} + #[TentativeType] + public function isPrivate(): bool {} /** * Checks if method is protected @@ -128,7 +132,8 @@ public function isPrivate() {} * @return bool Returns {@see true} if the method is protected, otherwise {@see false} */ #[Pure] - public function isProtected() {} + #[TentativeType] + public function isProtected(): bool {} /** * Checks if method is abstract @@ -137,7 +142,8 @@ public function isProtected() {} * @return bool Returns {@see true} if the method is abstract, otherwise {@see false} */ #[Pure] - public function isAbstract() {} + #[TentativeType] + public function isAbstract(): bool {} /** * Checks if method is final @@ -146,7 +152,8 @@ public function isAbstract() {} * @return bool Returns {@see true} if the method is final, otherwise {@see false} */ #[Pure] - public function isFinal() {} + #[TentativeType] + public function isFinal(): bool {} /** * Checks if method is static @@ -155,7 +162,8 @@ public function isFinal() {} * @return bool Returns {@see true} if the method is static, otherwise {@see false} */ #[Pure] - public function isStatic() {} + #[TentativeType] + public function isStatic(): bool {} /** * Checks if method is a constructor @@ -164,7 +172,8 @@ public function isStatic() {} * @return bool Returns {@see true} if the method is a constructor, otherwise {@see false} */ #[Pure] - public function isConstructor() {} + #[TentativeType] + public function isConstructor(): bool {} /** * Checks if method is a destructor @@ -173,7 +182,8 @@ public function isConstructor() {} * @return bool Returns {@see true} if the method is a destructor, otherwise {@see false} */ #[Pure] - public function isDestructor() {} + #[TentativeType] + public function isDestructor(): bool {} /** * Returns a dynamically created closure for the method @@ -184,7 +194,8 @@ public function isDestructor() {} * @since 5.4 */ #[Pure] - public function getClosure(#[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object = null) {} + #[TentativeType] + public function getClosure(#[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object = null): Closure {} /** * Gets the method modifiers @@ -204,7 +215,8 @@ public function getClosure(#[LanguageLevelTypeAware(['8.0' => 'object|null'], de * - {@see ReflectionMethod::IS_FINAL} - Indicates that the method is final. */ #[Pure] - public function getModifiers() {} + #[TentativeType] + public function getModifiers(): int {} /** * Invokes a reflected method. @@ -234,7 +246,8 @@ public function invoke($object, ...$args) {} * instance of the class that this method was declared in or the method * invocation failed. */ - public function invokeArgs(#[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object, array $args) {} + #[TentativeType] + public function invokeArgs(#[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object, array $args): mixed {} /** * Gets declaring class for the reflected method. @@ -244,7 +257,8 @@ public function invokeArgs(#[LanguageLevelTypeAware(['8.0' => 'object|null'], de * reflected method is part of. */ #[Pure] - public function getDeclaringClass() {} + #[TentativeType] + public function getDeclaringClass(): ReflectionClass {} /** * Gets the method prototype (if there is one). @@ -254,7 +268,8 @@ public function getDeclaringClass() {} * @throws ReflectionException if the method does not have a prototype */ #[Pure] - public function getPrototype() {} + #[TentativeType] + public function getPrototype(): ReflectionMethod {} /** * Set method accessibility @@ -265,7 +280,8 @@ public function getPrototype() {} * @since 5.3.2 */ #[PhpStormStubsElementAvailable(to: "8.0")] - public function setAccessible(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $accessible) {} + #[TentativeType] + public function setAccessible(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $accessible): void {} /** * Set method accessibility @@ -277,5 +293,6 @@ public function setAccessible(#[LanguageLevelTypeAware(['8.0' => 'bool'], defaul */ #[Pure] #[PhpStormStubsElementAvailable(from: "8.1")] - public function setAccessible(bool $accessible) {} + #[TentativeType] + public function setAccessible(bool $accessible): void {} } diff --git a/Reflection/ReflectionNamedType.php b/Reflection/ReflectionNamedType.php index e6003b30a..dcb888222 100644 --- a/Reflection/ReflectionNamedType.php +++ b/Reflection/ReflectionNamedType.php @@ -1,5 +1,6 @@ 'string|int'], default: '')] $param) {} @@ -52,6 +53,7 @@ public static function export($function, $parameter, $return = false) {} * @link https://php.net/manual/en/reflectionparameter.tostring.php * @return string */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -61,7 +63,8 @@ public function __toString() {} * @return string The name of the reflected parameter. */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Checks if passed by reference @@ -70,7 +73,8 @@ public function getName() {} * @return bool {@see true} if the parameter is passed in by reference, otherwise {@see false} */ #[Pure] - public function isPassedByReference() {} + #[TentativeType] + public function isPassedByReference(): bool {} /** * Returns whether this parameter can be passed by value @@ -80,7 +84,8 @@ public function isPassedByReference() {} * Returns {@see null} in case of an error. * @since 5.4 */ - public function canBePassedByValue() {} + #[TentativeType] + public function canBePassedByValue(): bool {} /** * Gets declaring function @@ -90,7 +95,8 @@ public function canBePassedByValue() {} * @since 5.2.3 */ #[Pure] - public function getDeclaringFunction() {} + #[TentativeType] + public function getDeclaringFunction(): ReflectionFunctionAbstract {} /** * Gets declaring class @@ -100,7 +106,8 @@ public function getDeclaringFunction() {} * called on function. */ #[Pure] - public function getDeclaringClass() {} + #[TentativeType] + public function getDeclaringClass(): ?ReflectionClass {} /** * Gets the class type hinted for the parameter as a ReflectionClass object. @@ -111,7 +118,8 @@ public function getDeclaringClass() {} */ #[Deprecated(reason: "Use ReflectionParameter::getType() and the ReflectionType APIs should be used instead.", since: "8.0")] #[Pure] - public function getClass() {} + #[TentativeType] + public function getClass(): ?ReflectionClass {} /** * Checks if the parameter has a type associated with it. @@ -120,7 +128,8 @@ public function getClass() {} * @return bool {@see true} if a type is specified, {@see false} otherwise. * @since 7.0 */ - public function hasType() {} + #[TentativeType] + public function hasType(): bool {} /** * Gets a parameter's type @@ -139,7 +148,8 @@ public function hasType() {} ], default: 'ReflectionType|null' )] - public function getType() {} + #[TentativeType] + public function getType(): ?ReflectionType {} /** * Checks if parameter expects an array @@ -150,7 +160,8 @@ public function getType() {} */ #[Deprecated(reason: "Use ReflectionParameter::getType() and the ReflectionType APIs should be used instead.", since: "8.0")] #[Pure] - public function isArray() {} + #[TentativeType] + public function isArray(): bool {} /** * Returns whether parameter MUST be callable @@ -163,7 +174,8 @@ public function isArray() {} */ #[Deprecated(reason: "Use ReflectionParameter::getType() and the ReflectionType APIs should be used instead.", since: "8.0")] #[Pure] - public function isCallable() {} + #[TentativeType] + public function isCallable(): bool {} /** * Checks if null is allowed @@ -172,7 +184,8 @@ public function isCallable() {} * @return bool Returns {@see true} if {@see null} is allowed, * otherwise {@see false} */ - public function allowsNull() {} + #[TentativeType] + public function allowsNull(): bool {} /** * Gets parameter position @@ -182,7 +195,8 @@ public function allowsNull() {} * @since 5.2.3 */ #[Pure] - public function getPosition() {} + #[TentativeType] + public function getPosition(): int {} /** * Checks if optional @@ -192,7 +206,8 @@ public function getPosition() {} * @since 5.0.3 */ #[Pure] - public function isOptional() {} + #[TentativeType] + public function isOptional(): bool {} /** * Checks if a default value is available @@ -202,18 +217,20 @@ public function isOptional() {} * @since 5.0.3 */ #[Pure] - public function isDefaultValueAvailable() {} + #[TentativeType] + public function isDefaultValueAvailable(): bool {} /** * Gets default parameter value * * @link https://php.net/manual/en/reflectionparameter.getdefaultvalue.php * @return mixed The parameters default value. - * @throws \ReflectionException if the parameter is not optional + * @throws ReflectionException if the parameter is not optional * @since 5.0.3 */ #[Pure] - public function getDefaultValue() {} + #[TentativeType] + public function getDefaultValue(): mixed {} /** * Returns whether the default value of this parameter is constant @@ -223,18 +240,20 @@ public function getDefaultValue() {} * @since 5.4.6 */ #[Pure] - public function isDefaultValueConstant() {} + #[TentativeType] + public function isDefaultValueConstant(): bool {} /** * Returns the default value's constant name if default value is constant or null * * @link https://php.net/manual/en/reflectionparameter.getdefaultvalueconstantname.php * @return string|null Returns string on success or {@see null} on failure. - * @throws \ReflectionException if the parameter is not optional + * @throws ReflectionException if the parameter is not optional * @since 5.4.6 */ #[Pure] - public function getDefaultValueConstantName() {} + #[TentativeType] + public function getDefaultValueConstantName(): ?string {} /** * Returns whether this function is variadic @@ -244,7 +263,8 @@ public function getDefaultValueConstantName() {} * @since 5.6 */ #[Pure] - public function isVariadic() {} + #[TentativeType] + public function isVariadic(): bool {} /** * Returns information about whether the parameter is a promoted. @@ -253,7 +273,7 @@ public function isVariadic() {} * @since 8.0 */ #[Pure] - public function isPromoted() {} + public function isPromoted(): bool {} /** * Returns an array of parameter attributes. @@ -264,7 +284,7 @@ public function isPromoted() {} * @since 8.0 */ #[Pure] - public function getAttributes(?string $name = null, int $flags = 0) {} + public function getAttributes(?string $name = null, int $flags = 0): array {} /** * Clone @@ -272,5 +292,5 @@ public function getAttributes(?string $name = null, int $flags = 0) {} * @link https://php.net/manual/en/reflectionparameter.clone.php * @return void */ - final private function __clone() {} + final private function __clone(): void {} } diff --git a/Reflection/ReflectionProperty.php b/Reflection/ReflectionProperty.php index c19cb2815..69e80a496 100644 --- a/Reflection/ReflectionProperty.php +++ b/Reflection/ReflectionProperty.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\Immutable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -74,7 +75,7 @@ class ReflectionProperty implements Reflector * @link https://php.net/manual/en/reflectionproperty.construct.php * @param string|object $class The class name, that contains the property. * @param string $property The name of the property being reflected. - * @throws \ReflectionException if the class or property does not exist. + * @throws ReflectionException if the class or property does not exist. */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'object|string'], default: '')] $class, @@ -102,6 +103,7 @@ public static function export($class, $name, $return = false) {} * @link https://php.net/manual/en/reflectionproperty.tostring.php * @return string */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -111,7 +113,8 @@ public function __toString() {} * @return string The name of the reflected property. */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Gets value @@ -124,7 +127,8 @@ public function getName() {} * @return mixed The current value of the property. */ #[Pure] - public function getValue(#[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object = null) {} + #[TentativeType] + public function getValue(#[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object = null): mixed {} /** * Set property value @@ -136,10 +140,11 @@ public function getValue(#[LanguageLevelTypeAware(['8.0' => 'object|null'], defa * @param mixed $value The new value. * @return void No value is returned. */ + #[TentativeType] public function setValue( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $objectOrValue, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value = null - ) {} + ): void {} /** * Checks if property is public @@ -148,7 +153,8 @@ public function setValue( * @return bool Return {@see true} if the property is public, {@see false} otherwise. */ #[Pure] - public function isPublic() {} + #[TentativeType] + public function isPublic(): bool {} /** * Checks if property is private @@ -157,7 +163,8 @@ public function isPublic() {} * @return bool Return {@see true} if the property is private, {@see false} otherwise. */ #[Pure] - public function isPrivate() {} + #[TentativeType] + public function isPrivate(): bool {} /** * Checks if property is protected @@ -166,7 +173,8 @@ public function isPrivate() {} * @return bool Returns {@see true} if the property is protected, {@see false} otherwise. */ #[Pure] - public function isProtected() {} + #[TentativeType] + public function isProtected(): bool {} /** * Checks if property is static @@ -175,7 +183,8 @@ public function isProtected() {} * @return bool Retruns {@see true} if the property is static, {@see false} otherwise. */ #[Pure] - public function isStatic() {} + #[TentativeType] + public function isStatic(): bool {} /** * Checks if default value @@ -185,7 +194,8 @@ public function isStatic() {} * compile-time, or {@see false} if it was created at run-time. */ #[Pure] - public function isDefault() {} + #[TentativeType] + public function isDefault(): bool {} /** * Gets modifiers @@ -194,7 +204,8 @@ public function isDefault() {} * @return int A numeric representation of the modifiers. */ #[Pure] - public function getModifiers() {} + #[TentativeType] + public function getModifiers(): int {} /** * Gets declaring class @@ -203,7 +214,8 @@ public function getModifiers() {} * @return ReflectionClass A {@see ReflectionClass} object. */ #[Pure] - public function getDeclaringClass() {} + #[TentativeType] + public function getDeclaringClass(): ReflectionClass {} /** * Gets doc comment @@ -212,7 +224,8 @@ public function getDeclaringClass() {} * @return string|false The doc comment if it exists, otherwise {@see false} */ #[Pure] - public function getDocComment() {} + #[TentativeType] + public function getDocComment(): string|false {} /** * Set property accessibility @@ -222,7 +235,8 @@ public function getDocComment() {} * @return void No value is returned. */ #[PhpStormStubsElementAvailable(to: "8.0")] - public function setAccessible(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $accessible) {} + #[TentativeType] + public function setAccessible(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $accessible): void {} /** * Set property accessibility @@ -234,7 +248,8 @@ public function setAccessible(#[LanguageLevelTypeAware(['8.0' => 'bool'], defaul */ #[Pure] #[PhpStormStubsElementAvailable(from: "8.1")] - public function setAccessible(bool $accessible) {} + #[TentativeType] + public function setAccessible(bool $accessible): void {} /** * Gets property type @@ -252,7 +267,8 @@ public function setAccessible(bool $accessible) {} ], default: 'ReflectionNamedType|null' )] - public function getType() {} + #[TentativeType] + public function getType(): ?ReflectionType {} /** * Checks if property has type @@ -261,7 +277,8 @@ public function getType() {} * @return bool Returns {@see true} if a type is specified, {@see false} otherwise. * @since 7.4 */ - public function hasType() {} + #[TentativeType] + public function hasType(): bool {} /** * Checks if property is initialized @@ -273,7 +290,8 @@ public function hasType() {} * @since 7.4 */ #[Pure] - public function isInitialized(?object $object = null) {} + #[TentativeType] + public function isInitialized(?object $object = null): bool {} /** * Returns information about whether the property was promoted. @@ -282,7 +300,7 @@ public function isInitialized(?object $object = null) {} * @since 8.0 */ #[Pure] - public function isPromoted() {} + public function isPromoted(): bool {} /** * Clone @@ -290,20 +308,21 @@ public function isPromoted() {} * @link https://php.net/manual/en/reflectionproperty.clone.php * @return void */ - final private function __clone() {} + final private function __clone(): void {} /** * @return bool * @since 8.0 */ - public function hasDefaultValue() {} + public function hasDefaultValue(): bool {} /** * @return mixed * @since 8.0 */ #[Pure] - public function getDefaultValue() {} + #[TentativeType] + public function getDefaultValue(): mixed {} /** * @param null|string $name @@ -312,11 +331,11 @@ public function getDefaultValue() {} * @since 8.0 */ #[Pure] - public function getAttributes(?string $name = null, int $flags = 0) {} + public function getAttributes(?string $name = null, int $flags = 0): array {} /** - * @since 8.1 * @return bool + * @since 8.1 */ public function isReadOnly(): bool {} } diff --git a/Reflection/ReflectionReference.php b/Reflection/ReflectionReference.php index adf96d984..63f93faf3 100644 --- a/Reflection/ReflectionReference.php +++ b/Reflection/ReflectionReference.php @@ -29,7 +29,7 @@ private function __construct() {} public static function fromArrayElement( array $array, #[LanguageLevelTypeAware(['8.0' => 'string|int'], default: '')] $key - ) {} + ): ?ReflectionReference {} /** * Returns unique identifier for the reference. The return value format is unspecified @@ -38,12 +38,12 @@ public static function fromArrayElement( * @return int|string Returns an integer or string of unspecified format. */ #[Pure] - public function getId() {} + public function getId(): string {} /** * ReflectionReference cannot be cloned * * @return void */ - private function __clone() {} + private function __clone(): void {} } diff --git a/Reflection/ReflectionType.php b/Reflection/ReflectionType.php index 13b2ee6ff..341927eaa 100644 --- a/Reflection/ReflectionType.php +++ b/Reflection/ReflectionType.php @@ -1,6 +1,7 @@ 'string'], default: '')] $name) {} @@ -47,6 +48,7 @@ public static function export($name, $return = false) {} * @return string * @since 5.4 */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -57,7 +59,8 @@ public function __toString() {} * @since 5.4 */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Gets version @@ -67,7 +70,8 @@ public function getName() {} * @since 5.4 */ #[Pure] - public function getVersion() {} + #[TentativeType] + public function getVersion(): string {} /** * Gets author @@ -77,7 +81,8 @@ public function getVersion() {} * @since 5.4 */ #[Pure] - public function getAuthor() {} + #[TentativeType] + public function getAuthor(): string {} /** * Gets URL @@ -87,7 +92,8 @@ public function getAuthor() {} * @since 5.4 */ #[Pure] - public function getURL() {} + #[TentativeType] + public function getURL(): string {} /** * Gets copyright @@ -97,7 +103,8 @@ public function getURL() {} * @since 5.4 */ #[Pure] - public function getCopyright() {} + #[TentativeType] + public function getCopyright(): string {} /** * Clone handler @@ -106,5 +113,5 @@ public function getCopyright() {} * @return void * @since 5.4 */ - final private function __clone() {} + final private function __clone(): void {} } diff --git a/SPL/SPL.php b/SPL/SPL.php index 14372b0e8..b36f1427e 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -3,6 +3,7 @@ // Start of SPL v.0.2 use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; /** * Exception that represents error in the program logic. This kind of @@ -104,21 +105,24 @@ class EmptyIterator implements Iterator * @link https://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ - public function current() {} + #[TentativeType] + public function current(): never {} /** * Move forward to next element * @link https://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Return the key of the current element * @link https://php.net/manual/en/iterator.key.php * @return string|float|int|bool|null scalar on success, or null on failure. */ - public function key() {} + #[TentativeType] + public function key(): never {} /** * Checks if current position is valid @@ -126,14 +130,16 @@ public function key() {} * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Rewind the Iterator to the first element * @link https://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} } /** @@ -160,7 +166,8 @@ public function __construct(Iterator $iterator, callable $callback) {} * @link https://secure.php.net/manual/en/callbackfilteriterator.accept.php * @return bool true if the current element is acceptable, otherwise false. */ - public function accept() {} + #[TentativeType] + public function accept(): bool {} } /** @@ -188,14 +195,16 @@ public function __construct( * @link https://php.net/manual/en/recursiveiterator.haschildren.php * @return bool Returns TRUE if the current element has children, FALSE otherwise. */ - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * Returns an iterator for the current entry. * @link https://secure.php.net/manual/en/recursivecallbackfilteriterator.haschildren.php * @return RecursiveCallbackFilterIterator containing the children. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): RecursiveCallbackFilterIterator {} } /** @@ -210,14 +219,16 @@ interface RecursiveIterator extends Iterator * @link https://php.net/manual/en/recursiveiterator.haschildren.php * @return bool true if the current entry can be iterated over, otherwise returns false. */ - public function hasChildren(); + #[TentativeType] + public function hasChildren(): bool; /** * Returns an iterator for the current entry. * @link https://php.net/manual/en/recursiveiterator.getchildren.php - * @return RecursiveIterator An iterator for the current entry. + * @return RecursiveIterator|null An iterator for the current entry. */ - public function getChildren(); + #[TentativeType] + public function getChildren(): ?RecursiveIterator; } /** @@ -265,106 +276,121 @@ public function __construct( * @link https://php.net/manual/en/recursiveiteratoriterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Check whether the current position is valid * @link https://php.net/manual/en/recursiveiteratoriterator.valid.php * @return bool true if the current position is valid, otherwise false */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Access the current key * @link https://php.net/manual/en/recursiveiteratoriterator.key.php * @return string|float|int|bool|null The current key. */ - public function key() {} + #[TentativeType] + public function key(): mixed {} /** * Access the current element value * @link https://php.net/manual/en/recursiveiteratoriterator.current.php * @return mixed The current elements value. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Move forward to the next element * @link https://php.net/manual/en/recursiveiteratoriterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Get the current depth of the recursive iteration * @link https://php.net/manual/en/recursiveiteratoriterator.getdepth.php * @return int The current depth of the recursive iteration. */ - public function getDepth() {} + #[TentativeType] + public function getDepth(): int {} /** * The current active sub iterator * @link https://php.net/manual/en/recursiveiteratoriterator.getsubiterator.php * @param int $level [optional] - * @return RecursiveIterator The current active sub iterator. + * @return RecursiveIterator|null The current active sub iterator. */ - public function getSubIterator(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $level) {} + #[TentativeType] + public function getSubIterator(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $level): ?RecursiveIterator {} /** * Get inner iterator * @link https://php.net/manual/en/recursiveiteratoriterator.getinneriterator.php - * @return Iterator The current active sub iterator. + * @return RecursiveIterator The current active sub iterator. */ - public function getInnerIterator() {} + #[TentativeType] + public function getInnerIterator(): RecursiveIterator {} /** * Begin Iteration * @link https://php.net/manual/en/recursiveiteratoriterator.beginiteration.php * @return void */ - public function beginIteration() {} + #[TentativeType] + public function beginIteration(): void {} /** * End Iteration * @link https://php.net/manual/en/recursiveiteratoriterator.enditeration.php * @return void */ - public function endIteration() {} + #[TentativeType] + public function endIteration(): void {} /** * Has children * @link https://php.net/manual/en/recursiveiteratoriterator.callhaschildren.php * @return bool true if the element has children, otherwise false */ - public function callHasChildren() {} + #[TentativeType] + public function callHasChildren(): bool {} /** * Get children * @link https://php.net/manual/en/recursiveiteratoriterator.callgetchildren.php - * @return RecursiveIterator A RecursiveIterator. + * @return RecursiveIterator|null A RecursiveIterator. */ - public function callGetChildren() {} + #[TentativeType] + public function callGetChildren(): ?RecursiveIterator {} /** * Begin children * @link https://php.net/manual/en/recursiveiteratoriterator.beginchildren.php * @return void */ - public function beginChildren() {} + #[TentativeType] + public function beginChildren(): void {} /** * End children * @link https://php.net/manual/en/recursiveiteratoriterator.endchildren.php * @return void */ - public function endChildren() {} + #[TentativeType] + public function endChildren(): void {} /** * Next element * @link https://php.net/manual/en/recursiveiteratoriterator.nextelement.php * @return void */ - public function nextElement() {} + #[TentativeType] + public function nextElement(): void {} /** * Set max depth @@ -375,14 +401,16 @@ public function nextElement() {} *

* @return void */ - public function setMaxDepth(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxDepth = -1) {} + #[TentativeType] + public function setMaxDepth(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxDepth = -1): void {} /** * Get max depth * @link https://php.net/manual/en/recursiveiteratoriterator.getmaxdepth.php * @return int|false The maximum accepted depth, or false if any depth is allowed. */ - public function getMaxDepth() {} + #[TentativeType] + public function getMaxDepth(): int|false {} } /** @@ -395,9 +423,10 @@ interface OuterIterator extends Iterator /** * Returns the inner iterator for the current entry. * @link https://php.net/manual/en/outeriterator.getinneriterator.php - * @return Iterator The inner iterator for the current entry. + * @return Iterator|null The inner iterator for the current entry. */ - public function getInnerIterator(); + #[TentativeType] + public function getInnerIterator(): ?Iterator; } /** @@ -422,44 +451,50 @@ public function __construct(Traversable $iterator, #[PhpStormStubsElementAvailab /** * Get the inner iterator * @link https://php.net/manual/en/iteratoriterator.getinneriterator.php - * @return Iterator The inner iterator as passed to IteratorIterator::__construct. + * @return Iterator|null The inner iterator as passed to IteratorIterator::__construct. */ - public function getInnerIterator() {} + #[TentativeType] + public function getInnerIterator(): ?Iterator {} /** * Rewind to the first element * @link https://php.net/manual/en/iteratoriterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Checks if the iterator is valid * @link https://php.net/manual/en/iteratoriterator.valid.php * @return bool true if the iterator is valid, otherwise false */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Get the key of the current element * @link https://php.net/manual/en/iteratoriterator.key.php * @return string|float|int|bool|null The key of the current element. */ - public function key() {} + #[TentativeType] + public function key(): mixed {} /** * Get the current value * @link https://php.net/manual/en/iteratoriterator.current.php * @return mixed The value of the current element. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Forward to the next element * @link https://php.net/manual/en/iteratoriterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} } /** @@ -475,7 +510,8 @@ abstract class FilterIterator extends IteratorIterator * @link https://php.net/manual/en/filteriterator.accept.php * @return bool true if the current element is acceptable, otherwise false. */ - abstract public function accept(); + #[TentativeType] + abstract public function accept(): bool; /** * Construct a filterIterator @@ -489,7 +525,8 @@ public function __construct(Iterator $iterator) {} * @link https://php.net/manual/en/filteriterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Check whether the current element is valid @@ -517,7 +554,8 @@ public function current() {} * @link https://php.net/manual/en/filteriterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Get the inner iterator @@ -547,14 +585,16 @@ public function __construct(RecursiveIterator $iterator) {} * @link https://php.net/manual/en/recursivefilteriterator.haschildren.php * @return bool true if the inner iterator has children, otherwise false */ - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * Return the inner iterator's children contained in a RecursiveFilterIterator * @link https://php.net/manual/en/recursivefilteriterator.getchildren.php - * @return RecursiveFilterIterator containing the inner iterator's children. + * @return RecursiveFilterIterator|null containing the inner iterator's children. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): ?RecursiveFilterIterator {} } /** @@ -568,7 +608,8 @@ class ParentIterator extends RecursiveFilterIterator * @link https://php.net/manual/en/parentiterator.accept.php * @return bool true if the current element is acceptable, otherwise false. */ - public function accept() {} + #[TentativeType] + public function accept(): bool {} /** * Constructs a ParentIterator @@ -606,7 +647,8 @@ interface SeekableIterator extends Iterator *

* @return void */ - public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset); + #[TentativeType] + public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset): void; } /** @@ -634,14 +676,16 @@ public function __construct( * @link https://php.net/manual/en/limititerator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Check whether the current element is valid * @link https://php.net/manual/en/limititerator.valid.php * @return bool true on success or false on failure. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Get current key @@ -662,7 +706,8 @@ public function current() {} * @link https://php.net/manual/en/limititerator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Seek to the given position @@ -672,14 +717,16 @@ public function next() {} *

* @return int the offset position after seeking. */ - public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset) {} + #[TentativeType] + public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset): int {} /** * Return the current position * @link https://php.net/manual/en/limititerator.getposition.php * @return int The current position. */ - public function getPosition() {} + #[TentativeType] + public function getPosition(): int {} /** * Get inner iterator @@ -741,14 +788,16 @@ public function __construct(Iterator $iterator, #[LanguageLevelTypeAware(['8.0' * @link https://php.net/manual/en/cachingiterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Check whether the current element is valid * @link https://php.net/manual/en/cachingiterator.valid.php * @return bool true on success or false on failure. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Return the key for the current element @@ -769,20 +818,23 @@ public function current() {} * @link https://php.net/manual/en/cachingiterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Check whether the inner iterator has a valid next element * @link https://php.net/manual/en/cachingiterator.hasnext.php * @return bool true on success or false on failure. */ - public function hasNext() {} + #[TentativeType] + public function hasNext(): bool {} /** * Return the string representation of the current iteration based on the flag being used. * @link https://php.net/manual/en/cachingiterator.tostring.php * @return string The string representation of the current iteration based on the flag being used. */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -797,7 +849,8 @@ public function getInnerIterator() {} * @link https://php.net/manual/en/cachingiterator.getflags.php * @return int Bitmask of the flags */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * The setFlags purpose @@ -805,7 +858,8 @@ public function getFlags() {} * @param int $flags Bitmask of the flags to set. * @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): void {} /** * Internal cache array index to retrieve. @@ -814,7 +868,8 @@ public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '') * @return mixed * @throws BadMethodCallException when the {@see CachingIterator::FULL_CACHE} flag is not being used. */ - public function offsetGet($key) {} + #[TentativeType] + public function offsetGet($key): mixed {} /** * Set an element on the internal cache array. @@ -824,7 +879,8 @@ public function offsetGet($key) {} * @return void * @throws BadMethodCallException when the {@see CachingIterator::FULL_CACHE} flag is not being used. */ - public function offsetSet($key, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function offsetSet($key, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Remove an element from the internal cache array. @@ -833,7 +889,8 @@ public function offsetSet($key, #[LanguageLevelTypeAware(['8.0' => 'mixed'], def * @return void * @throws BadMethodCallException when the {@see CachingIterator::FULL_CACHE} flag is not being used. */ - public function offsetUnset($key) {} + #[TentativeType] + public function offsetUnset($key): void {} /** * Return whether an element at the index exists on the internal cache array. @@ -842,7 +899,8 @@ public function offsetUnset($key) {} * @return bool true if an entry referenced by the offset exists, false otherwise. * @throws BadMethodCallException when the {@see CachingIterator::FULL_CACHE} flag is not being used. */ - public function offsetExists($key) {} + #[TentativeType] + public function offsetExists($key): bool {} /** * Retrieve the contents of the cache @@ -850,7 +908,8 @@ public function offsetExists($key) {} * @return array An array containing the cache items. * @throws BadMethodCallException when the {@see CachingIterator::FULL_CACHE} flag is not being used. */ - public function getCache() {} + #[TentativeType] + public function getCache(): array {} /** * The number of elements in the iterator @@ -859,7 +918,8 @@ public function getCache() {} * @throws BadMethodCallException when the {@see CachingIterator::FULL_CACHE} flag is not being used. * @since 5.2.2 */ - public function count() {} + #[TentativeType] + public function count(): int {} } /** @@ -881,14 +941,16 @@ public function __construct(Iterator $iterator, #[LanguageLevelTypeAware(['8.0' * @link https://php.net/manual/en/recursivecachingiterator.haschildren.php * @return bool true if the inner iterator has children, otherwise false */ - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * Return the inner iterator's children as a RecursiveCachingIterator * @link https://php.net/manual/en/recursivecachingiterator.getchildren.php - * @return RecursiveCachingIterator The inner iterator's children, as a RecursiveCachingIterator. + * @return RecursiveCachingIterator|null The inner iterator's children, as a RecursiveCachingIterator. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): ?RecursiveCachingIterator {} } /** @@ -909,35 +971,40 @@ public function __construct(Iterator $iterator) {} * @link https://php.net/manual/en/norewinditerator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Validates the iterator * @link https://php.net/manual/en/norewinditerator.valid.php * @return bool true on success or false on failure. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Get the current key * @link https://php.net/manual/en/norewinditerator.key.php * @return string|float|int|bool|null The current key. */ - public function key() {} + #[TentativeType] + public function key(): mixed {} /** * Get the current value * @link https://php.net/manual/en/norewinditerator.current.php * @return mixed The current value. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Forward to the next element * @link https://php.net/manual/en/norewinditerator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Get the inner iterator @@ -967,21 +1034,24 @@ public function __construct() {} *

* @return void */ - public function append(Iterator $iterator) {} + #[TentativeType] + public function append(Iterator $iterator): void {} /** * Rewinds the Iterator * @link https://php.net/manual/en/appenditerator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Checks validity of the current element * @link https://php.net/manual/en/appenditerator.valid.php * @return bool true on success or false on failure. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Gets the current key @@ -995,14 +1065,16 @@ public function key() {} * @link https://php.net/manual/en/appenditerator.current.php * @return mixed The current value if it is valid or null otherwise. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Moves to the next element * @link https://php.net/manual/en/appenditerator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Gets an inner iterator @@ -1014,16 +1086,18 @@ public function getInnerIterator() {} /** * Gets an index of iterators * @link https://php.net/manual/en/appenditerator.getiteratorindex.php - * @return int The index of iterators. + * @return int|null The index of iterators. */ - public function getIteratorIndex() {} + #[TentativeType] + public function getIteratorIndex(): ?int {} /** * The getArrayIterator method * @link https://php.net/manual/en/appenditerator.getarrayiterator.php * @return ArrayIterator containing the appended iterators. */ - public function getArrayIterator() {} + #[TentativeType] + public function getArrayIterator(): ArrayIterator {} } /** @@ -1046,7 +1120,8 @@ public function __construct(Iterator $iterator) {} * @link https://php.net/manual/en/infiniteiterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} } /** @@ -1112,14 +1187,16 @@ public function __construct( * @link https://php.net/manual/en/regexiterator.accept.php * @return bool true if a match, false otherwise. */ - public function accept() {} + #[TentativeType] + public function accept(): bool {} /** * Returns operation mode. * @link https://php.net/manual/en/regexiterator.getmode.php * @return int the operation mode. */ - public function getMode() {} + #[TentativeType] + public function getMode(): int {} /** * Sets the operation mode. @@ -1171,14 +1248,16 @@ public function getMode() {} *

* @return void */ - public function setMode(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode) {} + #[TentativeType] + public function setMode(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode): void {} /** * Get flags * @link https://php.net/manual/en/regexiterator.getflags.php * @return int the set flags. */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * Sets the flags. @@ -1206,7 +1285,8 @@ public function getFlags() {} *

* @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): void {} /** * Returns current regular expression @@ -1214,14 +1294,16 @@ public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '') * @return string * @since 5.4 */ - public function getRegex() {} + #[TentativeType] + public function getRegex(): string {} /** * Returns the regular expression flags. * @link https://php.net/manual/en/regexiterator.getpregflags.php * @return int a bitmask of the regular expression flags. */ - public function getPregFlags() {} + #[TentativeType] + public function getPregFlags(): int {} /** * Sets the regular expression flags. @@ -1232,7 +1314,8 @@ public function getPregFlags() {} *

* @return void */ - public function setPregFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pregFlags) {} + #[TentativeType] + public function setPregFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pregFlags): void {} } /** @@ -1263,14 +1346,16 @@ public function __construct( * @link https://php.net/manual/en/recursiveregexiterator.haschildren.php * @return bool true if an iterator can be obtained for the current entry, otherwise returns false. */ - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * Returns an iterator for the current entry. * @link https://php.net/manual/en/recursiveregexiterator.getchildren.php * @return RecursiveRegexIterator An iterator for the current entry, if it can be iterated over by the inner iterator. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): RecursiveRegexIterator {} } /** @@ -1323,14 +1408,16 @@ public function valid() {} * @link https://php.net/manual/en/recursivetreeiterator.key.php * @return string the current key prefixed and postfixed. */ - public function key() {} + #[TentativeType] + public function key(): mixed {} /** * Get current element * @link https://php.net/manual/en/recursivetreeiterator.current.php * @return string the current element prefixed and postfixed. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Move to next element @@ -1393,12 +1480,14 @@ public function nextElement() {} * @link https://php.net/manual/en/recursivetreeiterator.getprefix.php * @return string the string to place in front of current element */ - public function getPrefix() {} + #[TentativeType] + public function getPrefix(): string {} /** * @param string $postfix */ - public function setPostfix(#[PhpStormStubsElementAvailable(from: '7.3')] string $postfix) {} + #[TentativeType] + public function setPostfix(#[PhpStormStubsElementAvailable(from: '7.3')] string $postfix): void {} /** * Set a part of the prefix @@ -1411,24 +1500,27 @@ public function setPostfix(#[PhpStormStubsElementAvailable(from: '7.3')] string *

* @return void */ + #[TentativeType] public function setPrefixPart( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $part, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value - ) {} + ): void {} /** * Get current entry * @link https://php.net/manual/en/recursivetreeiterator.getentry.php * @return string the part of the tree built for the current element. */ - public function getEntry() {} + #[TentativeType] + public function getEntry(): string {} /** * Get the postfix * @link https://php.net/manual/en/recursivetreeiterator.getpostfix.php * @return string to place after the current element. */ - public function getPostfix() {} + #[TentativeType] + public function getPostfix(): string {} } /** @@ -1468,7 +1560,8 @@ public function __construct( *

* @return bool true if the requested index exists, otherwise false */ - public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key) {} + #[TentativeType] + public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key): bool {} /** * Returns the value at the specified index @@ -1478,7 +1571,8 @@ public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], defaul *

* @return mixed|false The value at the specified index or false. */ - public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key) {} + #[TentativeType] + public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key): mixed {} /** * Sets the value at the specified index to newval @@ -1491,10 +1585,11 @@ public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: *

* @return void */ + #[TentativeType] public function offsetSet( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value - ) {} + ): void {} /** * Unsets the value at the specified index @@ -1504,7 +1599,8 @@ public function offsetSet( *

* @return void */ - public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key) {} + #[TentativeType] + public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key): void {} /** * Appends the value @@ -1514,7 +1610,8 @@ public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default *

* @return void */ - public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Creates a copy of the ArrayObject. @@ -1522,7 +1619,8 @@ public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '') * @return array a copy of the array. When the ArrayObject refers to an object * an array of the public properties of that object will be returned. */ - public function getArrayCopy() {} + #[TentativeType] + public function getArrayCopy(): array {} /** * Get the number of public properties in the ArrayObject @@ -1530,14 +1628,16 @@ public function getArrayCopy() {} * @link https://php.net/manual/en/arrayobject.count.php * @return int The number of public properties in the ArrayObject. */ - public function count() {} + #[TentativeType] + public function count(): int {} /** * Gets the behavior flags. * @link https://php.net/manual/en/arrayobject.getflags.php * @return int the behavior flags of the ArrayObject. */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * Sets the behavior flags. @@ -1574,23 +1674,26 @@ public function getFlags() {} *

* @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): void {} /** * Sort the entries by value * @link https://php.net/manual/en/arrayobject.asort.php * @param int $flags [optional] - * @return void + * @return bool */ - public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} + #[TentativeType] + public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} /** * Sort the entries by key * @link https://php.net/manual/en/arrayobject.ksort.php * @param int $flags [optional] - * @return void + * @return bool */ - public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} + #[TentativeType] + public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} /** * Sort the entries with a user-defined comparison function and maintain key association @@ -1603,9 +1706,10 @@ public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = * be respectively less than, equal to, or greater than the * second. *

- * @return void + * @return bool */ - public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} + #[TentativeType] + public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} /** * Sort the entries by keys using a user-defined comparison function @@ -1621,23 +1725,26 @@ public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: * be respectively less than, equal to, or greater than the * second. *

- * @return void + * @return bool */ - public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} + #[TentativeType] + public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} /** * Sort entries using a "natural order" algorithm * @link https://php.net/manual/en/arrayobject.natsort.php - * @return void + * @return bool */ - public function natsort() {} + #[TentativeType] + public function natsort(): bool {} /** * Sort an array using a case insensitive "natural order" algorithm * @link https://php.net/manual/en/arrayobject.natcasesort.php - * @return void + * @return bool */ - public function natcasesort() {} + #[TentativeType] + public function natcasesort(): bool {} /** * Unserialize an ArrayObject @@ -1647,39 +1754,45 @@ public function natcasesort() {} *

* @return void The unserialized ArrayObject. */ - public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): void {} /** * Serialize an ArrayObject * @link https://php.net/manual/en/arrayobject.serialize.php * @return string The serialized representation of the ArrayObject. */ - public function serialize() {} + #[TentativeType] + public function serialize(): string {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} /** * @return array * @since 7.4 */ - public function __serialize() {} + #[TentativeType] + public function __serialize(): array {} /** * @param array $data * @since 7.4 */ - public function __unserialize(array $data) {} + #[TentativeType] + public function __unserialize(array $data): void {} /** * Create a new iterator from an ArrayObject instance * @link https://php.net/manual/en/arrayobject.getiterator.php * @return ArrayIterator An iterator from an ArrayObject. */ - public function getIterator() {} + #[TentativeType] + public function getIterator(): Iterator {} /** * Exchange the array for another one. @@ -1689,7 +1802,8 @@ public function getIterator() {} *

* @return array the old array. */ - public function exchangeArray(#[LanguageLevelTypeAware(['8.0' => 'object|array'], default: '')] $array) {} + #[TentativeType] + public function exchangeArray(#[LanguageLevelTypeAware(['8.0' => 'object|array'], default: '')] $array): array {} /** * Sets the iterator classname for the ArrayObject. @@ -1699,14 +1813,16 @@ public function exchangeArray(#[LanguageLevelTypeAware(['8.0' => 'object|array'] *

* @return void */ - public function setIteratorClass(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $iteratorClass) {} + #[TentativeType] + public function setIteratorClass(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $iteratorClass): void {} /** * Gets the iterator classname for the ArrayObject. * @link https://php.net/manual/en/arrayobject.getiteratorclass.php * @return string the iterator class name that is used to iterate over this object. */ - public function getIteratorClass() {} + #[TentativeType] + public function getIteratorClass(): string {} } /** @@ -1740,7 +1856,8 @@ public function __construct( *

* @return bool true if the offset exists, otherwise false */ - public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key) {} + #[TentativeType] + public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key): bool {} /** * Get value for an offset @@ -1750,7 +1867,8 @@ public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], defaul *

* @return mixed The value at offset index. */ - public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key) {} + #[TentativeType] + public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key): mixed {} /** * Set value for an offset @@ -1763,10 +1881,11 @@ public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: *

* @return void */ + #[TentativeType] public function offsetSet( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value - ) {} + ): void {} /** * Unset value for an offset @@ -1776,7 +1895,8 @@ public function offsetSet( *

* @return void */ - public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key) {} + #[TentativeType] + public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $key): void {} /** * Append an element @@ -1786,7 +1906,8 @@ public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default *

* @return void */ - public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Get array copy @@ -1794,7 +1915,8 @@ public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '') * @return array A copy of the array, or array of public properties * if ArrayIterator refers to an object. */ - public function getArrayCopy() {} + #[TentativeType] + public function getArrayCopy(): array {} /** * Count elements @@ -1802,14 +1924,16 @@ public function getArrayCopy() {} * @return int The number of elements or public properties in the associated * array or object, respectively. */ - public function count() {} + #[TentativeType] + public function count(): int {} /** * Get flags * @link https://php.net/manual/en/arrayiterator.getflags.php - * @return string The current flags. + * @return int The current flags. */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * Set behaviour flags @@ -1822,23 +1946,26 @@ public function getFlags() {} *

* @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): void {} /** * Sort array by values * @link https://php.net/manual/en/arrayiterator.asort.php * @param int $flags [optional] - * @return void + * @return bool */ - public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} + #[TentativeType] + public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} /** * Sort array by keys * @link https://php.net/manual/en/arrayiterator.ksort.php * @param int $flags [optional] - * @return void + * @return bool */ - public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} + #[TentativeType] + public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} /** * User defined sort @@ -1848,7 +1975,8 @@ public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = *

* @return void */ - public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} + #[TentativeType] + public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} /** * User defined sort @@ -1858,21 +1986,24 @@ public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: *

* @return void */ - public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} + #[TentativeType] + public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} /** * Sort an array naturally * @link https://php.net/manual/en/arrayiterator.natsort.php - * @return void + * @return bool */ - public function natsort() {} + #[TentativeType] + public function natsort(): bool {} /** * Sort an array naturally, case insensitive * @link https://php.net/manual/en/arrayiterator.natcasesort.php - * @return void + * @return bool */ - public function natcasesort() {} + #[TentativeType] + public function natcasesort(): bool {} /** * Unserialize @@ -1882,49 +2013,56 @@ public function natcasesort() {} *

* @return string The ArrayIterator. */ - public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): void {} /** * Serialize * @link https://php.net/manual/en/arrayiterator.serialize.php * @return string The serialized ArrayIterator. */ - public function serialize() {} + #[TentativeType] + public function serialize(): string {} /** * Rewind array back to the start * @link https://php.net/manual/en/arrayiterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Return current array entry * @link https://php.net/manual/en/arrayiterator.current.php * @return mixed The current array entry. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Return current array key * @link https://php.net/manual/en/arrayiterator.key.php - * @return string|float|int|bool|null The current array key. + * @return string|int|null The current array key. */ - public function key() {} + #[TentativeType] + public function key(): string|int|null {} /** * Move to next entry * @link https://php.net/manual/en/arrayiterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Check whether array contains more entries * @link https://php.net/manual/en/arrayiterator.valid.php * @return bool */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Seek to position @@ -1934,25 +2072,29 @@ public function valid() {} *

* @return void */ - public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset) {} + #[TentativeType] + public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset): void {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} /** * @return array * @since 7.4 */ - public function __serialize() {} + #[TentativeType] + public function __serialize(): array {} /** * @param array $data * @since 7.4 */ - public function __unserialize(array $data) {} + #[TentativeType] + public function __unserialize(array $data): void {} } /** @@ -1971,12 +2113,14 @@ class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator * @return bool true if the current entry is an array or an object, * otherwise false is returned. */ - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * Returns an iterator for the current entry if it is an array or an object. * @link https://php.net/manual/en/recursivearrayiterator.getchildren.php - * @return RecursiveArrayIterator An iterator for the current entry, if it is an array or object. + * @return RecursiveArrayIterator|null An iterator for the current entry, if it is an array or object. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): ?RecursiveArrayIterator {} } diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 2e9744ed8..e7fd1b4bf 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; /** * The SplFileInfo class offers a high-level object oriented interface to @@ -26,7 +27,8 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return string the path to the file. * @since 5.1.2 */ - public function getPath() {} + #[TentativeType] + public function getPath(): string {} /** * Gets the filename @@ -34,7 +36,8 @@ public function getPath() {} * @return string The filename. * @since 5.1.2 */ - public function getFilename() {} + #[TentativeType] + public function getFilename(): string {} /** * Gets the file extension @@ -43,7 +46,8 @@ public function getFilename() {} * empty string if the file has no extension. * @since 5.3.6 */ - public function getExtension() {} + #[TentativeType] + public function getExtension(): string {} /** * Gets the base name of the file @@ -54,7 +58,8 @@ public function getExtension() {} * @return string the base name without path information. * @since 5.2.2 */ - public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $suffix = null) {} + #[TentativeType] + public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $suffix = null): string {} /** * Gets the path to the file @@ -62,7 +67,8 @@ public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return string The path to the file. * @since 5.1.2 */ - public function getPathname() {} + #[TentativeType] + public function getPathname(): string {} /** * Gets file permissions @@ -70,7 +76,8 @@ public function getPathname() {} * @return int|false The file permissions on success, or FALSE on failure. * @since 5.1.2 */ - public function getPerms() {} + #[TentativeType] + public function getPerms(): int|false {} /** * Gets the inode for the file @@ -78,7 +85,8 @@ public function getPerms() {} * @return int|false The inode number for the filesystem object on success, or FALSE on failure. * @since 5.1.2 */ - public function getInode() {} + #[TentativeType] + public function getInode(): int|false {} /** * Gets file size @@ -86,7 +94,8 @@ public function getInode() {} * @return int|false The filesize in bytes on success, or FALSE on failure. * @since 5.1.2 */ - public function getSize() {} + #[TentativeType] + public function getSize(): int|false {} /** * Gets the owner of the file @@ -94,7 +103,8 @@ public function getSize() {} * @return int|false The owner id in numerical format on success, or FALSE on failure. * @since 5.1.2 */ - public function getOwner() {} + #[TentativeType] + public function getOwner(): int|false {} /** * Gets the file group @@ -102,7 +112,8 @@ public function getOwner() {} * @return int|false The group id in numerical format on success, or FALSE on failure. * @since 5.1.2 */ - public function getGroup() {} + #[TentativeType] + public function getGroup(): int|false {} /** * Gets last access time of the file @@ -110,7 +121,8 @@ public function getGroup() {} * @return int|false The time the file was last accessed on success, or FALSE on failure. * @since 5.1.2 */ - public function getATime() {} + #[TentativeType] + public function getATime(): int|false {} /** * Gets the last modified time @@ -118,7 +130,8 @@ public function getATime() {} * @return int|false The last modified time for the file, in a Unix timestamp on success, or FALSE on failure. * @since 5.1.2 */ - public function getMTime() {} + #[TentativeType] + public function getMTime(): int|false {} /** * Gets the inode change time @@ -126,7 +139,8 @@ public function getMTime() {} * @return int|false The last change time, in a Unix timestamp on success, or FALSE on failure. * @since 5.1.2 */ - public function getCTime() {} + #[TentativeType] + public function getCTime(): int|false {} /** * Gets file type @@ -136,7 +150,8 @@ public function getCTime() {} * or dir * @since 5.1.2 */ - public function getType() {} + #[TentativeType] + public function getType(): string|false {} /** * Tells if the entry is writable @@ -144,7 +159,8 @@ public function getType() {} * @return bool true if writable, false otherwise; * @since 5.1.2 */ - public function isWritable() {} + #[TentativeType] + public function isWritable(): bool {} /** * Tells if file is readable @@ -152,7 +168,8 @@ public function isWritable() {} * @return bool true if readable, false otherwise. * @since 5.1.2 */ - public function isReadable() {} + #[TentativeType] + public function isReadable(): bool {} /** * Tells if the file is executable @@ -160,7 +177,8 @@ public function isReadable() {} * @return bool true if executable, false otherwise. * @since 5.1.2 */ - public function isExecutable() {} + #[TentativeType] + public function isExecutable(): bool {} /** * Tells if the object references a regular file @@ -168,7 +186,8 @@ public function isExecutable() {} * @return bool true if the file exists and is a regular file (not a link), false otherwise. * @since 5.1.2 */ - public function isFile() {} + #[TentativeType] + public function isFile(): bool {} /** * Tells if the file is a directory @@ -176,7 +195,8 @@ public function isFile() {} * @return bool true if a directory, false otherwise. * @since 5.1.2 */ - public function isDir() {} + #[TentativeType] + public function isDir(): bool {} /** * Tells if the file is a link @@ -184,7 +204,8 @@ public function isDir() {} * @return bool true if the file is a link, false otherwise. * @since 5.1.2 */ - public function isLink() {} + #[TentativeType] + public function isLink(): bool {} /** * Gets the target of a link @@ -192,7 +213,8 @@ public function isLink() {} * @return string|false The target of the filesystem link on success, or FALSE on failure. * @since 5.2.2 */ - public function getLinkTarget() {} + #[TentativeType] + public function getLinkTarget(): string|false {} /** * Gets absolute path to file @@ -200,7 +222,8 @@ public function getLinkTarget() {} * @return string|false the path to the file, or FALSE if the file does not exist. * @since 5.2.2 */ - public function getRealPath() {} + #[TentativeType] + public function getRealPath(): string|false {} /** * Gets an SplFileInfo object for the file @@ -211,7 +234,8 @@ public function getRealPath() {} * @return SplFileInfo An SplFileInfo object created for the file. * @since 5.1.2 */ - public function getFileInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = null) {} + #[TentativeType] + public function getFileInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = null): SplFileInfo {} /** * Gets an SplFileInfo object for the path @@ -222,7 +246,8 @@ public function getFileInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], d * @return SplFileInfo|null A SplFileInfo object for the parent path of the file on success, or NULL on failure. * @since 5.1.2 */ - public function getPathInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = null) {} + #[TentativeType] + public function getPathInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = null): ?SplFileInfo {} /** * Gets an SplFileObject object for the file @@ -239,11 +264,12 @@ public function getPathInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], d * @return SplFileObject The opened file as an SplFileObject object. * @since 5.1.2 */ + #[TentativeType] public function openFile( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $mode = 'r', #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $useIncludePath = false, $context = null - ) {} + ): SplFileObject {} /** * Sets the class name used with SplFileInfo::openFile @@ -254,7 +280,8 @@ public function openFile( * @return void * @since 5.1.2 */ - public function setFileClass(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $class = SplFileObject::class) {} + #[TentativeType] + public function setFileClass(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $class = SplFileObject::class): void {} /** * Sets the class used with getFileInfo and getPathInfo @@ -265,7 +292,8 @@ public function setFileClass(#[LanguageLevelTypeAware(['8.0' => 'string'], defau * @return void * @since 5.1.2 */ - public function setInfoClass(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $class = SplFileInfo::class) {} + #[TentativeType] + public function setInfoClass(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $class = SplFileInfo::class): void {} /** * Returns the path to the file as a string @@ -273,9 +301,11 @@ public function setInfoClass(#[LanguageLevelTypeAware(['8.0' => 'string'], defau * @return string the path to the file. * @since 5.1.2 */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} - final public function _bad_state_ex() {} + #[TentativeType] + final public function _bad_state_ex(): void {} public function __wakeup() {} @@ -283,7 +313,8 @@ public function __wakeup() {} * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} } /** @@ -308,42 +339,46 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return bool true if the entry is . or .., * otherwise false */ - public function isDot() {} + #[TentativeType] + public function isDot(): bool {} /** * Rewind the DirectoryIterator back to the start * @link https://php.net/manual/en/directoryiterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Check whether current DirectoryIterator position is a valid file * @link https://php.net/manual/en/directoryiterator.valid.php * @return bool true if the position is valid, otherwise false */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Return the key for the current DirectoryIterator item * @link https://php.net/manual/en/directoryiterator.key.php * @return string The key for the current DirectoryIterator item. */ - public function key() {} + public function key(): mixed {} /** * Return the current DirectoryIterator item. * @link https://php.net/manual/en/directoryiterator.current.php * @return DirectoryIterator The current DirectoryIterator item. */ - public function current() {} + public function current(): mixed {} /** * Move forward to next DirectoryIterator item * @link https://php.net/manual/en/directoryiterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Seek to a DirectoryIterator item @@ -353,7 +388,8 @@ public function next() {} *

* @return void */ - public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset) {} + #[TentativeType] + public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset): void {} } /** @@ -392,7 +428,8 @@ public function __construct( * @link https://php.net/manual/en/filesystemiterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Move to the next file @@ -407,7 +444,8 @@ public function next() {} * @return string the pathname or filename depending on the set flags. * See the FilesystemIterator constants. */ - public function key() {} + #[TentativeType] + public function key(): string {} /** * The current file @@ -415,14 +453,16 @@ public function key() {} * @return string|SplFileInfo|self The filename, file information, or $this depending on the set flags. * See the FilesystemIterator constants. */ - public function current() {} + #[TentativeType] + public function current(): SplFileInfo|FilesystemIterator|string {} /** * Get the handling flags * @link https://php.net/manual/en/filesystemiterator.getflags.php * @return int The integer value of the set flags. */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * Sets handling flags @@ -433,7 +473,8 @@ public function getFlags() {} *

* @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = null) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = null): void {} } /** @@ -463,28 +504,32 @@ public function __construct( *

* @return bool whether the current entry is a directory, but not '.' or '..' */ - public function hasChildren(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $allowLinks = false) {} + #[TentativeType] + public function hasChildren(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $allowLinks = false): bool {} /** * Returns an iterator for the current entry if it is a directory * @link https://php.net/manual/en/recursivedirectoryiterator.getchildren.php - * @return object An iterator for the current entry, if it is a directory. + * @return RecursiveDirectoryIterator An iterator for the current entry, if it is a directory. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): RecursiveDirectoryIterator {} /** * Get sub path * @link https://php.net/manual/en/recursivedirectoryiterator.getsubpath.php * @return string The sub path (sub directory). */ - public function getSubPath() {} + #[TentativeType] + public function getSubPath(): string {} /** * Get sub path and name * @link https://php.net/manual/en/recursivedirectoryiterator.getsubpathname.php * @return string The sub path (sub directory) and filename. */ - public function getSubPathname() {} + #[TentativeType] + public function getSubPathname(): string {} /** * Rewinds back to the beginning @@ -541,7 +586,8 @@ public function __construct( * @return int The number of returned directories and files, as an * integer. */ - public function count() {} + #[TentativeType] + public function count(): int {} } /** @@ -592,28 +638,32 @@ public function __construct( * @link https://php.net/manual/en/splfileobject.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Reached end of file * @link https://php.net/manual/en/splfileobject.eof.php * @return bool true if file is at EOF, false otherwise. */ - public function eof() {} + #[TentativeType] + public function eof(): bool {} /** * Not at EOF * @link https://php.net/manual/en/splfileobject.valid.php * @return bool true if not reached EOF, false otherwise. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Gets line from file * @link https://php.net/manual/en/splfileobject.fgets.php - * @return string|false a string containing the next line from the file, or false on error. + * @return string a string containing the next line from the file. */ - public function fgets() {} + #[TentativeType] + public function fgets(): string {} /** * Read from file @@ -624,7 +674,8 @@ public function fgets() {} * @return string|false returns the string read from the file or FALSE on failure. * @since 5.5.11 */ - public function fread(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length) {} + #[TentativeType] + public function fread(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length): string|false {} /** * Gets line from file and parse as CSV fields @@ -645,11 +696,12 @@ public function fread(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $ * comprising a single null field unless using SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE, * in which case empty lines are skipped. */ + #[TentativeType] public function fgetcsv( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $separator = ",", #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $enclosure = "\"", #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $escape = "\\" - ) {} + ): array|false {} /** * Write a field array as a CSV line @@ -665,13 +717,14 @@ public function fgetcsv( * @return int|false Returns the length of the written string or FALSE on failure. * @since 5.4 */ + #[TentativeType] public function fputcsv( array $fields, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $separator = ',', #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $enclosure = '"', #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $escape = "\\", #[PhpStormStubsElementAvailable('8.1')] string $eol = PHP_EOL - ) {} + ): int|false {} /** * Set the delimiter and enclosure character for CSV @@ -687,18 +740,20 @@ public function fputcsv( *

* @return void */ + #[TentativeType] public function setCsvControl( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $separator = ",", #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $enclosure = "\"", #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $escape = "\\" - ) {} + ): void {} /** * Get the delimiter and enclosure character for CSV * @link https://php.net/manual/en/splfileobject.getcsvcontrol.php * @return array an indexed array containing the delimiter and enclosure character. */ - public function getCsvControl() {} + #[TentativeType] + public function getCsvControl(): array {} /** * Portable file locking @@ -712,21 +767,24 @@ public function getCsvControl() {} *

* @return bool true on success or false on failure. */ - public function flock(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $operation, &$wouldBlock = null) {} + #[TentativeType] + public function flock(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $operation, &$wouldBlock = null): bool {} /** * Flushes the output to the file * @link https://php.net/manual/en/splfileobject.fflush.php * @return bool true on success or false on failure. */ - public function fflush() {} + #[TentativeType] + public function fflush(): bool {} /** * Return current file position * @link https://php.net/manual/en/splfileobject.ftell.php * @return int|false the position of the file pointer as an integer, or false on error. */ - public function ftell() {} + #[TentativeType] + public function ftell(): int|false {} /** * Seek to a position @@ -747,25 +805,28 @@ public function ftell() {} * @return int 0 if the seek was successful, -1 otherwise. Note that seeking * past EOF is not considered an error. */ + #[TentativeType] public function fseek( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $whence = SEEK_SET - ) {} + ): int {} /** * Gets character from file * @link https://php.net/manual/en/splfileobject.fgetc.php * @return string|false a string containing a single character read from the file or false on EOF. */ - public function fgetc() {} + #[TentativeType] + public function fgetc(): string|false {} /** * Output all remaining data on a file pointer * @link https://php.net/manual/en/splfileobject.fpassthru.php - * @return int|false the number of characters read from handle + * @return int the number of characters read from handle * and passed through to the output. */ - public function fpassthru() {} + #[TentativeType] + public function fpassthru(): int {} /** * Gets line from file and strip HTML tags @@ -795,30 +856,32 @@ public function fgetss($allowable_tags = null) {} * function will return the number of assigned values. The optional * parameters must be passed by reference. */ + #[TentativeType] public function fscanf( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &...$vars - ) {} + ): array|int|null {} - /** - * Write to file - * @link https://php.net/manual/en/splfileobject.fwrite.php - * @param string $data

- * The string to be written to the file. - *

- * @param int $length [optional]

- * If the length argument is given, writing will - * stop after length bytes have been written or - * the end of string is reached, whichever comes - * first. - *

- * @return int|false the number of bytes written, or 0 (false since 7.4) on error. - */ - #[LanguageLevelTypeAware(['7.4' => 'int|false'], default: 'int')] + /** + * Write to file + * @link https://php.net/manual/en/splfileobject.fwrite.php + * @param string $data

+ * The string to be written to the file. + *

+ * @param int $length [optional]

+ * If the length argument is given, writing will + * stop after length bytes have been written or + * the end of string is reached, whichever comes + * first. + *

+ * @return int|false the number of bytes written, or 0 (false since 7.4) on error. + */ + #[LanguageLevelTypeAware(['7.4' => 'int|false'], default: 'int')] + #[TentativeType] public function fwrite( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = null - ) {} + ): int|false {} /** * Gets information about the file @@ -826,7 +889,8 @@ public function fwrite( * @return array an array with the statistics of the file; the format of the array * is described in detail on the stat manual page. */ - public function fstat() {} + #[TentativeType] + public function fstat(): array {} /** * Truncates the file to a given length @@ -842,28 +906,32 @@ public function fstat() {} *

* @return bool true on success or false on failure. */ - public function ftruncate(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $size) {} + #[TentativeType] + public function ftruncate(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $size): bool {} /** * Retrieve current line of file * @link https://php.net/manual/en/splfileobject.current.php * @return string|array|false Retrieves the current line of the file. If the SplFileObject::READ_CSV flag is set, this method returns an array containing the current line parsed as CSV data. */ - public function current() {} + #[TentativeType] + public function current(): string|array|false {} /** * Get line number * @link https://php.net/manual/en/splfileobject.key.php * @return int the current line number. */ - public function key() {} + #[TentativeType] + public function key(): int {} /** * Read next line * @link https://php.net/manual/en/splfileobject.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Sets flags for the SplFileObject @@ -875,14 +943,16 @@ public function next() {} *

* @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): void {} /** * Gets flags for the SplFileObject * @link https://php.net/manual/en/splfileobject.getflags.php * @return int an integer representing the flags. */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * Set maximum line length @@ -892,7 +962,8 @@ public function getFlags() {} *

* @return void */ - public function setMaxLineLen(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength) {} + #[TentativeType] + public function setMaxLineLen(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength): void {} /** * Get maximum line length @@ -900,7 +971,8 @@ public function setMaxLineLen(#[LanguageLevelTypeAware(['8.0' => 'int'], default * @return int the maximum line length if one has been set with * SplFileObject::setMaxLineLen, default is 0. */ - public function getMaxLineLen() {} + #[TentativeType] + public function getMaxLineLen(): int {} /** * SplFileObject does not have children @@ -908,14 +980,16 @@ public function getMaxLineLen() {} * @return bool false * @since 5.1.2 */ - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * No purpose * @link https://php.net/manual/en/splfileobject.getchildren.php - * @return null An SplFileObject does not have children so this method returns NULL. + * @return null|RecursiveIterator An SplFileObject does not have children so this method returns NULL. */ - public function getChildren() {} + #[TentativeType] + public function getChildren(): ?RecursiveIterator {} /** * Seek to specified line @@ -925,20 +999,23 @@ public function getChildren() {} *

* @return void */ - public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $line) {} + #[TentativeType] + public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $line): void {} /** * Alias of SplFileObject::fgets * @link https://php.net/manual/en/splfileobject.getcurrentline.php - * @return string|false Returns a string containing the next line from the file, or FALSE on error. + * @return string Returns a string containing the next line from the file. * @since 5.1.2 */ - public function getCurrentLine() {} + #[TentativeType] + public function getCurrentLine(): string {} /** * Alias of SplFileObject::current * @link https://php.net/manual/en/splfileobject.tostring.php */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} } @@ -977,24 +1054,27 @@ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializa * @link https://php.net/spldoublylinkedlist.add * @since 5.5 */ + #[TentativeType] public function add( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value - ) {} + ): void {} /** * Pops a node from the end of the doubly linked list * @link https://php.net/manual/en/spldoublylinkedlist.pop.php * @return mixed The value of the popped node. */ - public function pop() {} + #[TentativeType] + public function pop(): mixed {} /** * Shifts a node from the beginning of the doubly linked list * @link https://php.net/manual/en/spldoublylinkedlist.shift.php * @return mixed The value of the shifted node. */ - public function shift() {} + #[TentativeType] + public function shift(): mixed {} /** * Pushes an element at the end of the doubly linked list @@ -1004,7 +1084,8 @@ public function shift() {} *

* @return void */ - public function push(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function push(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Prepends the doubly linked list with an element @@ -1014,35 +1095,40 @@ public function push(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] *

* @return void */ - public function unshift(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function unshift(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Peeks at the node from the end of the doubly linked list * @link https://php.net/manual/en/spldoublylinkedlist.top.php * @return mixed The value of the last node. */ - public function top() {} + #[TentativeType] + public function top(): mixed {} /** * Peeks at the node from the beginning of the doubly linked list * @link https://php.net/manual/en/spldoublylinkedlist.bottom.php * @return mixed The value of the first node. */ - public function bottom() {} + #[TentativeType] + public function bottom(): mixed {} /** * 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. */ - public function count() {} + #[TentativeType] + public function count(): int {} /** * 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. */ - public function isEmpty() {} + #[TentativeType] + public function isEmpty(): bool {} /** * Sets the mode of iteration @@ -1052,16 +1138,18 @@ public function isEmpty() {} *

* The direction of the iteration (either one or the other): * SplDoublyLinkedList::IT_MODE_LIFO (Stack style) - * @return void + * @return int */ - public function setIteratorMode(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode) {} + #[TentativeType] + public function setIteratorMode(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode): int {} /** * Returns the mode of iteration * @link https://php.net/manual/en/spldoublylinkedlist.getiteratormode.php * @return int the different modes and flags that affect the iteration. */ - public function getIteratorMode() {} + #[TentativeType] + public function getIteratorMode(): int {} /** * Returns whether the requested $index exists @@ -1071,7 +1159,8 @@ public function getIteratorMode() {} *

* @return bool true if the requested index exists, otherwise false */ - public function offsetExists($index) {} + #[TentativeType] + public function offsetExists($index): bool {} /** * Returns the value at the specified $index @@ -1081,7 +1170,8 @@ public function offsetExists($index) {} *

* @return mixed The value at the specified index. */ - public function offsetGet($index) {} + #[TentativeType] + public function offsetGet($index): mixed {} /** * Sets the value at the specified $index to $newval @@ -1094,7 +1184,8 @@ public function offsetGet($index) {} *

* @return void */ - public function offsetSet($index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function offsetSet($index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Unsets the value at the specified $index @@ -1104,49 +1195,56 @@ public function offsetSet($index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], d *

* @return void */ - public function offsetUnset($index) {} + #[TentativeType] + public function offsetUnset($index): void {} /** * Rewind iterator back to the start * @link https://php.net/manual/en/spldoublylinkedlist.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Return current array entry * @link https://php.net/manual/en/spldoublylinkedlist.current.php * @return mixed The current node value. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Return current node index * @link https://php.net/manual/en/spldoublylinkedlist.key.php * @return string|float|int|bool|null The current node index. */ - public function key() {} + #[TentativeType] + public function key(): int {} /** * Move to next entry * @link https://php.net/manual/en/spldoublylinkedlist.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Move to previous entry * @link https://php.net/manual/en/spldoublylinkedlist.prev.php * @return void */ - public function prev() {} + #[TentativeType] + public function prev(): void {} /** * Check whether the doubly linked list contains more nodes * @link https://php.net/manual/en/spldoublylinkedlist.valid.php * @return bool true if the doubly linked list contains any more nodes, false otherwise. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Unserializes the storage @@ -1155,7 +1253,8 @@ public function valid() {} * @return void * @since 5.4 */ - public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): void {} /** * Serializes the storage @@ -1163,25 +1262,29 @@ public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return string The serialized string. * @since 5.4 */ - public function serialize() {} + #[TentativeType] + public function serialize(): string {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} /** * @return array * @since 7.4 */ - public function __serialize() {} + #[TentativeType] + public function __serialize(): array {} /** * @param array $data * @since 7.4 */ - public function __unserialize(array $data) {} + #[TentativeType] + public function __unserialize(array $data): void {} } /** @@ -1198,14 +1301,16 @@ class SplQueue extends SplDoublyLinkedList *

* @return void */ - public function enqueue(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function enqueue(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Dequeues a node from the queue * @link https://php.net/manual/en/splqueue.dequeue.php * @return mixed The value of the dequeued node. */ - public function dequeue() {} + #[TentativeType] + public function dequeue(): mixed {} /** * Sets the mode of iteration @@ -1250,7 +1355,8 @@ abstract class SplHeap implements Iterator, Countable * @link https://php.net/manual/en/splheap.extract.php * @return mixed The value of the extracted node. */ - public function extract() {} + #[TentativeType] + public function extract(): mixed {} /** * Inserts an element in the heap by sifting it up. @@ -1258,72 +1364,82 @@ public function extract() {} * @param mixed $value

* The value to insert. *

- * @return void + * @return bool */ - public function insert(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function insert(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): bool {} /** * Peeks at the node from the top of the heap * @link https://php.net/manual/en/splheap.top.php * @return mixed The value of the node on the top. */ - public function top() {} + #[TentativeType] + public function top(): mixed {} /** * 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. */ - public function count() {} + #[TentativeType] + public function count(): int {} /** * Checks whether the heap is empty. * @link https://php.net/manual/en/splheap.isempty.php * @return bool whether the heap is empty. */ - public function isEmpty() {} + #[TentativeType] + public function isEmpty(): bool {} /** * Rewind iterator back to the start (no-op) * @link https://php.net/manual/en/splheap.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Return current node pointed by the iterator * @link https://php.net/manual/en/splheap.current.php * @return mixed The current node value. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Return current node index * @link https://php.net/manual/en/splheap.key.php * @return int The current node index. */ - public function key() {} + #[TentativeType] + public function key(): int {} /** * Move to the next node * @link https://php.net/manual/en/splheap.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Check whether the heap contains more nodes * @link https://php.net/manual/en/splheap.valid.php * @return bool true if the heap contains any more nodes, false otherwise. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Recover from the corrupted state and allow further actions on the heap. * @link https://php.net/manual/en/splheap.recoverfromcorruption.php - * @return void + * @return bool */ - public function recoverFromCorruption() {} + #[TentativeType] + public function recoverFromCorruption(): bool {} /** * Compare elements in order to place them correctly in the heap while sifting up. @@ -1344,13 +1460,15 @@ abstract protected function compare($value1, $value2); /** * @return bool */ - public function isCorrupted() {} + #[TentativeType] + public function isCorrupted(): bool {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} } /** @@ -1373,10 +1491,11 @@ class SplMinHeap extends SplHeap *

* Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. */ + #[TentativeType] protected function compare( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value1, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value2 - ) {} + ): int {} /** * Extracts a node from top of the heap and sift up. @@ -1479,10 +1598,11 @@ class SplMaxHeap extends SplHeap *

* Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. */ + #[TentativeType] protected function compare( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value1, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value2 - ) {} + ): int {} } /** @@ -1516,10 +1636,11 @@ public function __construct() {} *

* Multiple elements with the same priority will get dequeued in no particular order. */ + #[TentativeType] public function compare( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $priority1, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $priority2 - ) {} + ): int {} /** * Inserts an element in the queue by sifting it up. @@ -1546,72 +1667,82 @@ public function insert( * SplPriorityQueue::extract. *

* SplPriorityQueue::EXTR_DATA (0x00000001): Extract the data - * @return void + * @return int */ - public function setExtractFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setExtractFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): int {} /** * Peeks at the node from the top of the queue * @link https://php.net/manual/en/splpriorityqueue.top.php * @return mixed The value or priority (or both) of the top node, depending on the extract flag. */ - public function top() {} + #[TentativeType] + public function top(): mixed {} /** * Extracts a node from top of the heap and sift up. * @link https://php.net/manual/en/splpriorityqueue.extract.php * @return mixed The value or priority (or both) of the extracted node, depending on the extract flag. */ - public function extract() {} + #[TentativeType] + public function extract(): mixed {} /** * 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. */ - public function count() {} + #[TentativeType] + public function count(): int {} /** * Checks whether the queue is empty. * @link https://php.net/manual/en/splpriorityqueue.isempty.php * @return bool whether the queue is empty. */ - public function isEmpty() {} + #[TentativeType] + public function isEmpty(): bool {} /** * Rewind iterator back to the start (no-op) * @link https://php.net/manual/en/splpriorityqueue.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Return current node pointed by the iterator * @link https://php.net/manual/en/splpriorityqueue.current.php * @return mixed The value or priority (or both) of the current node, depending on the extract flag. */ - public function current() {} + #[TentativeType] + public function current(): mixed {} /** * Return current node index * @link https://php.net/manual/en/splpriorityqueue.key.php * @return int The current node index. */ - public function key() {} + #[TentativeType] + public function key(): int {} /** * Move to the next node * @link https://php.net/manual/en/splpriorityqueue.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Check whether the queue contains more nodes * @link https://php.net/manual/en/splpriorityqueue.valid.php * @return bool true if the queue contains any more nodes, false otherwise. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Recover from the corrupted state and allow further actions on the queue. @@ -1623,18 +1754,21 @@ public function recoverFromCorruption() {} /** * @return bool */ - public function isCorrupted() {} + #[TentativeType] + public function isCorrupted(): bool {} /** * @return int */ - public function getExtractFlags() {} + #[TentativeType] + public function getExtractFlags(): int {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} } /** @@ -1659,14 +1793,16 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * @link https://php.net/manual/en/splfixedarray.count.php * @return int the size of the array. */ - public function count() {} + #[TentativeType] + public function count(): int {} /** * Returns a PHP array from the fixed array * @link https://php.net/manual/en/splfixedarray.toarray.php * @return array a PHP array, similar to the fixed array. */ - public function toArray() {} + #[TentativeType] + public function toArray(): array {} /** * Import a PHP array in a SplFixedArray instance @@ -1680,17 +1816,19 @@ public function toArray() {} * @return SplFixedArray an instance of SplFixedArray * containing the array content. */ + #[TentativeType] public static function fromArray( #[LanguageLevelTypeAware(['8.0' => 'array'], default: '')] $array, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $preserveKeys = true - ) {} + ): SplFixedArray {} /** * Gets the size of the array * @link https://php.net/manual/en/splfixedarray.getsize.php * @return int the size of the array, as an integer. */ - public function getSize() {} + #[TentativeType] + public function getSize(): int {} /** * Change the size of an array @@ -1710,7 +1848,8 @@ public function setSize(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] *

* @return bool true if the requested index exists, otherwise false */ - public function offsetExists($index) {} + #[TentativeType] + public function offsetExists($index): bool {} /** * Returns the value at the specified index @@ -1720,7 +1859,8 @@ public function offsetExists($index) {} *

* @return mixed The value at the specified index. */ - public function offsetGet($index) {} + #[TentativeType] + public function offsetGet($index): mixed {} /** * Sets a new value at a specified index @@ -1733,7 +1873,8 @@ public function offsetGet($index) {} *

* @return void */ - public function offsetSet($index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value) {} + #[TentativeType] + public function offsetSet($index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value): void {} /** * Unsets the value at the specified $index @@ -1743,7 +1884,8 @@ public function offsetSet($index, #[LanguageLevelTypeAware(['8.0' => 'mixed'], d *

* @return void */ - public function offsetUnset($index) {} + #[TentativeType] + public function offsetUnset($index): void {} /** * Rewind iterator back to the start @@ -1778,16 +1920,18 @@ public function next() {} * @link https://php.net/manual/en/splfixedarray.valid.php * @return bool true if the array contains any more elements, false otherwise. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} /** * @return Traversable */ - public function getIterator() {} + public function getIterator(): Iterator {} - public function jsonSerialize() {} + public function jsonSerialize(): array {} } /** @@ -1805,7 +1949,8 @@ interface SplObserver *

* @return void */ - public function update(SplSubject $subject); + #[TentativeType] + public function update(SplSubject $subject): void; } /** @@ -1823,7 +1968,8 @@ interface SplSubject *

* @return void */ - public function attach(SplObserver $observer); + #[TentativeType] + public function attach(SplObserver $observer): void; /** * Detach an observer @@ -1833,14 +1979,16 @@ public function attach(SplObserver $observer); *

* @return void */ - public function detach(SplObserver $observer); + #[TentativeType] + public function detach(SplObserver $observer): void; /** * Notify an observer * @link https://php.net/manual/en/splsubject.notify.php * @return void */ - public function notify(); + #[TentativeType] + public function notify(): void; } /** @@ -1862,10 +2010,11 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess *

* @return void */ + #[TentativeType] public function attach( #[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $info = null - ) {} + ): void {} /** * Removes an object from the storage @@ -1875,7 +2024,8 @@ public function attach( *

* @return void */ - public function detach(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object) {} + #[TentativeType] + public function detach(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object): void {} /** * Checks if the storage contains a specific object @@ -1885,7 +2035,8 @@ public function detach(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '' *

* @return bool true if the object is in the storage, false otherwise. */ - public function contains(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object) {} + #[TentativeType] + public function contains(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object): bool {} /** * Adds all objects from another storage @@ -1893,9 +2044,10 @@ public function contains(#[LanguageLevelTypeAware(['8.0' => 'object'], default: * @param SplObjectStorage $storage

* The storage you want to import. *

- * @return void + * @return int */ - public function addAll(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], default: '')] $storage) {} + #[TentativeType] + public function addAll(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], default: '')] $storage): int {} /** * Removes objects contained in another storage from the current storage @@ -1903,9 +2055,10 @@ public function addAll(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], d * @param SplObjectStorage $storage

* The storage containing the elements to remove. *

- * @return void + * @return int */ - public function removeAll(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], default: '')] $storage) {} + #[TentativeType] + public function removeAll(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], default: '')] $storage): int {} /** * Removes all objects except for those contained in another storage from the current storage @@ -1913,17 +2066,19 @@ public function removeAll(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'] * @param SplObjectStorage $storage

* The storage containing the elements to retain in the current storage. *

- * @return void + * @return int * @since 5.3.6 */ - public function removeAllExcept(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], default: '')] $storage) {} + #[TentativeType] + public function removeAllExcept(#[LanguageLevelTypeAware(['8.0' => 'SplObjectStorage'], default: '')] $storage): int {} /** * Returns the data associated with the current iterator entry * @link https://php.net/manual/en/splobjectstorage.getinfo.php * @return mixed The data associated with the current iterator position. */ - public function getInfo() {} + #[TentativeType] + public function getInfo(): mixed {} /** * Sets the data associated with the current iterator entry @@ -1933,7 +2088,8 @@ public function getInfo() {} *

* @return void */ - public function setInfo(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $info) {} + #[TentativeType] + public function setInfo(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $info): void {} /** * Returns the number of objects in the storage @@ -1941,42 +2097,48 @@ public function setInfo(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '' * @param int $mode [optional] * @return int The number of objects in the storage. */ - public function count(#[PhpStormStubsElementAvailable(from: '8.0')] int $mode = COUNT_NORMAL) {} + #[TentativeType] + public function count(#[PhpStormStubsElementAvailable(from: '8.0')] int $mode = COUNT_NORMAL): int {} /** * Rewind the iterator to the first storage element * @link https://php.net/manual/en/splobjectstorage.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * 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. */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * 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. */ - public function key() {} + #[TentativeType] + public function key(): int {} /** * Returns the current storage entry * @link https://php.net/manual/en/splobjectstorage.current.php * @return object The object at the current iterator position. */ - public function current() {} + #[TentativeType] + public function current(): object {} /** * Move to the next entry * @link https://php.net/manual/en/splobjectstorage.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * Unserializes a storage from its string representation @@ -1987,7 +2149,8 @@ public function next() {} * @return void * @since 5.2.2 */ - public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): void {} /** * Serializes the storage @@ -1995,7 +2158,8 @@ public function unserialize(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return string A string representing the storage. * @since 5.2.2 */ - public function serialize() {} + #[TentativeType] + public function serialize(): string {} /** * Checks whether an object exists in the storage @@ -2006,7 +2170,8 @@ public function serialize() {} * @return bool true if the object exists in the storage, * and false otherwise. */ - public function offsetExists($object) {} + #[TentativeType] + public function offsetExists($object): bool {} /** * Associates data to an object in the storage @@ -2019,10 +2184,11 @@ public function offsetExists($object) {} *

* @return void */ + #[TentativeType] public function offsetSet( #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: '')] $object, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $info = null - ) {} + ): void {} /** * Removes an object from the storage @@ -2032,7 +2198,8 @@ public function offsetSet( *

* @return void */ - public function offsetUnset($object) {} + #[TentativeType] + public function offsetUnset($object): void {} /** * Returns the data associated with an object @@ -2042,7 +2209,8 @@ public function offsetUnset($object) {} *

* @return mixed The data previously associated with the object in the storage. */ - public function offsetGet($object) {} + #[TentativeType] + public function offsetGet($object): mixed {} /** * Calculate a unique identifier for the contained objects @@ -2053,25 +2221,29 @@ public function offsetGet($object) {} * @return string A string with the calculated identifier. * @since 5.4 */ - public function getHash(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object) {} + #[TentativeType] + public function getHash(#[LanguageLevelTypeAware(['8.0' => 'object'], default: '')] $object): string {} /** * @return array * @since 7.4 */ - public function __serialize() {} + #[TentativeType] + public function __serialize(): array {} /** * @param array $data * @since 7.4 */ - public function __unserialize(array $data) {} + #[TentativeType] + public function __unserialize(array $data): void {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} } /** @@ -2097,7 +2269,8 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * @link https://php.net/manual/en/multipleiterator.getflags.php * @return int Information about the flags, as an integer. */ - public function getFlags() {} + #[TentativeType] + public function getFlags(): int {} /** * Sets flags @@ -2108,7 +2281,8 @@ public function getFlags() {} *

* @return void */ - public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): void {} /** * Attaches iterator information @@ -2122,10 +2296,8 @@ public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '') *

* @return void Description... */ - public function attachIterator( - Iterator $iterator, - #[LanguageLevelTypeAware(['8.0' => 'int|string|null'], default: '')] $info = null - ) {} + #[TentativeType] + public function attachIterator(Iterator $iterator, #[LanguageLevelTypeAware(['8.0' => 'int|string|null'], default: '')] $info = null): void {} /** * Detaches an iterator @@ -2135,7 +2307,8 @@ public function attachIterator( *

* @return void */ - public function detachIterator(Iterator $iterator) {} + #[TentativeType] + public function detachIterator(Iterator $iterator): void {} /** * Checks if an iterator is attached @@ -2145,21 +2318,24 @@ public function detachIterator(Iterator $iterator) {} *

* @return bool true on success or false on failure. */ - public function containsIterator(Iterator $iterator) {} + #[TentativeType] + public function containsIterator(Iterator $iterator): bool {} /** * Gets the number of attached iterator instances * @link https://php.net/manual/en/multipleiterator.countiterators.php * @return int The number of attached iterator instances (as an integer). */ - public function countIterators() {} + #[TentativeType] + public function countIterators(): int {} /** * Rewinds all attached iterator instances * @link https://php.net/manual/en/multipleiterator.rewind.php * @return void */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Checks the validity of sub iterators @@ -2167,7 +2343,8 @@ public function rewind() {} * @return bool true if one or all sub iterators are valid depending on flags, * otherwise false */ - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Gets the registered iterator instances @@ -2175,28 +2352,32 @@ public function valid() {} * @return array An array of all registered iterator instances, * or false if no sub iterator is attached. */ - public function key() {} + #[TentativeType] + public function key(): array {} /** * Gets the registered iterator instances * @link https://php.net/manual/en/multipleiterator.current.php - * @return array|false An array containing the current values of each attached iterator, + * @return array An array containing the current values of each attached iterator, * or false if no iterators are attached. - * @throws \RuntimeException if mode MIT_NEED_ALL is set and at least one attached iterator is not valid. - * @throws \InvalidArgumentException if a key is NULL and MIT_KEYS_ASSOC is set. + * @throws RuntimeException if mode MIT_NEED_ALL is set and at least one attached iterator is not valid. + * @throws InvalidArgumentException if a key is NULL and MIT_KEYS_ASSOC is set. */ - public function current() {} + #[TentativeType] + public function current(): array {} /** * Moves all attached iterator instances forward * @link https://php.net/manual/en/multipleiterator.next.php * @return void */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * @return array * @since 7.4 */ - public function __debugInfo() {} + #[TentativeType] + public function __debugInfo(): array {} } diff --git a/SimpleXML/SimpleXML.php b/SimpleXML/SimpleXML.php index 00b7848f8..134359b09 100644 --- a/SimpleXML/SimpleXML.php +++ b/SimpleXML/SimpleXML.php @@ -2,6 +2,7 @@ // Start of SimpleXML v.0.1 use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -19,7 +20,7 @@ class SimpleXMLElement implements Traversable, ArrayAccess, Countable, Iterator, * Use TRUE to specify that data is a path or URL to an XML document instead of string data. * @param string $namespaceOrPrefix Namespace prefix or URI. * @param bool $isPrefix TRUE if ns is a prefix, FALSE if it's a URI; defaults to FALSE. - * @throws \Exception if the XML data could not be parsed. + * @throws Exception if the XML data could not be parsed. * @since 5.0.1 */ #[Pure] @@ -52,7 +53,8 @@ private function __get($name) {} * successfully and FALSE otherwise. * @since 5.0.1 */ - public function asXML(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = null) {} + #[TentativeType] + public function asXML(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = null): string|bool {} /** * Alias of SimpleXMLElement::asXML @@ -67,7 +69,8 @@ public function asXML(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default * parameter is specified, it returns true if the file was written * successfully and false otherwise. */ - public function saveXML(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = null) {} + #[TentativeType] + public function saveXML(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = null): string|bool {} /** * Runs XPath query on XML data @@ -75,10 +78,11 @@ public function saveXML(#[LanguageLevelTypeAware(['8.0' => 'string|null'], defau * @param string $expression

* An XPath path *

- * @return static[]|false an array of SimpleXMLElement objects or FALSE in + * @return static[]|false|null an array of SimpleXMLElement objects or FALSE in * case of an error. */ - public function xpath(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $expression) {} + #[TentativeType] + public function xpath(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $expression): array|false|null {} /** * Creates a prefix/ns context for the next XPath query @@ -94,10 +98,11 @@ public function xpath(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '') *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function registerXPathNamespace( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $prefix, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace - ) {} + ): bool {} /** * Identifies an element's attributes @@ -116,10 +121,11 @@ public function registerXPathNamespace( * object that already represents an attribute and not a tag. * @since 5.0.1 */ + #[TentativeType] public function attributes( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespaceOrPrefix = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isPrefix = false - ) {} + ): ?SimpleXMLElement {} /** * Finds children of given node @@ -133,15 +139,16 @@ public function attributes( * ns will be regarded as a namespace * URL. *

- * @return static a SimpleXMLElement element, whether the node + * @return static|null a SimpleXMLElement element, whether the node * has children or not. * @since 5.0.1 */ #[Pure] + #[TentativeType] public function children( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespaceOrPrefix = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isPrefix = false - ) {} + ): ?SimpleXMLElement {} /** * Returns namespaces used in document @@ -155,7 +162,8 @@ public function children( * @since 5.1.2 */ #[Pure] - public function getNamespaces(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $recursive = false) {} + #[TentativeType] + public function getNamespaces(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $recursive = false): array {} /** * Returns namespaces declared in document @@ -173,10 +181,11 @@ public function getNamespaces(#[LanguageLevelTypeAware(['8.0' => 'bool'], defaul * @since 5.1.2 */ #[Pure] + #[TentativeType] public function getDocNamespaces( #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $recursive = false, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $fromRoot = true - ) {} + ): array|false {} /** * Gets the name of the XML element @@ -186,7 +195,8 @@ public function getDocNamespaces( * @since 5.1.3 */ #[Pure] - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Adds a child element to the XML node @@ -200,15 +210,16 @@ public function getName() {} * @param string $namespace [optional]

* If specified, the namespace to which the child element belongs. *

- * @return static The addChild method returns a SimpleXMLElement + * @return static|null The addChild method returns a SimpleXMLElement * object representing the child added to the XML node. * @since 5.1.3 */ + #[TentativeType] public function addChild( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $value = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace = null - ) {} + ): ?SimpleXMLElement {} /** * Adds an attribute to the SimpleXML element @@ -225,11 +236,12 @@ public function addChild( * @return void No value is returned. * @since 5.1.3 */ + #[TentativeType] public function addAttribute( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'string', '8.1' => 'string|null'], default: '')] $value = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace = null - ) {} + ): void {} /** * (No version information available, might only be in SVN)
@@ -237,6 +249,7 @@ public function addAttribute( * @link https://php.net/manual/en/simplexmlelement.tostring.php * @return string the string content on success or an empty string on failure. */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} /** @@ -245,7 +258,8 @@ public function __toString() {} * @return int the number of elements of an element. */ #[Pure] - public function count() {} + #[TentativeType] + public function count(): int {} /** * Class provides access to children by position, and attributes by name @@ -287,7 +301,8 @@ public function offsetUnset($offset) {} * @link https://php.net/manual/en/simplexmliterator.rewind.php * @return void No value is returned. */ - public function rewind() {} + #[TentativeType] + public function rewind(): void {} /** * Check whether the current element is valid @@ -295,42 +310,48 @@ public function rewind() {} * @return bool TRUE if the current element is valid, otherwise FALSE */ #[Pure] - public function valid() {} + #[TentativeType] + public function valid(): bool {} /** * Returns the current element * @link https://php.net/manual/en/simplexmliterator.current.php - * @return static|null the current element as a SimpleXMLElement object or NULL on failure. + * @return static the current element as a SimpleXMLElement object or NULL on failure. */ #[Pure] - public function current() {} + #[TentativeType] + public function current(): SimpleXMLElement {} /** * Return current key * @link https://php.net/manual/en/simplexmliterator.key.php - * @return string|false the XML tag name of the element referenced by the current SimpleXMLIterator object or FALSE + * @return string the XML tag name of the element referenced by the current SimpleXMLIterator object */ - public function key() {} + #[TentativeType] + public function key(): string {} /** * Move to next element * @link https://php.net/manual/en/simplexmliterator.next.php * @return void No value is returned. */ - public function next() {} + #[TentativeType] + public function next(): void {} /** * @return bool * @since 8.0 */ #[Pure] - public function hasChildren() {} + #[TentativeType] + public function hasChildren(): bool {} /** * @since 8.0 */ #[Pure] - public function getChildren() {} + #[TentativeType] + public function getChildren(): ?SimpleXMLElement {} } /** diff --git a/curl/curl.php b/curl/curl.php index e849a23c0..389e77c78 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -3,6 +3,7 @@ use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; class CURLFile @@ -35,7 +36,8 @@ public function __construct( * @since 5.5 */ #[Pure] - public function getFilename() {} + #[TentativeType] + public function getFilename(): string {} /** * Get MIME type @@ -44,7 +46,8 @@ public function getFilename() {} * @since 5.5 */ #[Pure] - public function getMimeType() {} + #[TentativeType] + public function getMimeType(): string {} /** * Get file name for POST @@ -53,7 +56,8 @@ public function getMimeType() {} * @since 5.5 */ #[Pure] - public function getPostFilename() {} + #[TentativeType] + public function getPostFilename(): string {} /** * Set MIME type @@ -61,7 +65,8 @@ public function getPostFilename() {} * @param string $mime_type * @since 5.5 */ - public function setMimeType(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $mime_type) {} + #[TentativeType] + public function setMimeType(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $mime_type): void {} /** * Set file name for POST @@ -69,7 +74,8 @@ public function setMimeType(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @param string $posted_filename * @since 5.5 */ - public function setPostFilename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $posted_filename) {} + #[TentativeType] + public function setPostFilename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $posted_filename): void {} /** * @link https://secure.php.net/manual/en/curlfile.wakeup.php @@ -78,6 +84,7 @@ public function setPostFilename(#[LanguageLevelTypeAware(['8.0' => 'string'], de */ public function __wakeup() {} } + /** * Initialize a cURL session * @link https://php.net/manual/en/function.curl-init.php @@ -2181,7 +2188,7 @@ function curl_share_init() {} * * * - * @param string $value

+ * @param string $value

* * * @@ -2253,6 +2260,7 @@ function curl_strerror(int $error_code): ?string {} */ #[Pure] function curl_unescape(#[LanguageLevelTypeAware(['8.0' => 'CurlHandle'], default: 'resource')] $handle, string $string): string|false {} + /** * Perform a cURL session * @link https://php.net/manual/en/function.curl-exec.php @@ -2400,7 +2408,7 @@ function curl_multi_select(#[LanguageLevelTypeAware(['8.0' => 'CurlMultiHandle'] * @param int $option

* One of the CURLMOPT_* constants. *

- * @param mixed $value

+ * @param mixed $value

* The value to be set on option. *

*

diff --git a/date/date_c.php b/date/date_c.php index 6ab0b4d7e..e70df0682 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -3,6 +3,7 @@ use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; /** @@ -86,10 +87,11 @@ interface DateTimeInterface * The https://secure.php.net/manual/en/class.dateinterval.php DateInterval} object representing the * difference between the two dates. */ + #[TentativeType] public function diff( DateTimeInterface $targetObject, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $absolute = false - ); + ): DateInterval; /** * (PHP 5 >=5.5.0)
@@ -102,8 +104,8 @@ public function diff( * Returns the formatted date string on success or FALSE on failure. * Since PHP8, it always returns STRING. */ - #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] - public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format); + #[TentativeType] + public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format): string; /** * (PHP 5 >=5.5.0)
@@ -113,7 +115,8 @@ public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '' * or FALSE on failure. Since PHP8, it always returns INT. */ #[LanguageLevelTypeAware(["8.0" => "int"], default: "int|false")] - public function getOffset(); + #[TentativeType] + public function getOffset(): int; /** * (PHP 5 >=5.5.0)
@@ -121,7 +124,8 @@ public function getOffset(); * @return int * Returns the Unix timestamp representing the date. */ - public function getTimestamp(); + #[TentativeType] + public function getTimestamp(): int|false; /** * (PHP 5 >=5.5.0)
@@ -131,7 +135,8 @@ public function getTimestamp(); * Returns a {@link https://secure.php.net/manual/en/class.datetimezone.php DateTimeZone} object on success * or FALSE on failure. */ - public function getTimezone(); + #[TentativeType] + public function getTimezone(): DateTimeZone|false; /** * (PHP 5 >=5.5.0)
@@ -139,7 +144,8 @@ public function getTimezone(); * @link https://secure.php.net/manual/en/datetime.wakeup.php * @return void Initializes a DateTime object. */ - public function __wakeup(); + #[TentativeType] + public function __wakeup(): void; } /** @@ -187,7 +193,8 @@ public function __construct( * @param DateInterval $interval * @return static */ - public function add(DateInterval $interval) {} + #[TentativeType] + public function add(DateInterval $interval): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
@@ -198,11 +205,12 @@ public function add(DateInterval $interval) {} * @param null|DateTimeZone $timezone [optional] * @return DateTimeImmutable|false */ + #[TentativeType] public static function createFromFormat( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime, #[LanguageLevelTypeAware(['8.0' => 'DateTimeZone|null'], default: 'DateTimeZone')] $timezone = null - ) {} + ): DateTimeImmutable|false {} /** * (PHP 5 >=5.6.0)
@@ -211,7 +219,8 @@ public static function createFromFormat( * @param DateTime $object The mutable DateTime object that you want to convert to an immutable version. This object is not modified, but instead a new DateTimeImmutable object is created containing the same date time and timezone information. * @return DateTimeImmutable returns a new DateTimeImmutable instance. */ - public static function createFromMutable(DateTime $object) {} + #[TentativeType] + public static function createFromMutable(DateTime $object): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
@@ -220,19 +229,21 @@ public static function createFromMutable(DateTime $object) {} * @return array|false Returns array containing info about warnings and errors. */ #[ArrayShape(["warning_count" => "int", "warnings" => "string[]", "error_count" => "int", "errors" => "string[]"])] - public static function getLastErrors() {} + #[TentativeType] + public static function getLastErrors(): array|false {} /** * (PHP 5 >=5.5.0)
* Alters the timestamp * @link https://secure.php.net/manual/en/datetimeimmutable.modify.php - * @param string $modifier

A date/time string. Valid formats are explained in + * @param string $modifier

A date/time string. Valid formats are explained in * {@link https://secure.php.net/manual/en/datetime.formats.php Date and Time Formats}.

* @return static|false Returns the newly created object or false on failure. * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ #[Pure] - public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier) {} + #[TentativeType] + public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier): DateTimeImmutable|false {} /** * (PHP 5 >=5.5.0)
@@ -254,27 +265,29 @@ public static function __set_state(array $array) {} * @return static|false * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ + #[TentativeType] public function setDate( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $month, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $day - ) {} + ): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
* Sets the ISO date * @link https://php.net/manual/en/class.datetimeimmutable.php * @param int $year

Year of the date.

- * @param int $week

Week of the date.

+ * @param int $week

Week of the date.

* @param int $dayOfWeek [optional]

Offset from the first day of the week.

* @return static|false * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ + #[TentativeType] public function setISODate( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $week, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $dayOfWeek = 1 - ) {} + ): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
@@ -287,22 +300,24 @@ public function setISODate( * @return static|false * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ + #[TentativeType] public function setTime( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $hour, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $minute, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $second = 0, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $microsecond = 0 - ) {} + ): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
* Sets the date and time based on an Unix timestamp * @link https://secure.php.net/manual/en/datetimeimmutable.settimestamp.php * @param int $timestamp

Unix timestamp representing the date.

- * @return static|false + * @return static * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ - public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp) {} + #[TentativeType] + public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
@@ -312,10 +327,11 @@ public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * A {@link https://secure.php.net/manual/en/class.datetimezone.php DateTimeZone} object representing the * desired time zone. *

- * @return static|false + * @return static * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ - public function setTimezone(DateTimeZone $timezone) {} + #[TentativeType] + public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
@@ -324,10 +340,11 @@ public function setTimezone(DateTimeZone $timezone) {} * @param DateInterval $interval

* A {@link https://secure.php.net/manual/en/class.dateinterval.php DateInterval} object *

- * @return static|false + * @return static * Returns the {@link https://secure.php.net/manual/en/class.datetimeimmutable.php DateTimeImmutable} object for method chaining or FALSE on failure. */ - public function sub(DateInterval $interval) {} + #[TentativeType] + public function sub(DateInterval $interval): DateTimeImmutable {} /** * (PHP 5 >=5.5.0)
@@ -339,10 +356,11 @@ public function sub(DateInterval $interval) {} * The {@link https://secure.php.net/manual/en/class.dateinterval.php DateInterval} object representing the * difference between the two dates or FALSE on failure. */ + #[TentativeType] public function diff( #[LanguageLevelTypeAware(['8.0' => 'DateTimeInterface'], default: '')] $targetObject, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $absolute = false - ) {} + ): DateInterval {} /** * (PHP 5 >=5.5.0)
@@ -354,7 +372,8 @@ public function diff( * @return string * Returns the formatted date string on success or FALSE on failure. */ - public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format) {} + #[TentativeType] + public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format): string {} /** * (PHP 5 >=5.5.0)
@@ -363,7 +382,8 @@ public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '' * Returns the timezone offset in seconds from UTC on success * or FALSE on failure. */ - public function getOffset() {} + #[TentativeType] + public function getOffset(): int {} /** * (PHP 5 >=5.5.0)
@@ -371,7 +391,8 @@ public function getOffset() {} * @return int * Returns the Unix timestamp representing the date. */ - public function getTimestamp() {} + #[TentativeType] + public function getTimestamp(): int {} /** * (PHP 5 >=5.5.0)
@@ -381,7 +402,8 @@ public function getTimestamp() {} * Returns a {@link https://secure.php.net/manual/en/class.datetimezone.php DateTimeZone} object on success * or FALSE on failure. */ - public function getTimezone() {} + #[TentativeType] + public function getTimezone(): DateTimeZone|false {} /** * (PHP 5 >=5.5.0)
@@ -389,14 +411,15 @@ public function getTimezone() {} * @link https://secure.php.net/manual/en/datetime.wakeup.php * @return void Initializes a DateTime object. */ - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} /** * @param DateTimeInterface $object * @return DateTimeImmutable * @since 8.0 */ - public static function createFromInterface(DateTimeInterface $object) {} + public static function createFromInterface(DateTimeInterface $object): DateTimeImmutable {} } /** @@ -507,7 +530,8 @@ public function __construct( * @return void * @link https://php.net/manual/en/datetime.wakeup.php */ - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} /** * Returns date formatted according to given format. @@ -515,7 +539,8 @@ public function __wakeup() {} * @return string * @link https://php.net/manual/en/datetime.format.php */ - public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format) {} + #[TentativeType] + public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format): string {} /** * Alter the timestamp of a DateTime object by incrementing or decrementing @@ -524,7 +549,8 @@ public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '' * @return static|false Returns the DateTime object for method chaining or FALSE on failure. * @link https://php.net/manual/en/datetime.modify.php */ - public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier) {} + #[TentativeType] + public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $modifier): DateTime|false {} /** * Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object @@ -532,14 +558,16 @@ public function modify(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '' * @return static * @link https://php.net/manual/en/datetime.add.php */ - public function add(DateInterval $interval) {} + #[TentativeType] + public function add(DateInterval $interval): DateTime {} /** * @param DateTimeImmutable $object - * @since 7.3 * @return DateTime + * @since 7.3 */ - public static function createFromImmutable(DateTimeImmutable $object) {} + #[TentativeType] + public static function createFromImmutable(DateTimeImmutable $object): DateTime {} /** * Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object @@ -547,14 +575,16 @@ public static function createFromImmutable(DateTimeImmutable $object) {} * @return static * @link https://php.net/manual/en/datetime.sub.php */ - public function sub(DateInterval $interval) {} + #[TentativeType] + public function sub(DateInterval $interval): DateTime {} /** * Get the TimeZone associated with the DateTime * @return DateTimeZone|false * @link https://php.net/manual/en/datetime.gettimezone.php */ - public function getTimezone() {} + #[TentativeType] + public function getTimezone(): DateTimeZone|false {} /** * Set the TimeZone associated with the DateTime @@ -562,14 +592,16 @@ public function getTimezone() {} * @return static * @link https://php.net/manual/en/datetime.settimezone.php */ - public function setTimezone(#[LanguageLevelTypeAware(['8.0' => 'DateTimeZone'], default: '')] $timezone) {} + #[TentativeType] + public function setTimezone(#[LanguageLevelTypeAware(['8.0' => 'DateTimeZone'], default: '')] $timezone): DateTime {} /** * Returns the timezone offset * @return int * @link https://php.net/manual/en/datetime.getoffset.php */ - public function getOffset() {} + #[TentativeType] + public function getOffset(): int {} /** * Sets the current time of the DateTime object to a different time. @@ -580,12 +612,13 @@ public function getOffset() {} * @return static * @link https://php.net/manual/en/datetime.settime.php */ + #[TentativeType] public function setTime( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $hour, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $minute, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $second = 0, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $microsecond = 0 - ) {} + ): DateTime {} /** * Sets the current date of the DateTime object to a different date. @@ -595,11 +628,12 @@ public function setTime( * @return static * @link https://php.net/manual/en/datetime.setdate.php */ + #[TentativeType] public function setDate( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $month, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $day - ) {} + ): DateTime {} /** * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. @@ -609,11 +643,12 @@ public function setDate( * @return static * @link https://php.net/manual/en/datetime.setisodate.php */ + #[TentativeType] public function setISODate( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $year, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $week, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $dayOfWeek = 1 - ) {} + ): DateTime {} /** * Sets the date and time based on a Unix timestamp. @@ -621,14 +656,16 @@ public function setISODate( * @return static * @link https://php.net/manual/en/datetime.settimestamp.php */ - public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp) {} + #[TentativeType] + public function setTimestamp(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestamp): DateTime {} /** * Gets the Unix timestamp. * @return int * @link https://php.net/manual/en/datetime.gettimestamp.php */ - public function getTimestamp() {} + #[TentativeType] + public function getTimestamp(): int {} /** * Returns the difference between two DateTime objects represented as a DateInterval. @@ -637,10 +674,11 @@ public function getTimestamp() {} * @return DateInterval The DateInterval object representing the difference between the two dates. * @link https://php.net/manual/en/datetime.diff.php */ + #[TentativeType] public function diff( #[LanguageLevelTypeAware(['8.0' => 'DateTimeInterface'], default: '')] $targetObject, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $absolute = false - ) {} + ): DateInterval {} /** * Parse a string into a new DateTime object according to the specified format @@ -650,11 +688,12 @@ public function diff( * @return DateTime|false * @link https://php.net/manual/en/datetime.createfromformat.php */ + #[TentativeType] public static function createFromFormat( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime, #[LanguageLevelTypeAware(['8.0' => 'DateTimeZone|null'], default: 'DateTimeZone')] $timezone = null - ) {} + ): DateTime|false {} /** * Returns an array of warnings and errors found while parsing a date/time string @@ -662,7 +701,8 @@ public static function createFromFormat( * @link https://php.net/manual/en/datetime.getlasterrors.php */ #[ArrayShape(["warning_count" => "int", "warnings" => "string[]", "error_count" => "int", "errors" => "string[]"])] - public static function getLastErrors() {} + #[TentativeType] + public static function getLastErrors(): array|false {} /** * The __set_state handler @@ -677,7 +717,7 @@ public static function __set_state($array) {} * @return DateTime * @since 8.0 */ - public static function createFromInterface(DateTimeInterface $object) {} + public static function createFromInterface(DateTimeInterface $object): DateTime {} } /** @@ -712,14 +752,16 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return string * @link https://php.net/manual/en/datetimezone.getname.php */ - public function getName() {} + #[TentativeType] + public function getName(): string {} /** * Returns location information for a timezone * @return array|false * @link https://php.net/manual/en/datetimezone.getlocation.php */ - public function getLocation() {} + #[TentativeType] + public function getLocation(): array|false {} /** * Returns the timezone offset from GMT @@ -727,7 +769,8 @@ public function getLocation() {} * @return int * @link https://php.net/manual/en/datetimezone.getoffset.php */ - public function getOffset(DateTimeInterface $datetime) {} + #[TentativeType] + public function getOffset(DateTimeInterface $datetime): int {} /** * Returns all transitions for the timezone @@ -736,17 +779,19 @@ public function getOffset(DateTimeInterface $datetime) {} * @return array|false * @link https://php.net/manual/en/datetimezone.gettransitions.php */ + #[TentativeType] public function getTransitions( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampBegin = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampEnd = null - ) {} + ): array|false {} /** * Returns associative array containing dst, offset and the timezone name * @return array * @link https://php.net/manual/en/datetimezone.listabbreviations.php */ - public static function listAbbreviations() {} + #[TentativeType] + public static function listAbbreviations(): array {} /** * Returns a numerically indexed array with all timezone identifiers @@ -756,15 +801,17 @@ public static function listAbbreviations() {} * @link https://php.net/manual/en/datetimezone.listidentifiers.php */ #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] + #[TentativeType] public static function listIdentifiers( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timezoneGroup = DateTimeZone::ALL, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $countryCode = null - ) {} + ): array {} /** * @link https://php.net/manual/en/datetime.wakeup.php */ - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} public static function __set_state($an_array) {} } @@ -834,8 +881,8 @@ class DateInterval /** * @param string $duration + * @throws Exception when the $duration cannot be parsed as an interval. * @link https://php.net/manual/en/dateinterval.construct.php - * @throws \Exception when the $duration cannot be parsed as an interval. */ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $duration) {} @@ -845,7 +892,8 @@ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul * @return string * @link https://php.net/manual/en/dateinterval.format.php */ - public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format) {} + #[TentativeType] + public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $format): string {} /** * Sets up a DateInterval from the relative parts of the string @@ -854,9 +902,11 @@ public function format(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '' * instance on success, or FALSE on failure. * @link https://php.net/manual/en/dateinterval.createfromdatestring.php */ - public static function createFromDateString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime) {} + #[TentativeType] + public static function createFromDateString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $datetime): DateInterval|false {} - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} public static function __set_state($an_array) {} } @@ -936,7 +986,8 @@ public function __construct($isostr, $options = 0) {} * @link https://php.net/manual/en/dateperiod.getdateinterval.php * @since 5.6.5 */ - public function getDateInterval() {} + #[TentativeType] + public function getDateInterval(): DateInterval {} /** * Gets the end date @@ -944,7 +995,8 @@ public function getDateInterval() {} * @link https://php.net/manual/en/dateperiod.getenddate.php * @since 5.6.5 */ - public function getEndDate() {} + #[TentativeType] + public function getEndDate(): ?DateTimeInterface {} /** * Gets the start date @@ -952,11 +1004,14 @@ public function getEndDate() {} * @link https://php.net/manual/en/dateperiod.getstartdate.php * @since 5.6.5 */ - public function getStartDate() {} + #[TentativeType] + public function getStartDate(): DateTimeInterface {} - public static function __set_state(#[PhpStormStubsElementAvailable(from: '7.3')] array $array) {} + #[TentativeType] + public static function __set_state(#[PhpStormStubsElementAvailable(from: '7.3')] array $array): DatePeriod {} - public function __wakeup() {} + #[TentativeType] + public function __wakeup(): void {} /** * Get the number of recurrences @@ -964,11 +1019,12 @@ public function __wakeup() {} * @link https://php.net/manual/en/dateperiod.getrecurrences.php * @since 7.2.17 */ - public function getRecurrences() {} + #[TentativeType] + public function getRecurrences(): ?int {} /** - * @return DateTimeInterface[] + * @return Iterator * @since 8.0 */ - public function getIterator() {} + public function getIterator(): Iterator {} } diff --git a/dom/dom_c.php b/dom/dom_c.php index a800b5b4f..31afdc66d 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; /** * The DOMNode class @@ -197,7 +198,8 @@ public function appendChild(DOMNode $node) {} * @link https://php.net/manual/en/domnode.haschildnodes.php * @return bool true on success or false on failure. */ - public function hasChildNodes() {} + #[TentativeType] + public function hasChildNodes(): bool {} /** * Clones a node @@ -215,7 +217,8 @@ public function cloneNode(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: ' * @link https://php.net/manual/en/domnode.normalize.php * @return void */ - public function normalize() {} + #[TentativeType] + public function normalize(): void {} /** * Checks if feature is supported for specified version @@ -230,17 +233,19 @@ public function normalize() {} *

* @return bool true on success or false on failure. */ + #[TentativeType] public function isSupported( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $feature, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $version - ) {} + ): bool {} /** * Checks if node has attributes * @link https://php.net/manual/en/domnode.hasattributes.php * @return bool true on success or false on failure. */ - public function hasAttributes() {} + #[TentativeType] + public function hasAttributes(): bool {} /** * @param DOMNode $other @@ -255,7 +260,8 @@ public function compareDocumentPosition(DOMNode $other) {} *

* @return bool true on success or false on failure. */ - public function isSameNode(DOMNode $otherNode) {} + #[TentativeType] + public function isSameNode(DOMNode $otherNode): bool {} /** * Gets the namespace prefix of the node based on the namespace URI @@ -265,7 +271,8 @@ public function isSameNode(DOMNode $otherNode) {} *

* @return string The prefix of the namespace. */ - public function lookupPrefix(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace) {} + #[TentativeType] + public function lookupPrefix(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace): ?string {} /** * Checks if the specified namespaceURI is the default namespace or not @@ -276,7 +283,8 @@ public function lookupPrefix(#[LanguageLevelTypeAware(['8.0' => 'string'], defau * @return bool Return true if namespaceURI is the default * namespace, false otherwise. */ - public function isDefaultNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace) {} + #[TentativeType] + public function isDefaultNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace): bool {} /** * Gets the namespace URI of the node based on the prefix @@ -287,7 +295,8 @@ public function isDefaultNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], * @return string The namespace URI of the node. */ #[PhpStormStubsElementAvailable(from: '8.0')] - public function lookupNamespaceURI(?string $prefix) {} + #[TentativeType] + public function lookupNamespaceURI(?string $prefix): ?string {} /** * Gets the namespace URI of the node based on the prefix @@ -299,6 +308,7 @@ public function lookupNamespaceURI(?string $prefix) {} */ #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] public function lookupNamespaceUri($prefix) {} + /** * @param DOMNode $arg * @return bool @@ -330,14 +340,16 @@ public function getUserData($key) {} * @return string|null the XPath, or NULL in case of an error. * @link https://secure.php.net/manual/en/domnode.getnodepath.php */ - public function getNodePath() {} + #[TentativeType] + public function getNodePath(): ?string {} - /** - * Get line number for a node - * @link https://php.net/manual/en/domnode.getlineno.php - * @return int Always returns the line number where the node was defined in. - */ - public function getLineNo() {} + /** + * Get line number for a node + * @link https://php.net/manual/en/domnode.getlineno.php + * @return int Always returns the line number where the node was defined in. + */ + #[TentativeType] + public function getLineNo(): int {} /** * Canonicalize nodes to a string @@ -347,12 +359,13 @@ public function getLineNo() {} * @param null|array $nsPrefixes [optional] An array of namespace prefixes to filter the nodes by. * @return string|false Canonicalized nodes as a string or FALSE on failure */ + #[TentativeType] public function C14N( #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $exclusive = false, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $withComments = false, #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: 'array')] $xpath = null, #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: 'array')] $nsPrefixes = null - ) {} + ): string|false {} /** * Canonicalize nodes to a file. @@ -364,13 +377,14 @@ public function C14N( * @param null|array $nsPrefixes [optional] An array of namespace prefixes to filter the nodes by. * @return int|false Number of bytes written or FALSE on failure */ + #[TentativeType] public function C14NFile( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $uri, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $exclusive = false, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $withComments = false, #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: 'array')] $xpath = null, #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: 'array')] $nsPrefixes = null - ) {} + ): int|false {} } /** @@ -389,11 +403,11 @@ class DOMException extends Exception class DOMStringList { - /** - * @param $index - * @return mixed - */ - public function item($index) {} + /** + * @param $index + * @return mixed + */ + public function item($index) {} } /** @@ -402,17 +416,17 @@ public function item($index) {} */ class DOMNameList { - /** - * @param $index - * @return mixed - */ - public function getName($index) {} - - /** - * @param $index - * @return mixed - */ - public function getNamespaceURI($index) {} + /** + * @param $index + * @return mixed + */ + public function getName($index) {} + + /** + * @param $index + * @return mixed + */ + public function getNamespaceURI($index) {} } /** @@ -420,11 +434,11 @@ public function getNamespaceURI($index) {} */ class DOMImplementationList { - /** - * @param $index - * @return mixed - */ - public function item($index) {} + /** + * @param $index + * @return mixed + */ + public function item($index) {} } /** @@ -432,17 +446,17 @@ public function item($index) {} */ class DOMImplementationSource { - /** - * @param $features - * @return mixed - */ - public function getDomimplementation($features) {} - - /** - * @param $features - * @return mixed - */ - public function getDomimplementations($features) {} + /** + * @param $features + * @return mixed + */ + public function getDomimplementation($features) {} + + /** + * @param $features + * @return mixed + */ + public function getDomimplementations($features) {} } /** @@ -458,10 +472,11 @@ class DOMImplementation * @param string $version * @return mixed */ + #[TentativeType] public function getFeature( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $feature, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $version - ) {} + ): never {} /** * Test if the DOM implementation implements a specific feature @@ -571,17 +586,18 @@ public function __construct() {} *

* @return bool true on success or false on failure. */ - public function appendXML(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function appendXML(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): bool {} /** * {@inheritDoc} */ - public function append(...$nodes) {} + public function append(...$nodes): void {} /** * {@inheritDoc} */ - public function prepend(...$nodes) {} + public function prepend(...$nodes): void {} } /** @@ -786,7 +802,8 @@ public function createElement( * @link https://php.net/manual/en/domdocument.createdocumentfragment.php * @return DOMDocumentFragment|false The new DOMDocumentFragment or false if an error occurred. */ - public function createDocumentFragment() {} + #[TentativeType] + public function createDocumentFragment(): DOMDocumentFragment {} /** * Create new text node @@ -796,7 +813,8 @@ public function createDocumentFragment() {} *

* @return DOMText|false The new DOMText or false if an error occurred. */ - public function createTextNode(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function createTextNode(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): DOMText {} /** * Create new comment node @@ -806,7 +824,8 @@ public function createTextNode(#[LanguageLevelTypeAware(['8.0' => 'string'], def *

* @return DOMComment|false The new DOMComment or false if an error occurred. */ - public function createComment(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function createComment(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): DOMComment {} /** * Create new cdata node @@ -868,7 +887,8 @@ public function createEntityReference(#[LanguageLevelTypeAware(['8.0' => 'string * @return DOMNodeList A new DOMNodeList object containing all the matched * elements. */ - public function getElementsByTagName(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function getElementsByTagName(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): DOMNodeList {} /** * Import node into current document @@ -940,10 +960,11 @@ public function createAttributeNS( * @return DOMNodeList A new DOMNodeList object containing all the matched * elements. */ + #[TentativeType] public function getElementsByTagNameNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName - ) {} + ): DOMNodeList {} /** * Searches for an element with a certain id @@ -954,7 +975,8 @@ public function getElementsByTagNameNS( * @return DOMElement|null The DOMElement or null if the element is * not found. */ - public function getElementById(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $elementId) {} + #[TentativeType] + public function getElementById(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $elementId): ?DOMElement {} /** * @param DOMNode $node @@ -964,19 +986,20 @@ public function adoptNode(DOMNode $node) {} /** * {@inheritDoc} */ - public function append(...$nodes) {} + public function append(...$nodes): void {} /** * {@inheritDoc} */ - public function prepend(...$nodes) {} + public function prepend(...$nodes): void {} /** * Normalizes the document * @link https://php.net/manual/en/domdocument.normalizedocument.php * @return void */ - public function normalizeDocument() {} + #[TentativeType] + public function normalizeDocument(): void {} /** * @param DOMNode $node @@ -1048,7 +1071,8 @@ public function loadXML( *

* @return string|false the XML, or false if an error occurred. */ - public function saveXML(?DOMNode $node = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null) {} + #[TentativeType] + public function saveXML(?DOMNode $node = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null): string|false {} /** * Creates a new DOMDocument object @@ -1067,7 +1091,8 @@ public function __construct( * @return bool true on success or false on failure. * If the document have no DTD attached, this method will return false. */ - public function validate() {} + #[TentativeType] + public function validate(): bool {} /** * Substitutes XIncludes in a DOMDocument Object @@ -1076,9 +1101,10 @@ public function validate() {} * libxml parameters. Available * since PHP 5.1.0 and Libxml 2.6.7. *

- * @return int the number of XIncludes in the document. + * @return int|false the number of XIncludes in the document. */ - public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null) {} + #[TentativeType] + public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null): int|false {} /** * Load HTML from a string @@ -1134,7 +1160,8 @@ public function saveHTML(DOMNode $node = null) {} *

* @return int|false the number of bytes written or false if an error occurred. */ - public function saveHTMLFile(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename) {} + #[TentativeType] + public function saveHTMLFile(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename): int|false {} /** * Validates a document based on a schema @@ -1170,7 +1197,8 @@ public function schemaValidateSource($source, $flags) {} *

* @return bool true on success or false on failure. */ - public function relaxNGValidate(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename) {} + #[TentativeType] + public function relaxNGValidate(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename): bool {} /** * Performs relaxNG validation on the document @@ -1180,7 +1208,8 @@ public function relaxNGValidate(#[LanguageLevelTypeAware(['8.0' => 'string'], de *

* @return bool true on success or false on failure. */ - public function relaxNGValidateSource(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $source) {} + #[TentativeType] + public function relaxNGValidateSource(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $source): bool {} /** * Register extended class used to create base node type @@ -1196,10 +1225,11 @@ public function relaxNGValidateSource(#[LanguageLevelTypeAware(['8.0' => 'string *

* @return bool true on success or false on failure. */ + #[TentativeType] public function registerNodeClass( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $baseClass, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extendedClass - ) {} + ): bool {} } /** @@ -1232,13 +1262,14 @@ public function item(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $i /** * @since 7.2 */ - public function count() {} + #[TentativeType] + public function count(): int {} /** + * @return Iterator * @since 8.0 - * @return Traversable */ - public function getIterator() {} + public function getIterator(): Iterator {} } /** @@ -1257,7 +1288,8 @@ class DOMNamedNodeMap implements IteratorAggregate, Countable * @return DOMNode|null A node (of any type) with the specified nodeName, or * null if no node is found. */ - public function getNamedItem(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function getNamedItem(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): ?DOMNode {} /** * @param DOMNode $arg @@ -1279,7 +1311,8 @@ public function removeNamedItem($name) {} * if that is not a valid index (greater than or equal to the number of nodes * in this map). */ - public function item(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index) {} + #[TentativeType] + public function item(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index): ?DOMNode {} /** * Retrieves a node specified by local name and namespace URI @@ -1293,10 +1326,11 @@ public function item(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $i * @return DOMNode|null A node (of any type) with the specified local name and namespace URI, or * null if no node is found. */ + #[TentativeType] public function getNamedItemNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName - ) {} + ): ?DOMNode {} /** * @param DOMNode $arg [optional] @@ -1310,16 +1344,17 @@ public function setNamedItemNS(DOMNode $arg) {} public function removeNamedItemNS($namespace, $localName) {} /** - * @since 7.2 * @return int + * @since 7.2 */ - public function count() {} + #[TentativeType] + public function count(): int {} /** - * @since 8.0 * @return Traversable + * @since 8.0 */ - public function getIterator() {} + public function getIterator(): Iterator {} } /** @@ -1377,7 +1412,8 @@ public function substringData( *

* @return void */ - public function appendData(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + #[TentativeType] + public function appendData(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): bool {} /** * Insert a string at the specified 16-bit unit offset @@ -1388,12 +1424,13 @@ public function appendData(#[LanguageLevelTypeAware(['8.0' => 'string'], default * @param string $data

* The string to insert. *

- * @return void + * @return bool */ + #[TentativeType] public function insertData( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data - ) {} + ): bool {} /** * Remove a range of characters from the node @@ -1408,10 +1445,11 @@ public function insertData( *

* @return void */ + #[TentativeType] public function deleteData( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $count - ) {} + ): bool {} /** * Replace a substring within the DOMCharacterData node @@ -1427,33 +1465,34 @@ public function deleteData( * @param string $data

* The string with which the range must be replaced. *

- * @return void + * @return bool */ + #[TentativeType] public function replaceData( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $count, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data - ) {} + ): bool {} /** * {@inheritDoc} */ - public function remove() {} + public function remove(): void {} /** * {@inheritDoc} */ - public function before(...$nodes) {} + public function before(...$nodes): void {} /** * {@inheritDoc} */ - public function after(...$nodes) {} + public function after(...$nodes): void {} /** * {@inheritDoc} */ - public function replaceWith(...$nodes) {} + public function replaceWith(...$nodes): void {} } /** @@ -1512,7 +1551,8 @@ class DOMAttr extends DOMNode * @link https://php.net/manual/en/domattr.isid.php * @return bool true on success or false on failure. */ - public function isId() {} + #[TentativeType] + public function isId(): bool {} /** * Creates a new {@see DOMAttr} object @@ -1523,8 +1563,7 @@ public function isId() {} */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value - = '' + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value = '' ) {} } @@ -1609,7 +1648,8 @@ class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode * @return string The value of the attribute, or an empty string if no attribute with the * given name is found. */ - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): string {} /** * Adds new attribute @@ -1635,7 +1675,8 @@ public function setAttribute( *

* @return bool true on success or false on failure. */ - public function removeAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function removeAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): bool {} /** * Returns attribute node @@ -1677,7 +1718,8 @@ public function removeAttributeNode(DOMAttr $attr) {} * @return DOMNodeList This function returns a new instance of the class * DOMNodeList of all matched elements. */ - public function getElementsByTagName(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function getElementsByTagName(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): DOMNodeList {} /** * Returns value of attribute @@ -1692,10 +1734,11 @@ public function getElementsByTagName(#[LanguageLevelTypeAware(['8.0' => 'string' * given localName and namespaceURI * is found. */ + #[TentativeType] public function getAttributeNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName - ) {} + ): string {} /** * Adds new attribute @@ -1711,11 +1754,12 @@ public function getAttributeNS( *

* @return void */ + #[TentativeType] public function setAttributeNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value - ) {} + ): void {} /** * Removes attribute @@ -1728,10 +1772,11 @@ public function setAttributeNS( *

* @return bool true on success or false on failure. */ + #[TentativeType] public function removeAttributeNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName - ) {} + ): void {} /** * Returns attribute node @@ -1771,10 +1816,11 @@ public function setAttributeNodeNS(DOMAttr $attr) {} * DOMNodeList of all matched elements in the order in * which they are encountered in a preorder traversal of this element tree. */ + #[TentativeType] public function getElementsByTagNameNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName - ) {} + ): DOMNodeList {} /** * Checks to see if attribute exists @@ -1784,7 +1830,8 @@ public function getElementsByTagNameNS( *

* @return bool true on success or false on failure. */ - public function hasAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function hasAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): bool {} /** * Checks to see if attribute exists @@ -1797,10 +1844,11 @@ public function hasAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], defau *

* @return bool true on success or false on failure. */ + #[TentativeType] public function hasAttributeNS( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName - ) {} + ): bool {} /** * Declares the attribute specified by name to be of type ID @@ -1814,10 +1862,11 @@ public function hasAttributeNS( *

* @return void */ + #[TentativeType] public function setIdAttribute( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isId - ) {} + ): void {} /** * Declares the attribute specified by local name and namespace URI to be of type ID @@ -1834,11 +1883,12 @@ public function setIdAttribute( *

* @return void */ + #[TentativeType] public function setIdAttributeNS( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isId - ) {} + ): void {} /** * Declares the attribute specified by node to be of type ID @@ -1852,37 +1902,38 @@ public function setIdAttributeNS( *

* @return void */ - public function setIdAttributeNode(DOMAttr $attr, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isId) {} + #[TentativeType] + public function setIdAttributeNode(DOMAttr $attr, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isId): void {} /** * {@inheritDoc} */ - public function remove() {} + public function remove(): void {} /** * {@inheritDoc} */ - public function before(...$nodes) {} + public function before(...$nodes): void {} /** * {@inheritDoc} */ - public function after(...$nodes) {} + public function after(...$nodes): void {} /** * {@inheritDoc} */ - public function replaceWith(...$nodes) {} + public function replaceWith(...$nodes): void {} /** * {@inheritDoc} */ - public function append(...$nodes) {} + public function append(...$nodes): void {} /** * {@inheritDoc} */ - public function prepend(...$nodes) {} + public function prepend(...$nodes): void {} /** * Creates a new DOMElement object @@ -1929,9 +1980,11 @@ public function splitText(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '' * @link https://php.net/manual/en/domtext.iswhitespaceinelementcontent.php * @return bool true on success or false on failure. */ - public function isWhitespaceInElementContent() {} + #[TentativeType] + public function isWhitespaceInElementContent(): bool {} - public function isElementContentWhitespace() {} + #[TentativeType] + public function isElementContentWhitespace(): bool {} /** * @param $content @@ -2262,10 +2315,11 @@ public function __construct(DOMDocument $document, #[PhpStormStubsElementAvailab *

* @return bool true on success or false on failure. */ + #[TentativeType] public function registerNamespace( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $prefix, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace - ) {} + ): bool {} /** * Evaluates the given XPath expression @@ -2285,11 +2339,12 @@ public function registerNamespace( * will return an empty DOMNodeList. The return is false if the expression * is malformed or the contextnode is invalid. */ + #[TentativeType] public function query( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $expression, #[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $contextNode = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $registerNodeNS = true - ) {} + ): mixed {} /** * Evaluates the given XPath expression and returns a typed result if possible. @@ -2309,11 +2364,12 @@ public function query( * @return mixed a typed result if possible or a DOMNodeList * containing all nodes matching the given XPath expression. */ + #[TentativeType] public function evaluate( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $expression, #[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $contextNode = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $registerNodeNS = true - ) {} + ): mixed {} /** * Register PHP functions as XPath functions @@ -2347,7 +2403,7 @@ interface DOMParentNode * @return void * @since 8.0 */ - public function append(...$nodes); + public function append(...$nodes): void; /** * Prepends one or many nodes to the list of children before the first @@ -2357,7 +2413,7 @@ public function append(...$nodes); * @return void * @since 8.0 */ - public function prepend(...$nodes); + public function prepend(...$nodes): void; } /** @@ -2374,7 +2430,7 @@ interface DOMChildNode * @return void * @since 8.0 */ - public function remove(); + public function remove(): void; /** * Add passed node(s) before the current node @@ -2383,7 +2439,7 @@ public function remove(); * @return void * @since 8.0 */ - public function before(...$nodes); + public function before(...$nodes): void; /** * Add passed node(s) after the current node @@ -2392,7 +2448,7 @@ public function before(...$nodes); * @return void * @since 8.0 */ - public function after(...$nodes); + public function after(...$nodes): void; /** * Replace current node with new node(s), a combination @@ -2402,5 +2458,5 @@ public function after(...$nodes); * @return void * @since 8.0 */ - public function replaceWith(...$nodes); + public function replaceWith(...$nodes): void; } diff --git a/fileinfo/fileinfo.php b/fileinfo/fileinfo.php index 513361120..96c0472b6 100644 --- a/fileinfo/fileinfo.php +++ b/fileinfo/fileinfo.php @@ -2,8 +2,9 @@ // Start of fileinfo v.1.0.5 -use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; class finfo @@ -54,11 +55,12 @@ public function set_flags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '' * filename argument, or FALSE if an error occurred. */ #[Pure] + #[TentativeType] public function file( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FILEINFO_NONE, $context = null - ) {} + ): string|false {} /** * (PHP 5 >= 5.3.0, PECL fileinfo >= 0.1.0)
@@ -76,11 +78,12 @@ public function file( * argument, or FALSE if an error occurred. */ #[Pure] + #[TentativeType] public function buffer( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FILEINFO_NONE, $context = null - ) {} + ): string|false {} } /** diff --git a/hash/hash.php b/hash/hash.php index a48eff697..8b0fc7de0 100644 --- a/hash/hash.php +++ b/hash/hash.php @@ -447,15 +447,18 @@ function mhash(int $algo, string $data, ?string $key): string|false {} */ define('MHASH_XXH128', 41); +/** + * @since 7.2 + */ class HashContext { private function __construct() {} - public function __serialize() {} + public function __serialize(): array {} /** * @param array $data */ - public function __unserialize(#[LanguageLevelTypeAware(['8.0' => 'array'], default: '')] $data) {} + public function __unserialize(#[LanguageLevelTypeAware(['8.0' => 'array'], default: '')] $data): void {} } // End of hash v.1.0 diff --git a/intl/IntlChar.php b/intl/IntlChar.php index 217b530ff..39811a548 100644 --- a/intl/IntlChar.php +++ b/intl/IntlChar.php @@ -1,6 +1,7 @@ 'int|string'], default: '')] $codepoint, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property - ) {} + ): ?bool {} /** * @link https://php.net/manual/en/intlchar.charage.php @@ -698,7 +700,8 @@ public static function hasBinaryProperty( * Or NULL if codepoint is out of bounds. * @since 7.0 */ - public static function charAge(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function charAge(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?array {} /** * @link https://php.net/manual/en/intlchar.chardigitvalue.php @@ -708,7 +711,8 @@ public static function charAge(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * Or NULL if codepoint is out of bounds. * @since 7.0 */ - public static function charDigitValue(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function charDigitValue(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?int {} /** * Get bidirectional category value for a code point @@ -745,7 +749,8 @@ public static function charDigitValue(#[LanguageLevelTypeAware(['8.0' => 'int|st * Or NULL if codepoint is out of bounds. * @since 7.0 */ - public static function charDirection(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function charDirection(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?int {} /** * @link https://php.net/manual/en/intlchar.charfromname.php @@ -763,10 +768,11 @@ public static function charDirection(#[LanguageLevelTypeAware(['8.0' => 'int|str * @return int|null The Unicode value of the code point with the given name (as an integer), or NULL if there is no such code point. * @since 7.0 */ + #[TentativeType] public static function charFromName( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = IntlChar::UNICODE_CHAR_NAME - ) {} + ): ?int {} /** * @link https://php.net/manual/en/intlchar.charmirror.php @@ -776,7 +782,8 @@ public static function charFromName( * The return type will be integer unless the code point was passed as a UTF-8 string, in which case a string will be returned. * Or NULL if codepoint will be out of bound. */ - public static function charMirror(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function charMirror(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): string|int|null {} /** * Retrieve the name of a Unicode character @@ -793,10 +800,11 @@ public static function charMirror(#[LanguageLevelTypeAware(['8.0' => 'int|string * @return string|null The corresponding name, or an empty string if there is no name for this character, or NULL if codepoint is out of bounds. * @since 7.0 */ + #[TentativeType] public static function charName( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = IntlChar::UNICODE_CHAR_NAME - ) {} + ): ?string {} /** * Get the general category value for a code point @@ -839,7 +847,8 @@ public static function charName( *

Or NULL if codepoint is out of bound.

'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function charType(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?int {} /** * Return Unicode character by code point value @@ -849,7 +858,8 @@ public static function charType(#[LanguageLevelTypeAware(['8.0' => 'int|string'] * Or NULL if codepoint is out of bound. * @since 7.0 */ - public static function chr(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function chr(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?string {} /** * Get the decimal digit value of a code point for a given radix @@ -861,10 +871,11 @@ public static function chr(#[LanguageLevelTypeAware(['8.0' => 'int|string'], def * or NULL if codepoint is out of bound. * @since 7.0 */ + #[TentativeType] public static function digit( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $base = 10 - ) {} + ): int|false|null {} /** * Enumerate all assigned Unicode characters within a range @@ -889,12 +900,13 @@ public static function digit( * * @since 7.0 */ + #[TentativeType] public static function enumCharNames( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $start, #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $end, #[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = IntlChar::UNICODE_CHAR_NAME - ) {} + ): ?bool {} /** * Enumerate all code points with their Unicode general categories @@ -909,7 +921,8 @@ public static function enumCharNames( * * @since 7.0 */ - public static function enumCharTypes(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback = null) {} + #[TentativeType] + public static function enumCharTypes(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback = null): void {} /** * Perform case folding on a code point @@ -920,10 +933,11 @@ public static function enumCharTypes(#[LanguageLevelTypeAware(['8.0' => 'callabl * Returns NULL if codepoint is out of bound. * @since 7.0 */ + #[TentativeType] public static function foldCase( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = IntlChar::FOLD_CASE_DEFAULT - ) {} + ): string|int|null {} /** * Get character representation for a given digit and radix @@ -933,10 +947,11 @@ public static function foldCase( * @return int The character representation (as a string) of the specified digit in the specified radix. * @since 7.0 */ + #[TentativeType] public static function forDigit( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $digit, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $base = 10 - ) {} + ): int {} /** * Get the paired bracket character for a code point @@ -947,7 +962,8 @@ public static function forDigit( * Or NULL if codepoint is out of bound. * @since 7.0 */ - public static function getBidiPairedBracket(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function getBidiPairedBracket(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): string|int|null {} /** * Get the Unicode allocation block containing a code point @@ -957,7 +973,8 @@ public static function getBidiPairedBracket(#[LanguageLevelTypeAware(['8.0' => ' * See the IntlChar::BLOCK_CODE_* constants for possible return values. * @since 7.0 */ - public static function getBlockCode(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function getBlockCode(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?int {} /** * Get the combining class of a code point @@ -967,7 +984,8 @@ public static function getBlockCode(#[LanguageLevelTypeAware(['8.0' => 'int|stri * Or NULL if codepoint is out of bound. * @since 7.0 */ - public static function getCombiningClass(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function getCombiningClass(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?int {} /** * Get the FC_NFKC_Closure property for a code point @@ -978,7 +996,8 @@ public static function getCombiningClass(#[LanguageLevelTypeAware(['8.0' => 'int * or FALSE if there was an error. * @since 7.0 */ - public static function getFC_NFKC_Closure(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function getFC_NFKC_Closure(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): string|false|null {} /** * Get the max value for a Unicode property @@ -987,7 +1006,8 @@ public static function getFC_NFKC_Closure(#[LanguageLevelTypeAware(['8.0' => 'in * @return int The maximum value returned by {@see IntlChar::getIntPropertyValue()} for a Unicode property. <=0 if the property selector is out of range. * @since 7.0 */ - public static function getIntPropertyMaxValue(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property) {} + #[TentativeType] + public static function getIntPropertyMaxValue(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property): int {} /** * Get the min value for a Unicode property @@ -996,7 +1016,8 @@ public static function getIntPropertyMaxValue(#[LanguageLevelTypeAware(['8.0' => * @return int The minimum value returned by {@see IntlChar::getIntPropertyValue()} for a Unicode property. 0 if the property selector is out of range. * @since 7.0 */ - public static function getIntPropertyMinValue(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property) {} + #[TentativeType] + public static function getIntPropertyMinValue(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property): int {} /** * Get the value for a Unicode property for a code point @@ -1022,10 +1043,11 @@ public static function getIntPropertyMinValue(#[LanguageLevelTypeAware(['8.0' => *

* @since 7.0 */ + #[TentativeType] public static function getIntPropertyValue( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property - ) {} + ): ?int {} /** * Get the numeric value for a Unicode code point @@ -1034,7 +1056,8 @@ public static function getIntPropertyValue( * @return float|null Numeric value of codepoint, or float(-123456789) if none is defined, or NULL if codepoint is out of bound. * @since 7.0 */ - public static function getNumericValue(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function getNumericValue(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?float {} /** * Get the property constant value for a given property name @@ -1043,7 +1066,8 @@ public static function getNumericValue(#[LanguageLevelTypeAware(['8.0' => 'int|s * @return int Returns an IntlChar::PROPERTY_ constant value, or IntlChar::PROPERTY_INVALID_CODE if the given name does not match any property. * @since 7.0 */ - public static function getPropertyEnum(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $alias) {} + #[TentativeType] + public static function getPropertyEnum(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $alias): int {} /** * Get the Unicode name for a property @@ -1064,10 +1088,11 @@ public static function getPropertyEnum(#[LanguageLevelTypeAware(['8.0' => 'strin *

* @since 7.0 */ + #[TentativeType] public static function getPropertyName( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = IntlChar::LONG_PROPERTY_NAME - ) {} + ): string|false {} /** * Get the property value for a given value name @@ -1078,10 +1103,11 @@ public static function getPropertyName( * @return int Returns the corresponding value integer, or IntlChar::PROPERTY_INVALID_CODE if the given name does not match any value of the given property, or if the property is invalid. * @since 7.0 */ + #[TentativeType] public static function getPropertyValueEnum( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name - ) {} + ): int {} /** * Get the Unicode name for a property value @@ -1111,11 +1137,12 @@ public static function getPropertyValueEnum( * If a given nameChoice returns FALSE, then all larger values of nameChoice will return FALSE, with one exception: if FALSE is returned for IntlChar::SHORT_PROPERTY_NAME, then IntlChar::LONG_PROPERTY_NAME (and higher) may still return a non-FALSE value. * @since 7.0 */ + #[TentativeType] public static function getPropertyValueName( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $value, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = IntlChar::LONG_PROPERTY_NAME - ) {} + ): string|false {} /** * Get the Unicode version @@ -1123,7 +1150,8 @@ public static function getPropertyValueName( * @return array An array containing the Unicode version number. * @since 7.0 */ - public static function getUnicodeVersion() {} + #[TentativeType] + public static function getUnicodeVersion(): array {} /** * Check if code point is an alphanumeric character @@ -1132,7 +1160,8 @@ public static function getUnicodeVersion() {} * @return bool|null Returns TRUE if codepoint is an alphanumeric character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isalnum(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isalnum(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is a letter character @@ -1141,7 +1170,9 @@ public static function isalnum(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a letter character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isalpha(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isalpha(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a base character * @link https://php.net/manual/en/intlchar.isbase.php @@ -1149,7 +1180,9 @@ public static function isalpha(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a base character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isbase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isbase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a "blank" or "horizontal space" character * @link https://php.net/manual/en/intlchar.isblank.php @@ -1157,7 +1190,8 @@ public static function isbase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is either a "blank" or "horizontal space" character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isblank(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isblank(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is a control character @@ -1166,7 +1200,8 @@ public static function isblank(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a control character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function iscntrl(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function iscntrl(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check whether the code point is defined @@ -1175,7 +1210,8 @@ public static function iscntrl(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a defined character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isdefined(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isdefined(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is a digit character @@ -1184,7 +1220,9 @@ public static function isdefined(#[LanguageLevelTypeAware(['8.0' => 'int|string' * @return bool|null Returns TRUE if codepoint is a digit character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isdigit(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isdigit(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a graphic character * @link https://php.net/manual/en/intlchar.isgraph.php @@ -1192,7 +1230,9 @@ public static function isdigit(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a "graphic" character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isgraph(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isgraph(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is an ignorable character * @link https://php.net/manual/en/intlchar.isidignorable.php @@ -1200,7 +1240,9 @@ public static function isgraph(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is ignorable in identifiers, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isIDIgnorable(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isIDIgnorable(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is permissible in an identifier * @link https://php.net/manual/en/intlchar.isidpart.php @@ -1208,7 +1250,8 @@ public static function isIDIgnorable(#[LanguageLevelTypeAware(['8.0' => 'int|str * @return bool|null Returns TRUE if codepoint is the code point may occur in an identifier, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isIDPart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isIDPart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is permissible as the first character in an identifier @@ -1217,7 +1260,9 @@ public static function isIDPart(#[LanguageLevelTypeAware(['8.0' => 'int|string'] * @return bool|null Returns TRUE if codepoint may start an identifier, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isIDStart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isIDStart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is an ISO control code * @link https://php.net/manual/en/intlchar.isisocontrol.php @@ -1225,7 +1270,9 @@ public static function isIDStart(#[LanguageLevelTypeAware(['8.0' => 'int|string' * @return bool|null Returns TRUE if codepoint is an ISO control code, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isISOControl(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isISOControl(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is permissible in a Java identifier * @link https://php.net/manual/en/intlchar.isjavaidpart.php @@ -1233,7 +1280,9 @@ public static function isISOControl(#[LanguageLevelTypeAware(['8.0' => 'int|stri * @return bool|null Returns TRUE if codepoint may occur in a Java identifier, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isJavaIDPart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isJavaIDPart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is permissible as the first character in a Java identifier * @link https://php.net/manual/en/intlchar.isjavaidstart.php @@ -1241,7 +1290,9 @@ public static function isJavaIDPart(#[LanguageLevelTypeAware(['8.0' => 'int|stri * @return bool|null Returns TRUE if codepoint may start a Java identifier, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isJavaIDStart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isJavaIDStart(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a space character according to Java * @link https://php.net/manual/en/intlchar.isjavaspacechar.php @@ -1249,7 +1300,8 @@ public static function isJavaIDStart(#[LanguageLevelTypeAware(['8.0' => 'int|str * @return bool|null Returns TRUE if codepoint is a space character according to Java, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isJavaSpaceChar(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isJavaSpaceChar(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is a lowercase letter @@ -1259,7 +1311,9 @@ public static function isJavaSpaceChar(#[LanguageLevelTypeAware(['8.0' => 'int|s * @return bool|null Returns TRUE if codepoint is an Ll lowercase letter, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function islower(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function islower(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point has the Bidi_Mirrored property * @link https://php.net/manual/en/intlchar.ismirrored.php @@ -1267,7 +1321,8 @@ public static function islower(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint has the Bidi_Mirrored property, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isMirrored(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isMirrored(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is a printable character @@ -1276,7 +1331,8 @@ public static function isMirrored(#[LanguageLevelTypeAware(['8.0' => 'int|string * @return bool|null Returns TRUE if codepoint is a printable character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isprint(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isprint(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is punctuation character @@ -1286,7 +1342,9 @@ public static function isprint(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a punctuation character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function ispunct(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function ispunct(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a space character * @link https://php.net/manual/en/intlchar.isspace.php @@ -1294,7 +1352,9 @@ public static function ispunct(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a space character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isspace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isspace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a titlecase letter * @link https://php.net/manual/en/intlchar.istitle.php @@ -1302,7 +1362,8 @@ public static function isspace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint is a titlecase letter, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function istitle(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function istitle(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point has the Alphabetic Unicode property @@ -1311,7 +1372,9 @@ public static function istitle(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint has the Alphabetic Unicode property, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isUAlphabetic(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isUAlphabetic(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point has the Lowercase Unicode property * @link https://php.net/manual/en/intlchar.isulowercase.php @@ -1319,7 +1382,9 @@ public static function isUAlphabetic(#[LanguageLevelTypeAware(['8.0' => 'int|str * @return bool|null Returns TRUE if codepoint has the Lowercase Unicode property, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isULowercase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isULowercase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point has the general category "Lu" (uppercase letter) * @link https://php.net/manual/en/intlchar.isupper.php @@ -1328,7 +1393,9 @@ public static function isULowercase(#[LanguageLevelTypeAware(['8.0' => 'int|stri * @return bool|null Returns TRUE if codepoint is an Lu uppercase letter, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isupper(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isupper(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point has the Uppercase Unicode property * @link https://php.net/manual/en/intlchar.isuuppercase.php @@ -1336,7 +1403,9 @@ public static function isupper(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * @return bool|null Returns TRUE if codepoint has the Uppercase Unicode property, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isUUppercase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isUUppercase(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point has the White_Space Unicode property * @link https://php.net/manual/en/intlchar.isuwhitespace.php @@ -1344,7 +1413,9 @@ public static function isUUppercase(#[LanguageLevelTypeAware(['8.0' => 'int|stri * @return bool|null Returns TRUE if codepoint has the White_Space Unicode property, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isUWhiteSpace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isUWhiteSpace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} + /** * Check if code point is a whitespace character according to ICU * @link https://php.net/manual/en/intlchar.iswhitespace.php @@ -1352,7 +1423,8 @@ public static function isUWhiteSpace(#[LanguageLevelTypeAware(['8.0' => 'int|str * @return bool|null Returns TRUE if codepoint is a whitespace character according to ICU, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isWhitespace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isWhitespace(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Check if code point is a hexadecimal digit @@ -1360,7 +1432,8 @@ public static function isWhitespace(#[LanguageLevelTypeAware(['8.0' => 'int|stri * @return bool|null Returns TRUE if codepoint is a hexadecimal character, FALSE if not, NULL if codepoint is out of bound. * @since 7.0 */ - public static function isxdigit(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function isxdigit(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): ?bool {} /** * Return Unicode code point value of character @@ -1369,7 +1442,8 @@ public static function isxdigit(#[LanguageLevelTypeAware(['8.0' => 'int|string'] * @return int|null Returns the Unicode code point value as an integer, NULL if codepoint is out of bound. * @since 7.0 */ - public static function ord(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $character) {} + #[TentativeType] + public static function ord(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $character): ?int {} /** * Make Unicode character lowercase @@ -1380,7 +1454,9 @@ public static function ord(#[LanguageLevelTypeAware(['8.0' => 'int|string'], def * Or NULL if codepoint is out of bound. * @since 7.0 */ - public static function tolower(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function tolower(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): string|int|null {} + /** * Make Unicode character titlecase * @link https://php.net/manual/en/intlchar.totitle.php @@ -1390,7 +1466,8 @@ public static function tolower(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * Or NULL if codepoint is out of bound. * @since 7.0 */ - public static function totitle(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function totitle(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): string|int|null {} /** * Make Unicode character uppercase @@ -1401,5 +1478,6 @@ public static function totitle(#[LanguageLevelTypeAware(['8.0' => 'int|string'], * Or NULL if codepoint is out of bound. * @since 7.0 */ - public static function toupper(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint) {} + #[TentativeType] + public static function toupper(#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $codepoint): string|int|null {} } diff --git a/intl/IntlDatePatternGenerator.php b/intl/IntlDatePatternGenerator.php index 29e458d5e..7c17c151b 100644 --- a/intl/IntlDatePatternGenerator.php +++ b/intl/IntlDatePatternGenerator.php @@ -7,7 +7,7 @@ class IntlDatePatternGenerator { public function __construct(?string $locale = null) {} - public static function create(?string $locale = null) {} + public static function create(?string $locale = null): ?IntlDatePatternGenerator {} - public function getBestPattern(string $skeleton) {} + public function getBestPattern(string $skeleton): string|false {} } diff --git a/intl/intl.php b/intl/intl.php index aa13666cc..bfe0c5647 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -6,3262 +6,3400 @@ use JetBrains\PhpStorm\ExpectedValues as EV; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware as TypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable as ElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; class Collator { - public const DEFAULT_VALUE = -1; - public const PRIMARY = 0; - public const SECONDARY = 1; - public const TERTIARY = 2; - public const DEFAULT_STRENGTH = 2; - public const QUATERNARY = 3; - public const IDENTICAL = 15; - public const OFF = 16; - public const ON = 17; - public const SHIFTED = 20; - public const NON_IGNORABLE = 21; - public const LOWER_FIRST = 24; - public const UPPER_FIRST = 25; - - /** - *

- * Sort strings with different accents from the back of the string. This - * attribute is automatically set to - * On - * for the French locales and a few others. Users normally would not need - * to explicitly set this attribute. There is a string comparison - * performance cost when it is set On, - * but sort key length is unaffected. Possible values are: - * Collator::ON - * Collator::OFF(default) - * Collator::DEFAULT_VALUE - *

- *

- * FRENCH_COLLATION rules - *

- * F=OFF cote < coté < côte < côté - * F=ON cote < côte < coté < côté - *

- *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const FRENCH_COLLATION = 0; - - /** - *

- * The Alternate attribute is used to control the handling of the so called - * variable characters in the UCA: whitespace, punctuation and symbols. If - * Alternate is set to NonIgnorable - * (N), then differences among these characters are of the same importance - * as differences among letters. If Alternate is set to - * Shifted - * (S), then these characters are of only minor importance. The - * Shifted value is often used in combination with - * Strength - * set to Quaternary. In such a case, whitespace, punctuation, and symbols - * are considered when comparing strings, but only if all other aspects of - * the strings (base letters, accents, and case) are identical. If - * Alternate is not set to Shifted, then there is no difference between a - * Strength of 3 and a Strength of 4. For more information and examples, - * see Variable_Weighting in the - * UCA. - * The reason the Alternate values are not simply - * On and Off - * is that additional Alternate values may be added in the future. The UCA - * option Blanked is expressed with Strength set to 3, and Alternate set to - * Shifted. The default for most locales is NonIgnorable. If Shifted is - * selected, it may be slower if there are many strings that are the same - * except for punctuation; sort key length will not be affected unless the - * strength level is also increased. - *

- *

- * Possible values are: - * Collator::NON_IGNORABLE(default) - * Collator::SHIFTED - * Collator::DEFAULT_VALUE - *

- *

- * ALTERNATE_HANDLING rules - *

- * S=3, A=N di Silva < Di Silva < diSilva < U.S.A. < USA - * S=3, A=S di Silva = diSilva < Di Silva < U.S.A. = USA - * S=4, A=S di Silva < diSilva < Di Silva < U.S.A. < USA - *

- *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const ALTERNATE_HANDLING = 1; - - /** - *

- * The Case_First attribute is used to control whether uppercase letters - * come before lowercase letters or vice versa, in the absence of other - * differences in the strings. The possible values are - * Uppercase_First - * (U) and Lowercase_First - * (L), plus the standard Default - * and Off. - * There is almost no difference between the Off and Lowercase_First - * options in terms of results, so typically users will not use - * Lowercase_First: only Off or Uppercase_First. (People interested in the - * detailed differences between X and L should consult the Collation - * Customization). Specifying either L or U won't affect string comparison - * performance, but will affect the sort key length. - *

- *

- * Possible values are: - * Collator::OFF(default) - * Collator::LOWER_FIRST - * Collator::UPPER_FIRST - * Collator:DEFAULT - *

- *

- * CASE_FIRST rules - *

- * C=X or C=L "china" < "China" < "denmark" < "Denmark" - * C=U "China" < "china" < "Denmark" < "denmark" - *

- *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const CASE_FIRST = 2; - - /** - *

- * The Case_Level attribute is used when ignoring accents but not case. In - * such a situation, set Strength to be Primary, - * and Case_Level to be On. - * In most locales, this setting is Off by default. There is a small - * string comparison performance and sort key impact if this attribute is - * set to be On. - *

- *

- * Possible values are: - * Collator::OFF(default) - * Collator::ON - * Collator::DEFAULT_VALUE - *

- *

- * CASE_LEVEL rules - *

- * S=1, E=X role = Role = rôle - * S=1, E=O role = rôle < Role - *

- *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const CASE_LEVEL = 3; - - /** - *

- * The Normalization setting determines whether text is thoroughly - * normalized or not in comparison. Even if the setting is off (which is - * the default for many locales), text as represented in common usage will - * compare correctly (for details, see UTN #5). Only if the accent marks - * are in noncanonical order will there be a problem. If the setting is - * On, - * then the best results are guaranteed for all possible text input. - * There is a medium string comparison performance cost if this attribute - * is On, - * depending on the frequency of sequences that require normalization. - * There is no significant effect on sort key length. If the input text is - * known to be in NFD or NFKD normalization forms, there is no need to - * enable this Normalization option. - *

- *

- * Possible values are: - * Collator::OFF(default) - * Collator::ON - * Collator::DEFAULT_VALUE - *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const NORMALIZATION_MODE = 4; - - /** - *

- * The ICU Collation Service supports many levels of comparison (named - * "Levels", but also known as "Strengths"). Having these categories - * enables ICU to sort strings precisely according to local conventions. - * However, by allowing the levels to be selectively employed, searching - * for a string in text can be performed with various matching conditions. - * For more detailed information, see - * collator_set_strength chapter. - *

- *

- * Possible values are: - * Collator::PRIMARY - * Collator::SECONDARY - * Collator::TERTIARY(default) - * Collator::QUATERNARY - * Collator::IDENTICAL - * Collator::DEFAULT_VALUE - *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const STRENGTH = 5; - - /** - *

- * Compatibility with JIS x 4061 requires the introduction of an additional - * level to distinguish Hiragana and Katakana characters. If compatibility - * with that standard is required, then this attribute should be set - * On, - * and the strength set to Quaternary. This will affect sort key length - * and string comparison string comparison performance. - *

- *

- * Possible values are: - * Collator::OFF(default) - * Collator::ON - * Collator::DEFAULT_VALUE - *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const HIRAGANA_QUATERNARY_MODE = 6; - - /** - *

- * When turned on, this attribute generates a collation key for the numeric - * value of substrings of digits. This is a way to get '100' to sort AFTER - * '2'. - *

- *

- * Possible values are: - * Collator::OFF(default) - * Collator::ON - * Collator::DEFAULT_VALUE - *

- * @link https://php.net/manual/en/class.collator.php#intl.collator-constants - */ - public const NUMERIC_COLLATION = 7; - public const SORT_REGULAR = 0; - public const SORT_STRING = 1; - public const SORT_NUMERIC = 2; - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Create a collator - * @link https://php.net/manual/en/collator.construct.php - * @param string $locale - */ - #[Pure] - public function __construct(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Create a collator - * @link https://php.net/manual/en/collator.create.php - * @param string $locale

- * The locale containing the required collation rules. Special values for - * locales can be passed in - if null is passed for the locale, the - * default locale collation rules will be used. If empty string ("") or - * "root" are passed, UCA rules will be used. - *

- * @return Collator|null Return new instance of Collator object, or NULL - * on error. - */ - public static function create(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Compare two Unicode strings - * @link https://php.net/manual/en/collator.compare.php - * @param string $string1

- * The first string to compare. - *

- * @param string $string2

- * The second string to compare. - *

- * @return int Return comparison result:

- *

- *

- * 1 if str1 is greater than - * str2 ; - *

- *

- * 0 if str1 is equal to - * str2; - *

- *

- * -1 if str1 is less than - * str2 . - *

- * On error - * boolean - * FALSE - * is returned. - */ - #[Pure] - public function compare( - #[TypeAware(['8.0' => 'string'], default: '')] $string1, - #[TypeAware(['8.0' => 'string'], default: '')] $string2 - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Sort array using specified collator - * @link https://php.net/manual/en/collator.sort.php - * @param string[] &$array

- * Array of strings to sort. - *

- * @param int $flags [optional]

- * Optional sorting type, one of the following: - *

- *

- * Collator::SORT_REGULAR - * - compare items normally (don't change types) - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function sort( - array &$array, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Sort array using specified collator and sort keys - * @link https://php.net/manual/en/collator.sortwithsortkeys.php - * @param string[] &$array

Array of strings to sort

- * @return bool TRUE on success or FALSE on failure. - */ - public function sortWithSortKeys(array &$array) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Sort array maintaining index association - * @link https://php.net/manual/en/collator.asort.php - * @param string[] &$array

Array of strings to sort.

- * @param int $flags [optional]

- * Optional sorting type, one of the following: - * Collator::SORT_REGULAR - * - compare items normally (don't change types) - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function asort( - array &$array, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get collation attribute value - * @link https://php.net/manual/en/collator.getattribute.php - * @param int $attribute

- * Attribute to get value for. - *

- * @return int|false Attribute value, or boolean FALSE on error. - */ - #[Pure] - public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set collation attribute - * @link https://php.net/manual/en/collator.setattribute.php - * @param int $attribute

Attribute.

- * @param int $value

- * Attribute value. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setAttribute( - #[TypeAware(['8.0' => 'int'], default: '')] $attribute, - #[TypeAware(['8.0' => 'int'], default: '')] $value - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get current collation strength - * @link https://php.net/manual/en/collator.getstrength.php - * @return int|false current collation strength, or boolean FALSE on error. - */ - #[Pure] - public function getStrength() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set collation strength - * @link https://php.net/manual/en/collator.setstrength.php - * @param int $strength

Strength to set.

- *

- * Possible values are: - * Collator::PRIMARY - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setStrength(#[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::PRIMARY])] $strength) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get collator's last error code - * @link https://php.net/manual/en/collator.geterrorcode.php - * @return int Error code returned by the last Collator API function call. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the locale name of the collator - * @link https://php.net/manual/en/collator.getlocale.php - * @param int $type [optional]

- * You can choose between valid and actual locale ( - * Locale::VALID_LOCALE and - * Locale::ACTUAL_LOCALE, - * respectively). The default is the actual locale. - *

- * @return string Real locale name from which the collation data comes. If the collator was - * instantiated from rules or an error occurred, returns - * boolean FALSE. - */ - #[Pure] - public function getLocale( - #[TypeAware(['8.0' => 'int'], default: '')] - #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] - $type = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get text for collator's last error code - * @link https://php.net/manual/en/collator.geterrormessage.php - * @return string Description of an error occurred in the last Collator API function call. - */ - #[Pure] - public function getErrorMessage() {} - - /** - * (No version information available, might only be in SVN)
- * Get sorting key for a string - * @link https://php.net/manual/en/collator.getsortkey.php - * @param string $string

- * The string to produce the key from. - *

- * @return string the collation key for the string. Collation keys can be compared directly instead of strings. - */ - #[Pure] - public function getSortKey(#[TypeAware(['8.0' => 'string'], default: '')] $string) {} + public const DEFAULT_VALUE = -1; + public const PRIMARY = 0; + public const SECONDARY = 1; + public const TERTIARY = 2; + public const DEFAULT_STRENGTH = 2; + public const QUATERNARY = 3; + public const IDENTICAL = 15; + public const OFF = 16; + public const ON = 17; + public const SHIFTED = 20; + public const NON_IGNORABLE = 21; + public const LOWER_FIRST = 24; + public const UPPER_FIRST = 25; + + /** + *

+ * Sort strings with different accents from the back of the string. This + * attribute is automatically set to + * On + * for the French locales and a few others. Users normally would not need + * to explicitly set this attribute. There is a string comparison + * performance cost when it is set On, + * but sort key length is unaffected. Possible values are: + * Collator::ON + * Collator::OFF(default) + * Collator::DEFAULT_VALUE + *

+ *

+ * FRENCH_COLLATION rules + *

+ * F=OFF cote < coté < côte < côté + * F=ON cote < côte < coté < côté + *

+ *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const FRENCH_COLLATION = 0; + + /** + *

+ * The Alternate attribute is used to control the handling of the so called + * variable characters in the UCA: whitespace, punctuation and symbols. If + * Alternate is set to NonIgnorable + * (N), then differences among these characters are of the same importance + * as differences among letters. If Alternate is set to + * Shifted + * (S), then these characters are of only minor importance. The + * Shifted value is often used in combination with + * Strength + * set to Quaternary. In such a case, whitespace, punctuation, and symbols + * are considered when comparing strings, but only if all other aspects of + * the strings (base letters, accents, and case) are identical. If + * Alternate is not set to Shifted, then there is no difference between a + * Strength of 3 and a Strength of 4. For more information and examples, + * see Variable_Weighting in the + * UCA. + * The reason the Alternate values are not simply + * On and Off + * is that additional Alternate values may be added in the future. The UCA + * option Blanked is expressed with Strength set to 3, and Alternate set to + * Shifted. The default for most locales is NonIgnorable. If Shifted is + * selected, it may be slower if there are many strings that are the same + * except for punctuation; sort key length will not be affected unless the + * strength level is also increased. + *

+ *

+ * Possible values are: + * Collator::NON_IGNORABLE(default) + * Collator::SHIFTED + * Collator::DEFAULT_VALUE + *

+ *

+ * ALTERNATE_HANDLING rules + *

+ * S=3, A=N di Silva < Di Silva < diSilva < U.S.A. < USA + * S=3, A=S di Silva = diSilva < Di Silva < U.S.A. = USA + * S=4, A=S di Silva < diSilva < Di Silva < U.S.A. < USA + *

+ *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const ALTERNATE_HANDLING = 1; + + /** + *

+ * The Case_First attribute is used to control whether uppercase letters + * come before lowercase letters or vice versa, in the absence of other + * differences in the strings. The possible values are + * Uppercase_First + * (U) and Lowercase_First + * (L), plus the standard Default + * and Off. + * There is almost no difference between the Off and Lowercase_First + * options in terms of results, so typically users will not use + * Lowercase_First: only Off or Uppercase_First. (People interested in the + * detailed differences between X and L should consult the Collation + * Customization). Specifying either L or U won't affect string comparison + * performance, but will affect the sort key length. + *

+ *

+ * Possible values are: + * Collator::OFF(default) + * Collator::LOWER_FIRST + * Collator::UPPER_FIRST + * Collator:DEFAULT + *

+ *

+ * CASE_FIRST rules + *

+ * C=X or C=L "china" < "China" < "denmark" < "Denmark" + * C=U "China" < "china" < "Denmark" < "denmark" + *

+ *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const CASE_FIRST = 2; + + /** + *

+ * The Case_Level attribute is used when ignoring accents but not case. In + * such a situation, set Strength to be Primary, + * and Case_Level to be On. + * In most locales, this setting is Off by default. There is a small + * string comparison performance and sort key impact if this attribute is + * set to be On. + *

+ *

+ * Possible values are: + * Collator::OFF(default) + * Collator::ON + * Collator::DEFAULT_VALUE + *

+ *

+ * CASE_LEVEL rules + *

+ * S=1, E=X role = Role = rôle + * S=1, E=O role = rôle < Role + *

+ *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const CASE_LEVEL = 3; + + /** + *

+ * The Normalization setting determines whether text is thoroughly + * normalized or not in comparison. Even if the setting is off (which is + * the default for many locales), text as represented in common usage will + * compare correctly (for details, see UTN #5). Only if the accent marks + * are in noncanonical order will there be a problem. If the setting is + * On, + * then the best results are guaranteed for all possible text input. + * There is a medium string comparison performance cost if this attribute + * is On, + * depending on the frequency of sequences that require normalization. + * There is no significant effect on sort key length. If the input text is + * known to be in NFD or NFKD normalization forms, there is no need to + * enable this Normalization option. + *

+ *

+ * Possible values are: + * Collator::OFF(default) + * Collator::ON + * Collator::DEFAULT_VALUE + *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const NORMALIZATION_MODE = 4; + + /** + *

+ * The ICU Collation Service supports many levels of comparison (named + * "Levels", but also known as "Strengths"). Having these categories + * enables ICU to sort strings precisely according to local conventions. + * However, by allowing the levels to be selectively employed, searching + * for a string in text can be performed with various matching conditions. + * For more detailed information, see + * collator_set_strength chapter. + *

+ *

+ * Possible values are: + * Collator::PRIMARY + * Collator::SECONDARY + * Collator::TERTIARY(default) + * Collator::QUATERNARY + * Collator::IDENTICAL + * Collator::DEFAULT_VALUE + *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const STRENGTH = 5; + + /** + *

+ * Compatibility with JIS x 4061 requires the introduction of an additional + * level to distinguish Hiragana and Katakana characters. If compatibility + * with that standard is required, then this attribute should be set + * On, + * and the strength set to Quaternary. This will affect sort key length + * and string comparison string comparison performance. + *

+ *

+ * Possible values are: + * Collator::OFF(default) + * Collator::ON + * Collator::DEFAULT_VALUE + *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const HIRAGANA_QUATERNARY_MODE = 6; + + /** + *

+ * When turned on, this attribute generates a collation key for the numeric + * value of substrings of digits. This is a way to get '100' to sort AFTER + * '2'. + *

+ *

+ * Possible values are: + * Collator::OFF(default) + * Collator::ON + * Collator::DEFAULT_VALUE + *

+ * @link https://php.net/manual/en/class.collator.php#intl.collator-constants + */ + public const NUMERIC_COLLATION = 7; + public const SORT_REGULAR = 0; + public const SORT_STRING = 1; + public const SORT_NUMERIC = 2; + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Create a collator + * @link https://php.net/manual/en/collator.construct.php + * @param string $locale + */ + #[Pure] + public function __construct(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Create a collator + * @link https://php.net/manual/en/collator.create.php + * @param string $locale

+ * The locale containing the required collation rules. Special values for + * locales can be passed in - if null is passed for the locale, the + * default locale collation rules will be used. If empty string ("") or + * "root" are passed, UCA rules will be used. + *

+ * @return Collator|null Return new instance of Collator object, or NULL + * on error. + */ + #[TentativeType] + public static function create(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?Collator {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Compare two Unicode strings + * @link https://php.net/manual/en/collator.compare.php + * @param string $string1

+ * The first string to compare. + *

+ * @param string $string2

+ * The second string to compare. + *

+ * @return int|false Return comparison result:

+ *

+ *

+ * 1 if str1 is greater than + * str2 ; + *

+ *

+ * 0 if str1 is equal to + * str2; + *

+ *

+ * -1 if str1 is less than + * str2 . + *

+ * On error + * boolean + * FALSE + * is returned. + */ + #[Pure] + #[TentativeType] + public function compare( + #[TypeAware(['8.0' => 'string'], default: '')] $string1, + #[TypeAware(['8.0' => 'string'], default: '')] $string2 + ): int|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Sort array using specified collator + * @link https://php.net/manual/en/collator.sort.php + * @param string[] &$array

+ * Array of strings to sort. + *

+ * @param int $flags [optional]

+ * Optional sorting type, one of the following: + *

+ *

+ * Collator::SORT_REGULAR + * - compare items normally (don't change types) + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function sort( + array &$array, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null + ): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Sort array using specified collator and sort keys + * @link https://php.net/manual/en/collator.sortwithsortkeys.php + * @param string[] &$array

Array of strings to sort

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function sortWithSortKeys(array &$array): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Sort array maintaining index association + * @link https://php.net/manual/en/collator.asort.php + * @param string[] &$array

Array of strings to sort.

+ * @param int $flags [optional]

+ * Optional sorting type, one of the following: + * Collator::SORT_REGULAR + * - compare items normally (don't change types) + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function asort( + array &$array, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null + ): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get collation attribute value + * @link https://php.net/manual/en/collator.getattribute.php + * @param int $attribute

+ * Attribute to get value for. + *

+ * @return int|false Attribute value, or boolean FALSE on error. + */ + #[Pure] + #[TentativeType] + public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute): int|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set collation attribute + * @link https://php.net/manual/en/collator.setattribute.php + * @param int $attribute

Attribute.

+ * @param int $value

+ * Attribute value. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setAttribute( + #[TypeAware(['8.0' => 'int'], default: '')] $attribute, + #[TypeAware(['8.0' => 'int'], default: '')] $value + ): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get current collation strength + * @link https://php.net/manual/en/collator.getstrength.php + * @return int current collation strength, or boolean FALSE on error. + */ + #[Pure] + #[TentativeType] + public function getStrength(): int {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set collation strength + * @link https://php.net/manual/en/collator.setstrength.php + * @param int $strength

Strength to set.

+ *

+ * Possible values are: + * Collator::PRIMARY + *

+ * @return bool TRUE on success or FALSE on failure. + */ + public function setStrength(#[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::PRIMARY])] $strength) {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get collator's last error code + * @link https://php.net/manual/en/collator.geterrorcode.php + * @return int|false Error code returned by the last Collator API function call. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the locale name of the collator + * @link https://php.net/manual/en/collator.getlocale.php + * @param int $type [optional]

+ * You can choose between valid and actual locale ( + * Locale::VALID_LOCALE and + * Locale::ACTUAL_LOCALE, + * respectively). The default is the actual locale. + *

+ * @return string|false Real locale name from which the collation data comes. If the collator was + * instantiated from rules or an error occurred, returns + * boolean FALSE. + */ + #[Pure] + #[TentativeType] + public function getLocale( + #[TypeAware(['8.0' => 'int'], default: '')] + #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] + $type = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get text for collator's last error code + * @link https://php.net/manual/en/collator.geterrormessage.php + * @return string|false Description of an error occurred in the last Collator API function call. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string|false {} + + /** + * (No version information available, might only be in SVN)
+ * Get sorting key for a string + * @link https://php.net/manual/en/collator.getsortkey.php + * @param string $string

+ * The string to produce the key from. + *

+ * @return string|false the collation key for the string. Collation keys can be compared directly instead of strings. + */ + #[Pure] + #[TentativeType] + public function getSortKey(#[TypeAware(['8.0' => 'string'], default: '')] $string): string|false {} +} + +class NumberFormatter +{ + public const CURRENCY_ACCOUNTING = 12; + + /** + * Decimal format defined by pattern + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PATTERN_DECIMAL = 0; + + /** + * Decimal format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DECIMAL = 1; + + /** + * Currency format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const CURRENCY = 2; + + /** + * Percent format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PERCENT = 3; + + /** + * Scientific format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const SCIENTIFIC = 4; + + /** + * Spellout rule-based format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const SPELLOUT = 5; + + /** + * Ordinal rule-based format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ORDINAL = 6; + + /** + * Duration rule-based format + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DURATION = 7; + + /** + * Rule-based format defined by pattern + * @link https://php.net/manual/en/class.locale.php#intl.locale-constants + */ + public const PATTERN_RULEBASED = 9; + + /** + * Alias for PATTERN_DECIMAL + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const IGNORE = 0; + + /** + * Default format for the locale + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DEFAULT_STYLE = 1; + + /** + * Rounding mode to round towards positive infinity. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_CEILING = 0; + + /** + * Rounding mode to round towards negative infinity. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_FLOOR = 1; + + /** + * Rounding mode to round towards zero. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_DOWN = 2; + + /** + * Rounding mode to round away from zero. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_UP = 3; + + /** + * Rounding mode to round towards the "nearest neighbor" unless both + * neighbors are equidistant, in which case, round towards the even + * neighbor. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_HALFEVEN = 4; + + /** + * Rounding mode to round towards "nearest neighbor" unless both neighbors + * are equidistant, in which case round down. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_HALFDOWN = 5; + + /** + * Rounding mode to round towards "nearest neighbor" unless both neighbors + * are equidistant, in which case round up. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUND_HALFUP = 6; + + /** + * Pad characters inserted before the prefix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PAD_BEFORE_PREFIX = 0; + + /** + * Pad characters inserted after the prefix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PAD_AFTER_PREFIX = 1; + + /** + * Pad characters inserted before the suffix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PAD_BEFORE_SUFFIX = 2; + + /** + * Pad characters inserted after the suffix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PAD_AFTER_SUFFIX = 3; + + /** + * Parse integers only. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PARSE_INT_ONLY = 0; + + /** + * Use grouping separator. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const GROUPING_USED = 1; + + /** + * Always show decimal point. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DECIMAL_ALWAYS_SHOWN = 2; + + /** + * Maximum integer digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MAX_INTEGER_DIGITS = 3; + + /** + * Minimum integer digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MIN_INTEGER_DIGITS = 4; + + /** + * Integer digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const INTEGER_DIGITS = 5; + + /** + * Maximum fraction digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MAX_FRACTION_DIGITS = 6; + + /** + * Minimum fraction digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MIN_FRACTION_DIGITS = 7; + + /** + * Fraction digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const FRACTION_DIGITS = 8; + + /** + * Multiplier. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MULTIPLIER = 9; + + /** + * Grouping size. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const GROUPING_SIZE = 10; + + /** + * Rounding Mode. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUNDING_MODE = 11; + + /** + * Rounding increment. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ROUNDING_INCREMENT = 12; + + /** + * The width to which the output of format() is padded. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const FORMAT_WIDTH = 13; + + /** + * The position at which padding will take place. See pad position + * constants for possible argument values. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PADDING_POSITION = 14; + + /** + * Secondary grouping size. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const SECONDARY_GROUPING_SIZE = 15; + + /** + * Use significant digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const SIGNIFICANT_DIGITS_USED = 16; + + /** + * Minimum significant digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MIN_SIGNIFICANT_DIGITS = 17; + + /** + * Maximum significant digits. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MAX_SIGNIFICANT_DIGITS = 18; + + /** + * Lenient parse mode used by rule-based formats. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const LENIENT_PARSE = 19; + + /** + * Positive prefix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const POSITIVE_PREFIX = 0; + + /** + * Positive suffix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const POSITIVE_SUFFIX = 1; + + /** + * Negative prefix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const NEGATIVE_PREFIX = 2; + + /** + * Negative suffix. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const NEGATIVE_SUFFIX = 3; + + /** + * The character used to pad to the format width. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PADDING_CHARACTER = 4; + + /** + * The ISO currency code. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const CURRENCY_CODE = 5; + + /** + * The default rule set. This is only available with rule-based + * formatters. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DEFAULT_RULESET = 6; + + /** + * The public rule sets. This is only available with rule-based + * formatters. This is a read-only attribute. The public rulesets are + * returned as a single string, with each ruleset name delimited by ';' + * (semicolon). + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PUBLIC_RULESETS = 7; + + /** + * The decimal separator. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DECIMAL_SEPARATOR_SYMBOL = 0; + + /** + * The grouping separator. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const GROUPING_SEPARATOR_SYMBOL = 1; + + /** + * The pattern separator. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PATTERN_SEPARATOR_SYMBOL = 2; + + /** + * The percent sign. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PERCENT_SYMBOL = 3; + + /** + * Zero. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ZERO_DIGIT_SYMBOL = 4; + + /** + * Character representing a digit in the pattern. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DIGIT_SYMBOL = 5; + + /** + * The minus sign. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MINUS_SIGN_SYMBOL = 6; + + /** + * The plus sign. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PLUS_SIGN_SYMBOL = 7; + + /** + * The currency symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const CURRENCY_SYMBOL = 8; + + /** + * The international currency symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const INTL_CURRENCY_SYMBOL = 9; + + /** + * The monetary separator. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MONETARY_SEPARATOR_SYMBOL = 10; + + /** + * The exponential symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const EXPONENTIAL_SYMBOL = 11; + + /** + * Per mill symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PERMILL_SYMBOL = 12; + + /** + * Escape padding character. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PAD_ESCAPE_SYMBOL = 13; + + /** + * Infinity symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const INFINITY_SYMBOL = 14; + + /** + * Not-a-number symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const NAN_SYMBOL = 15; + + /** + * Significant digit symbol. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const SIGNIFICANT_DIGIT_SYMBOL = 16; + + /** + * The monetary grouping separator. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const MONETARY_GROUPING_SEPARATOR_SYMBOL = 17; + + /** + * Derive the type from variable type + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const TYPE_DEFAULT = 0; + + /** + * Format/parse as 32-bit integer + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const TYPE_INT32 = 1; + + /** + * Format/parse as 64-bit integer + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const TYPE_INT64 = 2; + + /** + * Format/parse as floating point value + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const TYPE_DOUBLE = 3; + + /** + * Format/parse as currency value + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const TYPE_CURRENCY = 4; + + /** + * @link https://www.php.net/manual/en/class.numberformatter.php + * @param string $locale + * @param int $style + * @param string $pattern [optional] + */ + #[Pure] + public function __construct( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'int'], default: '')] $style, + #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null + ) {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Create a number formatter + * @link https://php.net/manual/en/numberformatter.create.php + * @param string $locale

+ * Locale in which the number would be formatted (locale name, e.g. en_CA). + *

+ * @param int $style

+ * Style of the formatting, one of the + * format style constants. If + * NumberFormatter::PATTERN_DECIMAL + * or NumberFormatter::PATTERN_RULEBASED + * is passed then the number format is opened using the given pattern, + * which must conform to the syntax described in + * ICU DecimalFormat + * documentation or + * ICU RuleBasedNumberFormat + * documentation, respectively. + *

+ * @param string $pattern [optional]

+ * Pattern string if the chosen style requires a pattern. + *

+ * @return NumberFormatter|false NumberFormatter object or FALSE on error. + */ + #[TentativeType] + public static function create( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED])] $style, + #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null + ): ?NumberFormatter {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Format a number + * @link https://php.net/manual/en/numberformatter.format.php + * @param int|float $num

+ * The value to format. Can be integer or float, + * other values will be converted to a numeric value. + *

+ * @param int $type [optional]

+ * The + * formatting type to use. + *

+ * @return string|false the string containing formatted value, or FALSE on error. + */ + #[Pure] + #[TentativeType] + public function format( + #[TypeAware(['8.0' => 'int|float'], default: '')] $num, + #[TypeAware(['8.0' => 'int'], default: '')] $type = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Parse a number + * @link https://php.net/manual/en/numberformatter.parse.php + * @param string $string + * @param int $type [optional]

+ * The + * formatting type to use. By default, + * NumberFormatter::TYPE_DOUBLE is used. + *

+ * @param int &$offset [optional]

+ * Offset in the string at which to begin parsing. On return, this value + * will hold the offset at which parsing ended. + *

+ * @return mixed The value of the parsed number or FALSE on error. + */ + #[TentativeType] + public function parse( + #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[TypeAware(['8.0' => 'int'], default: '')] $type = NumberFormatter::TYPE_DOUBLE, + &$offset = null + ): int|float|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Format a currency value + * @link https://php.net/manual/en/numberformatter.formatcurrency.php + * @param float $amount

+ * The numeric currency value. + *

+ * @param string $currency

+ * The 3-letter ISO 4217 currency code indicating the currency to use. + *

+ * @return string String representing the formatted currency value. + */ + #[Pure] + #[TentativeType] + public function formatCurrency( + #[TypeAware(['8.0' => 'float'], default: '')] $amount, + #[TypeAware(['8.0' => 'string'], default: '')] $currency + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Parse a currency number + * @link https://php.net/manual/en/numberformatter.parsecurrency.php + * @param string $string + * @param string &$currency

+ * Parameter to receive the currency name (3-letter ISO 4217 currency + * code). + *

+ * @param int &$offset [optional]

+ * Offset in the string at which to begin parsing. On return, this value + * will hold the offset at which parsing ended. + *

+ * @return float|false The parsed numeric value or FALSE on error. + */ + #[TentativeType] + public function parseCurrency(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$currency, &$offset = null): float|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set an attribute + * @link https://php.net/manual/en/numberformatter.setattribute.php + * @param int $attribute

+ * Attribute specifier - one of the + * numeric attribute constants. + *

+ * @param int $value

+ * The attribute value. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setAttribute( + #[TypeAware(['8.0' => 'int'], default: '')] $attribute, + #[TypeAware(['8.0' => 'int|float'], default: '')] $value + ): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get an attribute + * @link https://php.net/manual/en/numberformatter.getattribute.php + * @param int $attribute

+ * Attribute specifier - one of the + * numeric attribute constants. + *

+ * @return int|float|false Return attribute value on success, or FALSE on error. + */ + #[Pure] + #[TentativeType] + public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute): int|float|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set a text attribute + * @link https://php.net/manual/en/numberformatter.settextattribute.php + * @param int $attribute

+ * Attribute specifier - one of the + * text attribute + * constants. + *

+ * @param string $value

+ * Text for the attribute value. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setTextAttribute( + #[TypeAware(['8.0' => 'int'], default: '')] $attribute, + #[TypeAware(['8.0' => 'string'], default: '')] $value + ): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get a text attribute + * @link https://php.net/manual/en/numberformatter.gettextattribute.php + * @param int $attribute

+ * Attribute specifier - one of the + * text attribute constants. + *

+ * @return string|false Return attribute value on success, or FALSE on error. + */ + #[Pure] + #[TentativeType] + public function getTextAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set a symbol value + * @link https://php.net/manual/en/numberformatter.setsymbol.php + * @param int $symbol

+ * Symbol specifier, one of the + * format symbol constants. + *

+ * @param string $value

+ * Text for the symbol. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setSymbol( + #[TypeAware(['8.0' => 'int'], default: '')] $symbol, + #[TypeAware(['8.0' => 'string'], default: '')] $value + ): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get a symbol value + * @link https://php.net/manual/en/numberformatter.getsymbol.php + * @param int $symbol

+ * Symbol specifier, one of the + * format symbol constants. + *

+ * @return string|false The symbol string or FALSE on error. + */ + #[Pure] + #[TentativeType] + public function getSymbol(#[TypeAware(['8.0' => 'int'], default: '')] $symbol): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set formatter pattern + * @link https://php.net/manual/en/numberformatter.setpattern.php + * @param string $pattern

+ * Pattern in syntax described in + * ICU DecimalFormat + * documentation. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get formatter pattern + * @link https://php.net/manual/en/numberformatter.getpattern.php + * @return string|false Pattern string that is used by the formatter, or FALSE if an error happens. + */ + #[Pure] + #[TentativeType] + public function getPattern(): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get formatter locale + * @link https://php.net/manual/en/numberformatter.getlocale.php + * @param int $type [optional]

+ * You can choose between valid and actual locale ( + * Locale::VALID_LOCALE, + * Locale::ACTUAL_LOCALE, + * respectively). The default is the actual locale. + *

+ * @return string The locale name used to create the formatter. + */ + #[Pure] + #[TentativeType] + public function getLocale( + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get formatter's last error code. + * @link https://php.net/manual/en/numberformatter.geterrorcode.php + * @return int error code from last formatter call. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get formatter's last error message. + * @link https://php.net/manual/en/numberformatter.geterrormessage.php + * @return string error message from last formatter call. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string {} +} + +class Normalizer +{ + public const NFKC_CF = 48; + + public const FORM_KC_CF = 48; + + /** + * Default normalization options + * @link https://secure.php.net/manual/en/class.normalizer.php + */ + public const OPTION_DEFAULT = ""; + + /** + * No decomposition/composition + * @link https://secure.php.net/manual/en/class.normalizer.php + * @removed 8.0 + */ + public const NONE = "1"; + + /** + * Normalization Form D (NFD) - Canonical Decomposition + * @link https://secure.php.net/manual/en/class.normalizer.php + */ + public const FORM_D = 4; + public const NFD = 4; + + /** + * Normalization Form KD (NFKD) - Compatibility Decomposition + * @link https://secure.php.net/manual/en/class.normalizer.php + */ + public const FORM_KD = 8; + public const NFKD = 8; + + /** + * Normalization Form C (NFC) - Canonical Decomposition followed by + * Canonical Composition + * @link https://secure.php.net/manual/en/class.normalizer.php + */ + public const FORM_C = 16; + public const NFC = 16; + + /** + * Normalization Form KC (NFKC) - Compatibility Decomposition, followed by + * Canonical Composition + * @link https://secure.php.net/manual/en/class.normalizer.php + */ + public const FORM_KC = 32; + public const NFKC = 32; + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Normalizes the input provided and returns the normalized string + * @link https://php.net/manual/en/normalizer.normalize.php + * @param string $string

The input string to normalize

+ * @param int $form [optional]

One of the normalization forms.

+ * @return string|false The normalized string or FALSE if an error occurred. + */ + #[TentativeType] + public static function normalize( + #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Checks if the provided string is already in the specified normalization form. + * @link https://php.net/manual/en/normalizer.isnormalized.php + * @param string $string

The input string to normalize

+ * @param int $form [optional]

+ * One of the normalization forms. + *

+ * @return bool TRUE if normalized, FALSE otherwise or if there an error + */ + #[TentativeType] + public static function isNormalized( + #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C + ): bool {} + + /** + * @param string $string

The input string to normalize

+ * @param string $form + * @return string|null

Returns a string containing the Decomposition_Mapping property, if present in the UCD. + * Returns null if there is no Decomposition_Mapping property for the character.

+ * @link https://www.php.net/manual/en/normalizer.getrawdecomposition.php + * @since 7.3 + */ + #[TentativeType] + public static function getRawDecomposition( + string $string, + #[ElementAvailable(from: '8.0')] int $form = 16 + ): ?string {} +} + +class Locale +{ + /** + * This is locale the data actually comes from. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const ACTUAL_LOCALE = 0; + + /** + * This is the most specific locale supported by ICU. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const VALID_LOCALE = 1; + + /** + * Used as locale parameter with the methods of the various locale affected classes, + * such as NumberFormatter. This constant would make the methods to use default + * locale. + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const DEFAULT_LOCALE = null; + + /** + * Language subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const LANG_TAG = "language"; + + /** + * Extended language subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const EXTLANG_TAG = "extlang"; + + /** + * Script subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const SCRIPT_TAG = "script"; + + /** + * Region subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const REGION_TAG = "region"; + + /** + * Variant subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const VARIANT_TAG = "variant"; + + /** + * Grandfathered Language subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const GRANDFATHERED_LANG_TAG = "grandfathered"; + + /** + * Private subtag + * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + */ + public const PRIVATE_TAG = "private"; + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Gets the default locale value from the INTL global 'default_locale' + * @link https://php.net/manual/en/locale.getdefault.php + * @return string The current runtime locale + */ + #[TentativeType] + public static function getDefault(): string {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * sets the default runtime locale + * @link https://php.net/manual/en/locale.setdefault.php + * @param string $locale

+ * Is a BCP 47 compliant language tag containing the + *

+ * @return bool TRUE on success or FALSE on failure. + */ + public static function setDefault(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Gets the primary language for the input locale + * @link https://php.net/manual/en/locale.getprimarylanguage.php + * @param string $locale

+ * The locale to extract the primary language code from + *

+ * @return string|null The language code associated with the language or NULL in case of error. + */ + #[TentativeType] + public static function getPrimaryLanguage(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Gets the script for the input locale + * @link https://php.net/manual/en/locale.getscript.php + * @param string $locale

+ * The locale to extract the script code from + *

+ * @return string|null The script subtag for the locale or NULL if not present + */ + #[TentativeType] + public static function getScript(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Gets the region for the input locale + * @link https://php.net/manual/en/locale.getregion.php + * @param string $locale

+ * The locale to extract the region code from + *

+ * @return string|null The region subtag for the locale or NULL if not present + */ + #[TentativeType] + public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Gets the keywords for the input locale + * @link https://php.net/manual/en/locale.getkeywords.php + * @param string $locale

+ * The locale to extract the keywords from + *

+ * @return array|false|null Associative array containing the keyword-value pairs for this locale + */ + #[TentativeType] + public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '')] $locale): array|false|null {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns an appropriately localized display name for script of the input locale + * @link https://php.net/manual/en/locale.getdisplayscript.php + * @param string $locale

+ * The locale to return a display script for + *

+ * @param string $displayLocale [optional]

+ * Optional format locale to use to display the script name + *

+ * @return string Display name of the script for the $locale in the format appropriate for + * $in_locale. + */ + #[TentativeType] + public static function getDisplayScript( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns an appropriately localized display name for region of the input locale + * @link https://php.net/manual/en/locale.getdisplayregion.php + * @param string $locale

+ * The locale to return a display region for. + *

+ * @param string $displayLocale [optional]

+ * Optional format locale to use to display the region name + *

+ * @return string display name of the region for the $locale in the format appropriate for + * $in_locale. + */ + #[TentativeType] + public static function getDisplayRegion( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns an appropriately localized display name for the input locale + * @link https://php.net/manual/en/locale.getdisplayname.php + * @param string $locale

+ * The locale to return a display name for. + *

+ * @param string $displayLocale [optional]

optional format locale

+ * @return string|false Display name of the locale in the format appropriate for $in_locale. + */ + #[TentativeType] + public static function getDisplayName( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns an appropriately localized display name for language of the inputlocale + * @link https://php.net/manual/en/locale.getdisplaylanguage.php + * @param string $locale

+ * The locale to return a display language for + *

+ * @param string $displayLocale [optional]

+ * Optional format locale to use to display the language name + *

+ * @return string|false display name of the language for the $locale in the format appropriate for + * $in_locale. + */ + #[TentativeType] + public static function getDisplayLanguage( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns an appropriately localized display name for variants of the input locale + * @link https://php.net/manual/en/locale.getdisplayvariant.php + * @param string $locale

+ * The locale to return a display variant for + *

+ * @param string $displayLocale [optional]

+ * Optional format locale to use to display the variant name + *

+ * @return string|false Display name of the variant for the $locale in the format appropriate for + * $in_locale. + */ + #[TentativeType] + public static function getDisplayVariant( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns a correctly ordered and delimited locale ID + * @link https://php.net/manual/en/locale.composelocale.php + * @param array $subtags

+ * an array containing a list of key-value pairs, where the keys identify + * the particular locale ID subtags, and the values are the associated + * subtag values. + *

+ * The 'variant' and 'private' subtags can take maximum 15 values + * whereas 'extlang' can take maximum 3 values.e.g. Variants are allowed + * with the suffix ranging from 0-14. Hence the keys for the input array + * can be variant0, variant1, ...,variant14. In the returned locale id, + * the subtag is ordered by suffix resulting in variant0 followed by + * variant1 followed by variant2 and so on. + *

+ *

+ * The 'variant', 'private' and 'extlang' multiple values can be specified both + * as array under specific key (e.g. 'variant') and as multiple numbered keys + * (e.g. 'variant0', 'variant1', etc.). + *

+ *

+ * @return string The corresponding locale identifier. + */ + #[TentativeType] + public static function composeLocale(array $subtags): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Returns a key-value array of locale ID subtag elements. + * @link https://php.net/manual/en/locale.parselocale.php + * @param string $locale

+ * The locale to extract the subtag array from. Note: The 'variant' and + * 'private' subtags can take maximum 15 values whereas 'extlang' can take + * maximum 3 values. + *

+ * @return array an array containing a list of key-value pairs, where the keys + * identify the particular locale ID subtags, and the values are the + * associated subtag values. The array will be ordered as the locale id + * subtags e.g. in the locale id if variants are '-varX-varY-varZ' then the + * returned array will have variant0=>varX , variant1=>varY , + * variant2=>varZ + */ + #[TentativeType] + public static function parseLocale(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?array {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Gets the variants for the input locale + * @link https://php.net/manual/en/locale.getallvariants.php + * @param string $locale

+ * The locale to extract the variants from + *

+ * @return array|null The array containing the list of all variants subtag for the locale + * or NULL if not present + */ + #[TentativeType] + public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?array {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Checks if a language tag filter matches with locale + * @link https://php.net/manual/en/locale.filtermatches.php + * @param string $languageTag

+ * The language tag to check + *

+ * @param string $locale

+ * The language range to check against + *

+ * @param bool $canonicalize [optional]

+ * If true, the arguments will be converted to canonical form before + * matching. + *

+ * @return bool TRUE if $locale matches $langtag FALSE otherwise. + */ + #[TentativeType] + public static function filterMatches( + #[TypeAware(['8.0' => 'string'], default: '')] $languageTag, + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false + ): ?bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Searches the language tag list for the best match to the language + * @link https://php.net/manual/en/locale.lookup.php + * @param array $languageTag

+ * An array containing a list of language tags to compare to + * locale. Maximum 100 items allowed. + *

+ * @param string $locale

+ * The locale to use as the language range when matching. + *

+ * @param bool $canonicalize [optional]

+ * If true, the arguments will be converted to canonical form before + * matching. + *

+ * @param string $defaultLocale [optional]

+ * The locale to use if no match is found. + *

+ * @return string The closest matching language tag or default value. + */ + #[TentativeType] + public static function lookup( + array $languageTag, + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false, + #[TypeAware(['8.0' => 'string|null'], default: '')] $defaultLocale = null + ): ?string {} + + /** + * @link https://php.net/manual/en/locale.canonicalize.php + * @param string $locale + * @return string + */ + #[TentativeType] + public static function canonicalize(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Tries to find out best available locale based on HTTP "Accept-Language" header + * @link https://php.net/manual/en/locale.acceptfromhttp.php + * @param string $header

+ * The string containing the "Accept-Language" header according to format in RFC 2616. + *

+ * @return string The corresponding locale identifier. + */ + #[TentativeType] + public static function acceptFromHttp(#[TypeAware(['8.0' => 'string'], default: '')] $header): string|false {} +} + +class MessageFormatter +{ + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Constructs a new Message Formatter + * @link https://php.net/manual/en/messageformatter.create.php + * @param string $locale

+ * The locale to use when formatting arguments + *

+ * @param string $pattern

+ * The pattern string to stick arguments into. + * The pattern uses an 'apostrophe-friendly' syntax; it is run through + * umsg_autoQuoteApostrophe + * before being interpreted. + *

+ * @throws IntlException on failure. + */ + #[Pure] + public function __construct( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string'], default: '')] $pattern + ) {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Constructs a new Message Formatter + * @link https://php.net/manual/en/messageformatter.create.php + * @param string $locale

+ * The locale to use when formatting arguments + *

+ * @param string $pattern

+ * The pattern string to stick arguments into. + * The pattern uses an 'apostrophe-friendly' syntax; it is run through + * umsg_autoQuoteApostrophe + * before being interpreted. + *

+ * @return MessageFormatter|null The formatter object + */ + #[TentativeType] + public static function create( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string'], default: '')] $pattern + ): ?MessageFormatter {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Format the message + * @link https://php.net/manual/en/messageformatter.format.php + * @param array $values

+ * Arguments to insert into the format string + *

+ * @return string|false The formatted string, or FALSE if an error occurred + */ + #[Pure] + #[TentativeType] + public function format(array $values): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Quick format message + * @link https://php.net/manual/en/messageformatter.formatmessage.php + * @param string $locale

+ * The locale to use for formatting locale-dependent parts + *

+ * @param string $pattern

+ * The pattern string to insert things into. + * The pattern uses an 'apostrophe-friendly' syntax; it is run through + * umsg_autoQuoteApostrophe + * before being interpreted. + *

+ * @param array $values

+ * The array of values to insert into the format string + *

+ * @return string|false The formatted pattern string or FALSE if an error occurred + */ + #[TentativeType] + public static function formatMessage( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string'], default: '')] $pattern, + array $values + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Parse input string according to pattern + * @link https://php.net/manual/en/messageformatter.parse.php + * @param string $string

+ * The string to parse + *

+ * @return array|false An array containing the items extracted, or FALSE on error + */ + #[Pure] + #[TentativeType] + public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string): array|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Quick parse input string + * @link https://php.net/manual/en/messageformatter.parsemessage.php + * @param string $locale

+ * The locale to use for parsing locale-dependent parts + *

+ * @param string $pattern

+ * The pattern with which to parse the value. + *

+ * @param string $message

+ * The string to parse, conforming to the pattern. + *

+ * @return array|false An array containing items extracted, or FALSE on error + */ + #[TentativeType] + public static function parseMessage( + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'string'], default: '')] $pattern, + #[TypeAware(['8.0' => 'string'], default: '')] $message + ): array|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set the pattern used by the formatter + * @link https://php.net/manual/en/messageformatter.setpattern.php + * @param string $pattern

+ * The pattern string to use in this message formatter. + * The pattern uses an 'apostrophe-friendly' syntax; it is run through + * umsg_autoQuoteApostrophe + * before being interpreted. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the pattern used by the formatter + * @link https://php.net/manual/en/messageformatter.getpattern.php + * @return string The pattern string for this message formatter + */ + #[Pure] + #[TentativeType] + public function getPattern(): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the locale for which the formatter was created. + * @link https://php.net/manual/en/messageformatter.getlocale.php + * @return string The locale name + */ + #[Pure] + #[TentativeType] + public function getLocale(): string {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the error code from last operation + * @link https://php.net/manual/en/messageformatter.geterrorcode.php + * @return int The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the error text from the last operation + * @link https://php.net/manual/en/messageformatter.geterrormessage.php + * @return string Description of the last error. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string {} } -class NumberFormatter -{ - public const CURRENCY_ACCOUNTING = 12; - - /** - * Decimal format defined by pattern - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PATTERN_DECIMAL = 0; - - /** - * Decimal format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DECIMAL = 1; - - /** - * Currency format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const CURRENCY = 2; - - /** - * Percent format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PERCENT = 3; - - /** - * Scientific format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const SCIENTIFIC = 4; - - /** - * Spellout rule-based format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const SPELLOUT = 5; - - /** - * Ordinal rule-based format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ORDINAL = 6; - - /** - * Duration rule-based format - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DURATION = 7; - - /** - * Rule-based format defined by pattern - * @link https://php.net/manual/en/class.locale.php#intl.locale-constants - */ - public const PATTERN_RULEBASED = 9; - - /** - * Alias for PATTERN_DECIMAL - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const IGNORE = 0; - - /** - * Default format for the locale - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DEFAULT_STYLE = 1; - - /** - * Rounding mode to round towards positive infinity. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_CEILING = 0; - - /** - * Rounding mode to round towards negative infinity. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_FLOOR = 1; - - /** - * Rounding mode to round towards zero. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_DOWN = 2; - - /** - * Rounding mode to round away from zero. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_UP = 3; - - /** - * Rounding mode to round towards the "nearest neighbor" unless both - * neighbors are equidistant, in which case, round towards the even - * neighbor. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_HALFEVEN = 4; - - /** - * Rounding mode to round towards "nearest neighbor" unless both neighbors - * are equidistant, in which case round down. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_HALFDOWN = 5; - - /** - * Rounding mode to round towards "nearest neighbor" unless both neighbors - * are equidistant, in which case round up. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUND_HALFUP = 6; - - /** - * Pad characters inserted before the prefix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PAD_BEFORE_PREFIX = 0; - - /** - * Pad characters inserted after the prefix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PAD_AFTER_PREFIX = 1; - - /** - * Pad characters inserted before the suffix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PAD_BEFORE_SUFFIX = 2; - - /** - * Pad characters inserted after the suffix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PAD_AFTER_SUFFIX = 3; - - /** - * Parse integers only. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PARSE_INT_ONLY = 0; - - /** - * Use grouping separator. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const GROUPING_USED = 1; - - /** - * Always show decimal point. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DECIMAL_ALWAYS_SHOWN = 2; - - /** - * Maximum integer digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MAX_INTEGER_DIGITS = 3; - - /** - * Minimum integer digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MIN_INTEGER_DIGITS = 4; - - /** - * Integer digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const INTEGER_DIGITS = 5; - - /** - * Maximum fraction digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MAX_FRACTION_DIGITS = 6; - - /** - * Minimum fraction digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MIN_FRACTION_DIGITS = 7; - - /** - * Fraction digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const FRACTION_DIGITS = 8; - - /** - * Multiplier. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MULTIPLIER = 9; - - /** - * Grouping size. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const GROUPING_SIZE = 10; - - /** - * Rounding Mode. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUNDING_MODE = 11; - - /** - * Rounding increment. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ROUNDING_INCREMENT = 12; - - /** - * The width to which the output of format() is padded. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const FORMAT_WIDTH = 13; - - /** - * The position at which padding will take place. See pad position - * constants for possible argument values. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PADDING_POSITION = 14; - - /** - * Secondary grouping size. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const SECONDARY_GROUPING_SIZE = 15; - - /** - * Use significant digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const SIGNIFICANT_DIGITS_USED = 16; - - /** - * Minimum significant digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MIN_SIGNIFICANT_DIGITS = 17; - - /** - * Maximum significant digits. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MAX_SIGNIFICANT_DIGITS = 18; - - /** - * Lenient parse mode used by rule-based formats. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const LENIENT_PARSE = 19; - - /** - * Positive prefix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const POSITIVE_PREFIX = 0; - - /** - * Positive suffix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const POSITIVE_SUFFIX = 1; - - /** - * Negative prefix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const NEGATIVE_PREFIX = 2; - - /** - * Negative suffix. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const NEGATIVE_SUFFIX = 3; - - /** - * The character used to pad to the format width. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PADDING_CHARACTER = 4; - - /** - * The ISO currency code. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const CURRENCY_CODE = 5; - - /** - * The default rule set. This is only available with rule-based - * formatters. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DEFAULT_RULESET = 6; - - /** - * The public rule sets. This is only available with rule-based - * formatters. This is a read-only attribute. The public rulesets are - * returned as a single string, with each ruleset name delimited by ';' - * (semicolon). - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PUBLIC_RULESETS = 7; - - /** - * The decimal separator. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DECIMAL_SEPARATOR_SYMBOL = 0; - - /** - * The grouping separator. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const GROUPING_SEPARATOR_SYMBOL = 1; - - /** - * The pattern separator. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PATTERN_SEPARATOR_SYMBOL = 2; - - /** - * The percent sign. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PERCENT_SYMBOL = 3; - - /** - * Zero. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ZERO_DIGIT_SYMBOL = 4; - - /** - * Character representing a digit in the pattern. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DIGIT_SYMBOL = 5; - - /** - * The minus sign. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MINUS_SIGN_SYMBOL = 6; - - /** - * The plus sign. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PLUS_SIGN_SYMBOL = 7; - - /** - * The currency symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const CURRENCY_SYMBOL = 8; - - /** - * The international currency symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const INTL_CURRENCY_SYMBOL = 9; - - /** - * The monetary separator. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MONETARY_SEPARATOR_SYMBOL = 10; - - /** - * The exponential symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const EXPONENTIAL_SYMBOL = 11; - - /** - * Per mill symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PERMILL_SYMBOL = 12; - - /** - * Escape padding character. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PAD_ESCAPE_SYMBOL = 13; - - /** - * Infinity symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const INFINITY_SYMBOL = 14; - - /** - * Not-a-number symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const NAN_SYMBOL = 15; - - /** - * Significant digit symbol. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const SIGNIFICANT_DIGIT_SYMBOL = 16; - - /** - * The monetary grouping separator. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const MONETARY_GROUPING_SEPARATOR_SYMBOL = 17; - - /** - * Derive the type from variable type - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const TYPE_DEFAULT = 0; - - /** - * Format/parse as 32-bit integer - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const TYPE_INT32 = 1; - - /** - * Format/parse as 64-bit integer - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const TYPE_INT64 = 2; - - /** - * Format/parse as floating point value - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const TYPE_DOUBLE = 3; - - /** - * Format/parse as currency value - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const TYPE_CURRENCY = 4; - - /** - * @link https://www.php.net/manual/en/class.numberformatter.php - * @param string $locale - * @param int $style - * @param string $pattern [optional] - */ - #[Pure] - public function __construct( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] $style, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Create a number formatter - * @link https://php.net/manual/en/numberformatter.create.php - * @param string $locale

- * Locale in which the number would be formatted (locale name, e.g. en_CA). - *

- * @param int $style

- * Style of the formatting, one of the - * format style constants. If - * NumberFormatter::PATTERN_DECIMAL - * or NumberFormatter::PATTERN_RULEBASED - * is passed then the number format is opened using the given pattern, - * which must conform to the syntax described in - * ICU DecimalFormat - * documentation or - * ICU RuleBasedNumberFormat - * documentation, respectively. - *

- * @param string $pattern [optional]

- * Pattern string if the chosen style requires a pattern. - *

- * @return NumberFormatter|false NumberFormatter object or FALSE on error. - */ - public static function create( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED])] $style, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Format a number - * @link https://php.net/manual/en/numberformatter.format.php - * @param int|float $num

- * The value to format. Can be integer or float, - * other values will be converted to a numeric value. - *

- * @param int $type [optional]

- * The - * formatting type to use. - *

- * @return string|false the string containing formatted value, or FALSE on error. - */ - #[Pure] - public function format( - #[TypeAware(['8.0' => 'int|float'], default: '')] $num, - #[TypeAware(['8.0' => 'int'], default: '')] $type = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Parse a number - * @link https://php.net/manual/en/numberformatter.parse.php - * @param string $string - * @param int $type [optional]

- * The - * formatting type to use. By default, - * NumberFormatter::TYPE_DOUBLE is used. - *

- * @param int &$offset [optional]

- * Offset in the string at which to begin parsing. On return, this value - * will hold the offset at which parsing ended. - *

- * @return mixed The value of the parsed number or FALSE on error. - */ - public function parse( - #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $type = NumberFormatter::TYPE_DOUBLE, - &$offset = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Format a currency value - * @link https://php.net/manual/en/numberformatter.formatcurrency.php - * @param float $amount

- * The numeric currency value. - *

- * @param string $currency

- * The 3-letter ISO 4217 currency code indicating the currency to use. - *

- * @return string String representing the formatted currency value. - */ - #[Pure] - public function formatCurrency( - #[TypeAware(['8.0' => 'float'], default: '')] $amount, - #[TypeAware(['8.0' => 'string'], default: '')] $currency - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Parse a currency number - * @link https://php.net/manual/en/numberformatter.parsecurrency.php - * @param string $string - * @param string &$currency

- * Parameter to receive the currency name (3-letter ISO 4217 currency - * code). - *

- * @param int &$offset [optional]

- * Offset in the string at which to begin parsing. On return, this value - * will hold the offset at which parsing ended. - *

- * @return float|false The parsed numeric value or FALSE on error. - */ - public function parseCurrency(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$currency, &$offset = null) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set an attribute - * @link https://php.net/manual/en/numberformatter.setattribute.php - * @param int $attribute

- * Attribute specifier - one of the - * numeric attribute constants. - *

- * @param int $value

- * The attribute value. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setAttribute( - #[TypeAware(['8.0' => 'int'], default: '')] $attribute, - #[TypeAware(['8.0' => 'int|float'], default: '')] $value - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get an attribute - * @link https://php.net/manual/en/numberformatter.getattribute.php - * @param int $attribute

- * Attribute specifier - one of the - * numeric attribute constants. - *

- * @return int|false Return attribute value on success, or FALSE on error. - */ - #[Pure] - public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set a text attribute - * @link https://php.net/manual/en/numberformatter.settextattribute.php - * @param int $attribute

- * Attribute specifier - one of the - * text attribute - * constants. - *

- * @param string $value

- * Text for the attribute value. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setTextAttribute( - #[TypeAware(['8.0' => 'int'], default: '')] $attribute, - #[TypeAware(['8.0' => 'string'], default: '')] $value - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get a text attribute - * @link https://php.net/manual/en/numberformatter.gettextattribute.php - * @param int $attribute

- * Attribute specifier - one of the - * text attribute constants. - *

- * @return string|false Return attribute value on success, or FALSE on error. - */ - #[Pure] - public function getTextAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set a symbol value - * @link https://php.net/manual/en/numberformatter.setsymbol.php - * @param int $symbol

- * Symbol specifier, one of the - * format symbol constants. - *

- * @param string $value

- * Text for the symbol. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setSymbol( - #[TypeAware(['8.0' => 'int'], default: '')] $symbol, - #[TypeAware(['8.0' => 'string'], default: '')] $value - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get a symbol value - * @link https://php.net/manual/en/numberformatter.getsymbol.php - * @param int $symbol

- * Symbol specifier, one of the - * format symbol constants. - *

- * @return string|false The symbol string or FALSE on error. - */ - #[Pure] - public function getSymbol(#[TypeAware(['8.0' => 'int'], default: '')] $symbol) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set formatter pattern - * @link https://php.net/manual/en/numberformatter.setpattern.php - * @param string $pattern

- * Pattern in syntax described in - * ICU DecimalFormat - * documentation. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get formatter pattern - * @link https://php.net/manual/en/numberformatter.getpattern.php - * @return string|false Pattern string that is used by the formatter, or FALSE if an error happens. - */ - #[Pure] - public function getPattern() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get formatter locale - * @link https://php.net/manual/en/numberformatter.getlocale.php - * @param int $type [optional]

- * You can choose between valid and actual locale ( - * Locale::VALID_LOCALE, - * Locale::ACTUAL_LOCALE, - * respectively). The default is the actual locale. - *

- * @return string The locale name used to create the formatter. - */ - #[Pure] - public function getLocale( - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get formatter's last error code. - * @link https://php.net/manual/en/numberformatter.geterrorcode.php - * @return int error code from last formatter call. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get formatter's last error message. - * @link https://php.net/manual/en/numberformatter.geterrormessage.php - * @return string error message from last formatter call. - */ - #[Pure] - public function getErrorMessage() {} -} +class IntlDateFormatter +{ + /** + * Completely specified style (Tuesday, April 12, 1952 AD or 3:30:42pm PST) + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const FULL = 0; + + /** + * Long style (January 12, 1952 or 3:30:32pm) + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const LONG = 1; + + /** + * Medium style (Jan 12, 1952) + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const MEDIUM = 2; + + /** + * Most abbreviated style, only essential data (12/13/52 or 3:30pm) + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const SHORT = 3; + + /** + * Do not include this element + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const NONE = -1; + + /** + * Gregorian Calendar + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const GREGORIAN = 1; + + /** + * Non-Gregorian Calendar + * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants + */ + public const TRADITIONAL = 0; + + public const RELATIVE_FULL = 128; + public const RELATIVE_LONG = 129; + public const RELATIVE_MEDIUM = 130; + public const RELATIVE_SHORT = 131; + + /** + * @param string|null $locale + * @param int $dateType [optional] + * @param int $timeType [optional] + * @param mixed|null $timezone [optional] + * @param mixed|null $calendar [optional] + * @param string $pattern [optional] + */ + #[Pure] + public function __construct( + #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, + #[TypeAware(['8.0' => 'int'], default: '')] $dateType, + #[TypeAware(['8.0' => 'int'], default: '')] $timeType, + $timezone = null, + $calendar = null, + #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = '' + ) {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Create a date formatter + * @link https://php.net/manual/en/intldateformatter.create.php + * @param string $locale

+ * Locale to use when formatting or parsing; default is specified in the ini setting intl.default_locale. + *

+ * @param int $dateType [optional]

+ * Date type to use (none, + * short, medium, + * long, full). + * This is one of the + * IntlDateFormatter constants. + *

+ * @param int $timeType [optional]

+ * Time type to use (none, + * short, medium, + * long, full). + * This is one of the + * IntlDateFormatter constants. + *

+ * @param string $timezone [optional]

+ * Time zone ID, default is system default. + *

+ * @param int $calendar [optional]

+ * Calendar to use for formatting or parsing; default is Gregorian. + * This is one of the + * IntlDateFormatter calendar constants. + *

+ * @param string $pattern [optional]

+ * Optional pattern to use when formatting or parsing. + * Possible patterns are documented at http://userguide.icu-project.org/formatparse/datetime. + *

+ * @return IntlDateFormatter + */ + #[TentativeType] + public static function create( + #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, + #[TypeAware(['8.0' => 'int'], default: '')] $dateType, + #[TypeAware(['8.0' => 'int'], default: '')] $timeType, + $timezone = null, + #[TypeAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar = null, + #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = '' + ): ?IntlDateFormatter {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the datetype used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.getdatetype.php + * @return int|false The current date type value of the formatter. + */ + #[Pure] + #[TentativeType] + public function getDateType(): int|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the timetype used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.gettimetype.php + * @return int|false The current date type value of the formatter. + */ + #[Pure] + #[TentativeType] + public function getTimeType(): int|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the calendar used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.getcalendar.php + * @return int|false The calendar being used by the formatter. + */ + #[Pure] + #[TentativeType] + public function getCalendar(): int|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * sets the calendar used to the appropriate calendar, which must be + * @link https://php.net/manual/en/intldateformatter.setcalendar.php + * @param int $calendar

+ * The calendar to use. + * Default is IntlDateFormatter::GREGORIAN. + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setCalendar(#[TypeAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the timezone-id used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.gettimezoneid.php + * @return string|false ID string for the time zone used by this formatter. + */ + #[Pure] + #[TentativeType] + public function getTimeZoneId(): string|false {} + + /** + * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
+ * Get copy of formatter's calendar object + * @link https://secure.php.net/manual/en/intldateformatter.getcalendarobject.php + * @return IntlCalendar|false|null A copy of the internal calendar object used by this formatter. + */ + #[Pure] + #[TentativeType] + public function getCalendarObject(): IntlCalendar|false|null {} + + /** + * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
+ * Get formatter's timezone + * @link https://secure.php.net/manual/en/intldateformatter.gettimezone.php + * @return IntlTimeZone|false The associated IntlTimeZone object or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getTimeZone(): IntlTimeZone|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Sets the time zone to use + * @link https://php.net/manual/en/intldateformatter.settimezoneid.php + * @param string $zone

+ * The time zone ID string of the time zone to use. + * If NULL or the empty string, the default time zone for the runtime is used. + *

+ * @return bool TRUE on success or FALSE on failure. + * @removed 7.0 + * @see IntlDateFormatter::setTimeZone() + */ + #[Deprecated(replacement: "%class%->setTimeZone(%parametersList%)", since: "5.5")] + public function setTimeZoneId($zone) {} + + /** + * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
+ * Sets formatter's timezone + * @link https://php.net/manual/en/intldateformatter.settimezone.php + * @param mixed $timezone

+ * The timezone to use for this formatter. This can be specified in the + * following forms: + *

+ *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setTimeZone($timezone): ?bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set the pattern used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.setpattern.php + * @param string $pattern

+ * New pattern string to use. + * Possible patterns are documented at http://userguide.icu-project.org/formatparse/datetime. + *

+ * @return bool TRUE on success or FALSE on failure. + * Bad formatstrings are usually the cause of the failure. + */ + #[TentativeType] + public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the pattern used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.getpattern.php + * @return string The pattern string being used to format/parse. + */ + #[Pure] + #[TentativeType] + public function getPattern(): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the locale used by formatter + * @link https://php.net/manual/en/intldateformatter.getlocale.php + * @param int $type [optional] + * @return string|false the locale of this formatter or 'false' if error + */ + #[Pure] + #[TentativeType] + public function getLocale( + #[ElementAvailable(from: '8.0')] + #[TypeAware(['8.0' => 'int'], default: '')] + $type = null + ): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Set the leniency of the parser + * @link https://php.net/manual/en/intldateformatter.setlenient.php + * @param bool $lenient

+ * Sets whether the parser is lenient or not, default is TRUE (lenient). + *

+ * @return bool TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient): void {} -class Normalizer -{ - public const NFKC_CF = 48; - - public const FORM_KC_CF = 48; - - /** - * Default normalization options - * @link https://secure.php.net/manual/en/class.normalizer.php - */ - public const OPTION_DEFAULT = ""; - - /** - * No decomposition/composition - * @link https://secure.php.net/manual/en/class.normalizer.php - * @removed 8.0 - */ - public const NONE = "1"; - - /** - * Normalization Form D (NFD) - Canonical Decomposition - * @link https://secure.php.net/manual/en/class.normalizer.php - */ - public const FORM_D = 4; - public const NFD = 4; - - /** - * Normalization Form KD (NFKD) - Compatibility Decomposition - * @link https://secure.php.net/manual/en/class.normalizer.php - */ - public const FORM_KD = 8; - public const NFKD = 8; - - /** - * Normalization Form C (NFC) - Canonical Decomposition followed by - * Canonical Composition - * @link https://secure.php.net/manual/en/class.normalizer.php - */ - public const FORM_C = 16; - public const NFC = 16; - - /** - * Normalization Form KC (NFKC) - Compatibility Decomposition, followed by - * Canonical Composition - * @link https://secure.php.net/manual/en/class.normalizer.php - */ - public const FORM_KC = 32; - public const NFKC = 32; - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Normalizes the input provided and returns the normalized string - * @link https://php.net/manual/en/normalizer.normalize.php - * @param string $string

The input string to normalize

- * @param int $form [optional]

One of the normalization forms.

- * @return string|false The normalized string or FALSE if an error occurred. - */ - public static function normalize( - #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Checks if the provided string is already in the specified normalization form. - * @link https://php.net/manual/en/normalizer.isnormalized.php - * @param string $string

The input string to normalize

- * @param int $form [optional]

- * One of the normalization forms. - *

- * @return bool TRUE if normalized, FALSE otherwise or if there an error - */ - public static function isNormalized( - #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C - ) {} - - /** - * @param string $string

The input string to normalize

- * @param string $form - * @return string|null

Returns a string containing the Decomposition_Mapping property, if present in the UCD. - * Returns null if there is no Decomposition_Mapping property for the character.

- * @link https://www.php.net/manual/en/normalizer.getrawdecomposition.php - * @since 7.3 - */ - public static function getRawDecomposition( - string $string, - #[ElementAvailable(from: '8.0')] int $form = 16 - ) {} + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the lenient used for the IntlDateFormatter + * @link https://php.net/manual/en/intldateformatter.islenient.php + * @return bool TRUE if parser is lenient, FALSE if parser is strict. By default the parser is lenient. + */ + #[Pure] + #[TentativeType] + public function isLenient(): bool {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Format the date/time value as a string + * @link https://php.net/manual/en/intldateformatter.format.php + * @param mixed $datetime

+ * Value to format. This may be a DateTime object, + * an integer representing a Unix timestamp value (seconds + * since epoch, UTC) or an array in the format output by + * localtime. + *

+ * @return string|false The formatted string or, if an error occurred, FALSE. + */ + #[TentativeType] + public function format($datetime = null, #[ElementAvailable(from: '5.3', to: '7.4')] $array = null): string|false {} + + /** + * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
+ * Formats an object + * @link https://secure.php.net/manual/en/intldateformatter.formatobject.php + * @param object $datetime

+ * An object of type {@link "https://secure.php.net/manual/en/class.intlcalendar.php" IntlCalendar} or {@link "https://secure.php.net/manual/en/class.datetime.php" DateTime}. The timezone information in the object will be used. + *

+ * @param mixed $format [optional]

+ * How to format the date/time. This can either be an {@link "https://secure.php.net/manual/en/language.types.array.php" array} with + * two elements (first the date style, then the time style, these being one + * of the constants IntlDateFormatter::NONE, + * IntlDateFormatter::SHORT, + * IntlDateFormatter::MEDIUM, + * IntlDateFormatter::LONG, + * IntlDateFormatter::FULL), a long with + * the value of one of these constants (in which case it will be used both + * for the time and the date) or a {@link "https://secure.php.net/manual/en/language.types.string.php" string} with the format + * described in {@link "http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details" the ICU documentation}. + * If NULL, the default style will be used. + *

+ * @param string|null $locale [optional]

+ * The locale to use, or NULL to use the {@link "https://secure.php.net/manual/en/intl.configuration.php#ini.intl.default-locale" default one}.

+ * @return string|false A string with result or FALSE on failure. + */ + #[TentativeType] + public static function formatObject($datetime, $format = null, #[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): string|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Parse string to a timestamp value + * @link https://php.net/manual/en/intldateformatter.parse.php + * @param string $string

+ * string to convert to a time + *

+ * @param int &$offset [optional]

+ * Position at which to start the parsing in $value (zero-based). + * If no error occurs before $value is consumed, $parse_pos will contain -1 + * otherwise it will contain the position at which parsing ended (and the error occurred). + * This variable will contain the end position if the parse fails. + * If $parse_pos > strlen($value), the parse fails immediately. + *

+ * @return int|float|false timestamp parsed value + */ + #[TentativeType] + public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$offset = null): int|float|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Parse string to a field-based time value + * @link https://php.net/manual/en/intldateformatter.localtime.php + * @param string $string

+ * string to convert to a time + *

+ * @param int &$offset [optional]

+ * Position at which to start the parsing in $value (zero-based). + * If no error occurs before $value is consumed, $parse_pos will contain -1 + * otherwise it will contain the position at which parsing ended . + * If $parse_pos > strlen($value), the parse fails immediately. + *

+ * @return array|false Localtime compatible array of integers : contains 24 hour clock value in tm_hour field + */ + #[TentativeType] + public function localtime(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$offset = null): array|false {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the error code from last operation + * @link https://php.net/manual/en/intldateformatter.geterrorcode.php + * @return int The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int {} + + /** + * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
+ * Get the error text from the last operation. + * @link https://php.net/manual/en/intldateformatter.geterrormessage.php + * @return string Description of the last error. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string {} } -class Locale +class ResourceBundle implements IteratorAggregate, Countable { - /** - * This is locale the data actually comes from. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const ACTUAL_LOCALE = 0; - - /** - * This is the most specific locale supported by ICU. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const VALID_LOCALE = 1; - - /** - * Used as locale parameter with the methods of the various locale affected classes, - * such as NumberFormatter. This constant would make the methods to use default - * locale. - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const DEFAULT_LOCALE = null; - - /** - * Language subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const LANG_TAG = "language"; - - /** - * Extended language subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const EXTLANG_TAG = "extlang"; - - /** - * Script subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const SCRIPT_TAG = "script"; - - /** - * Region subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const REGION_TAG = "region"; - - /** - * Variant subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const VARIANT_TAG = "variant"; - - /** - * Grandfathered Language subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const GRANDFATHERED_LANG_TAG = "grandfathered"; - - /** - * Private subtag - * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants - */ - public const PRIVATE_TAG = "private"; - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Gets the default locale value from the INTL global 'default_locale' - * @link https://php.net/manual/en/locale.getdefault.php - * @return string The current runtime locale - */ - public static function getDefault() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * sets the default runtime locale - * @link https://php.net/manual/en/locale.setdefault.php - * @param string $locale

- * Is a BCP 47 compliant language tag containing the - *

- * @return bool TRUE on success or FALSE on failure. - */ - public static function setDefault(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Gets the primary language for the input locale - * @link https://php.net/manual/en/locale.getprimarylanguage.php - * @param string $locale

- * The locale to extract the primary language code from - *

- * @return string|null The language code associated with the language or NULL in case of error. - */ - public static function getPrimaryLanguage(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Gets the script for the input locale - * @link https://php.net/manual/en/locale.getscript.php - * @param string $locale

- * The locale to extract the script code from - *

- * @return string|null The script subtag for the locale or NULL if not present - */ - public static function getScript(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Gets the region for the input locale - * @link https://php.net/manual/en/locale.getregion.php - * @param string $locale

- * The locale to extract the region code from - *

- * @return string|null The region subtag for the locale or NULL if not present - */ - public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Gets the keywords for the input locale - * @link https://php.net/manual/en/locale.getkeywords.php - * @param string $locale

- * The locale to extract the keywords from - *

- * @return array Associative array containing the keyword-value pairs for this locale - */ - public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns an appropriately localized display name for script of the input locale - * @link https://php.net/manual/en/locale.getdisplayscript.php - * @param string $locale

- * The locale to return a display script for - *

- * @param string $displayLocale [optional]

- * Optional format locale to use to display the script name - *

- * @return string Display name of the script for the $locale in the format appropriate for - * $in_locale. - */ - public static function getDisplayScript( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns an appropriately localized display name for region of the input locale - * @link https://php.net/manual/en/locale.getdisplayregion.php - * @param string $locale

- * The locale to return a display region for. - *

- * @param string $displayLocale [optional]

- * Optional format locale to use to display the region name - *

- * @return string display name of the region for the $locale in the format appropriate for - * $in_locale. - */ - public static function getDisplayRegion( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns an appropriately localized display name for the input locale - * @link https://php.net/manual/en/locale.getdisplayname.php - * @param string $locale

- * The locale to return a display name for. - *

- * @param string $displayLocale [optional]

optional format locale

- * @return string Display name of the locale in the format appropriate for $in_locale. - */ - public static function getDisplayName( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns an appropriately localized display name for language of the inputlocale - * @link https://php.net/manual/en/locale.getdisplaylanguage.php - * @param string $locale

- * The locale to return a display language for - *

- * @param string $displayLocale [optional]

- * Optional format locale to use to display the language name - *

- * @return string display name of the language for the $locale in the format appropriate for - * $in_locale. - */ - public static function getDisplayLanguage( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns an appropriately localized display name for variants of the input locale - * @link https://php.net/manual/en/locale.getdisplayvariant.php - * @param string $locale

- * The locale to return a display variant for - *

- * @param string $displayLocale [optional]

- * Optional format locale to use to display the variant name - *

- * @return string Display name of the variant for the $locale in the format appropriate for - * $in_locale. - */ - public static function getDisplayVariant( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns a correctly ordered and delimited locale ID - * @link https://php.net/manual/en/locale.composelocale.php - * @param array $subtags

- * an array containing a list of key-value pairs, where the keys identify - * the particular locale ID subtags, and the values are the associated - * subtag values. - *

- * The 'variant' and 'private' subtags can take maximum 15 values - * whereas 'extlang' can take maximum 3 values.e.g. Variants are allowed - * with the suffix ranging from 0-14. Hence the keys for the input array - * can be variant0, variant1, ...,variant14. In the returned locale id, - * the subtag is ordered by suffix resulting in variant0 followed by - * variant1 followed by variant2 and so on. - *

- *

- * The 'variant', 'private' and 'extlang' multiple values can be specified both - * as array under specific key (e.g. 'variant') and as multiple numbered keys - * (e.g. 'variant0', 'variant1', etc.). - *

- *

- * @return string The corresponding locale identifier. - */ - public static function composeLocale(array $subtags) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Returns a key-value array of locale ID subtag elements. - * @link https://php.net/manual/en/locale.parselocale.php - * @param string $locale

- * The locale to extract the subtag array from. Note: The 'variant' and - * 'private' subtags can take maximum 15 values whereas 'extlang' can take - * maximum 3 values. - *

- * @return array an array containing a list of key-value pairs, where the keys - * identify the particular locale ID subtags, and the values are the - * associated subtag values. The array will be ordered as the locale id - * subtags e.g. in the locale id if variants are '-varX-varY-varZ' then the - * returned array will have variant0=>varX , variant1=>varY , - * variant2=>varZ - */ - public static function parseLocale(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Gets the variants for the input locale - * @link https://php.net/manual/en/locale.getallvariants.php - * @param string $locale

- * The locale to extract the variants from - *

- * @return array|null The array containing the list of all variants subtag for the locale - * or NULL if not present - */ - public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Checks if a language tag filter matches with locale - * @link https://php.net/manual/en/locale.filtermatches.php - * @param string $languageTag

- * The language tag to check - *

- * @param string $locale

- * The language range to check against - *

- * @param bool $canonicalize [optional]

- * If true, the arguments will be converted to canonical form before - * matching. - *

- * @return bool TRUE if $locale matches $langtag FALSE otherwise. - */ - public static function filterMatches( - #[TypeAware(['8.0' => 'string'], default: '')] $languageTag, - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Searches the language tag list for the best match to the language - * @link https://php.net/manual/en/locale.lookup.php - * @param array $languageTag

- * An array containing a list of language tags to compare to - * locale. Maximum 100 items allowed. - *

- * @param string $locale

- * The locale to use as the language range when matching. - *

- * @param bool $canonicalize [optional]

- * If true, the arguments will be converted to canonical form before - * matching. - *

- * @param string $defaultLocale [optional]

- * The locale to use if no match is found. - *

- * @return string The closest matching language tag or default value. - */ - public static function lookup( - array $languageTag, - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false, - #[TypeAware(['8.0' => 'string|null'], default: '')] $defaultLocale = null - ) {} - - /** - * @link https://php.net/manual/en/locale.canonicalize.php - * @param string $locale - * @return string - */ - public static function canonicalize(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Tries to find out best available locale based on HTTP "Accept-Language" header - * @link https://php.net/manual/en/locale.acceptfromhttp.php - * @param string $header

- * The string containing the "Accept-Language" header according to format in RFC 2616. - *

- * @return string The corresponding locale identifier. - */ - public static function acceptFromHttp(#[TypeAware(['8.0' => 'string'], default: '')] $header) {} + /** + * @link https://www.php.net/manual/en/resourcebundle.create.php + * @param string $locale

Locale for which the resources should be loaded (locale name, e.g. en_CA).

+ * @param string $bundle

The directory where the data is stored or the name of the .dat file.

+ * @param bool $fallback [optional]

Whether locale should match exactly or fallback to parent locale is allowed.

+ */ + #[Pure] + public function __construct( + #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $bundle, + #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true + ) {} + + /** + * (PHP >= 5.3.2, PECL intl >= 2.0.0)
+ * Create a resource bundle + * @link https://php.net/manual/en/resourcebundle.create.php + * @param string $locale

+ * Locale for which the resources should be loaded (locale name, e.g. en_CA). + *

+ * @param string $bundle

+ * The directory where the data is stored or the name of the .dat file. + *

+ * @param bool $fallback [optional]

+ * Whether locale should match exactly or fallback to parent locale is allowed. + *

+ * @return ResourceBundle|null ResourceBundle object or null on error. + */ + #[TentativeType] + public static function create( + #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, + #[TypeAware(['8.0' => 'string|null'], default: '')] $bundle, + #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true + ): ?ResourceBundle {} + + /** + * (PHP >= 5.3.2, PECL intl >= 2.0.0)
+ * Get data from the bundle + * @link https://php.net/manual/en/resourcebundle.get.php + * @param string|int $index

+ * Data index, must be string or integer. + *

+ * @param bool $fallback + * @return mixed the data located at the index or NULL on error. Strings, integers and binary data strings + * are returned as corresponding PHP types, integer array is returned as PHP array. Complex types are + * returned as ResourceBundle object. + */ + #[Pure] + #[TentativeType] + public function get($index, #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true): mixed {} + + /** + * (PHP >= 5.3.2, PECL intl >= 2.0.0)
+ * Get number of elements in the bundle + * @link https://php.net/manual/en/resourcebundle.count.php + * @return int number of elements in the bundle. + */ + #[Pure] + #[TentativeType] + public function count(): int {} + + /** + * (PHP >= 5.3.2, PECL intl >= 2.0.0)
+ * Get supported locales + * @link https://php.net/manual/en/resourcebundle.locales.php + * @param string $bundle

+ * Path of ResourceBundle for which to get available locales, or + * empty string for default locales list. + *

+ * @return array the list of locales supported by the bundle. + */ + #[TentativeType] + public static function getLocales(#[TypeAware(['8.0' => 'string'], default: '')] $bundle): array|false {} + + /** + * (PHP >= 5.3.2, PECL intl >= 2.0.0)
+ * Get bundle's last error code. + * @link https://php.net/manual/en/resourcebundle.geterrorcode.php + * @return int error code from last bundle object call. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int {} + + /** + * (PHP >= 5.3.2, PECL intl >= 2.0.0)
+ * Get bundle's last error message. + * @link https://php.net/manual/en/resourcebundle.geterrormessage.php + * @return string error message from last bundle object's call. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string {} + + /** + * @return Traversable + * @since 8.0 + */ + #[Pure] + public function getIterator(): Iterator {} } -class MessageFormatter +/** + * @since 5.4 + */ +class Transliterator { - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Constructs a new Message Formatter - * @link https://php.net/manual/en/messageformatter.create.php - * @param string $locale

- * The locale to use when formatting arguments - *

- * @param string $pattern

- * The pattern string to stick arguments into. - * The pattern uses an 'apostrophe-friendly' syntax; it is run through - * umsg_autoQuoteApostrophe - * before being interpreted. - *

- * @throws IntlException on failure. - */ - #[Pure] - public function __construct( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Constructs a new Message Formatter - * @link https://php.net/manual/en/messageformatter.create.php - * @param string $locale

- * The locale to use when formatting arguments - *

- * @param string $pattern

- * The pattern string to stick arguments into. - * The pattern uses an 'apostrophe-friendly' syntax; it is run through - * umsg_autoQuoteApostrophe - * before being interpreted. - *

- * @return MessageFormatter The formatter object - */ - public static function create( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Format the message - * @link https://php.net/manual/en/messageformatter.format.php - * @param array $values

- * Arguments to insert into the format string - *

- * @return string|false The formatted string, or FALSE if an error occurred - */ - #[Pure] - public function format(array $values) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Quick format message - * @link https://php.net/manual/en/messageformatter.formatmessage.php - * @param string $locale

- * The locale to use for formatting locale-dependent parts - *

- * @param string $pattern

- * The pattern string to insert things into. - * The pattern uses an 'apostrophe-friendly' syntax; it is run through - * umsg_autoQuoteApostrophe - * before being interpreted. - *

- * @param array $values

- * The array of values to insert into the format string - *

- * @return string|false The formatted pattern string or FALSE if an error occurred - */ - public static function formatMessage( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern, - array $values - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Parse input string according to pattern - * @link https://php.net/manual/en/messageformatter.parse.php - * @param string $string

- * The string to parse - *

- * @return array|false An array containing the items extracted, or FALSE on error - */ - #[Pure] - public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Quick parse input string - * @link https://php.net/manual/en/messageformatter.parsemessage.php - * @param string $locale

- * The locale to use for parsing locale-dependent parts - *

- * @param string $pattern

- * The pattern with which to parse the value. - *

- * @param string $message

- * The string to parse, conforming to the pattern. - *

- * @return array|false An array containing items extracted, or FALSE on error - */ - public static function parseMessage( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern, - #[TypeAware(['8.0' => 'string'], default: '')] $message - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set the pattern used by the formatter - * @link https://php.net/manual/en/messageformatter.setpattern.php - * @param string $pattern

- * The pattern string to use in this message formatter. - * The pattern uses an 'apostrophe-friendly' syntax; it is run through - * umsg_autoQuoteApostrophe - * before being interpreted. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the pattern used by the formatter - * @link https://php.net/manual/en/messageformatter.getpattern.php - * @return string The pattern string for this message formatter - */ - #[Pure] - public function getPattern() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the locale for which the formatter was created. - * @link https://php.net/manual/en/messageformatter.getlocale.php - * @return string The locale name - */ - #[Pure] - public function getLocale() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the error code from last operation - * @link https://php.net/manual/en/messageformatter.geterrorcode.php - * @return int The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the error text from the last operation - * @link https://php.net/manual/en/messageformatter.geterrormessage.php - * @return string Description of the last error. - */ - #[Pure] - public function getErrorMessage() {} + public const FORWARD = 0; + public const REVERSE = 1; + + #[TypeAware(['8.1' => 'string'], default: '')] + public $id; + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Private constructor to deny instantiation + * @link https://php.net/manual/en/transliterator.construct.php + */ + final private function __construct() {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Create a transliterator + * @link https://php.net/manual/en/transliterator.create.php + * @param string $id

+ * The id. + *

+ * @param int $direction [optional]

+ * The direction, defaults to + * Transliterator::FORWARD. + * May also be set to + * Transliterator::REVERSE. + *

+ * @return Transliterator|null a Transliterator object on success, + * or NULL on failure. + */ + #[TentativeType] + public static function create( + #[TypeAware(['8.0' => 'string'], default: '')] $id, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null + ): ?Transliterator {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Create transliterator from rules + * @link https://php.net/manual/en/transliterator.createfromrules.php + * @param string $rules

+ * The rules. + *

+ * @param int $direction [optional]

+ * The direction, defaults to + * {@see Transliterator::FORWARD}. + * May also be set to + * {@see Transliterator::REVERSE}. + *

+ * @return Transliterator|null a Transliterator object on success, + * or NULL on failure. + */ + #[TentativeType] + public static function createFromRules( + #[TypeAware(['8.0' => 'string'], default: '')] $rules, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null + ): ?Transliterator {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Create an inverse transliterator + * @link https://php.net/manual/en/transliterator.createinverse.php + * @return Transliterator|null a Transliterator object on success, + * or NULL on failure + */ + #[Pure] + #[TentativeType] + public function createInverse(): ?Transliterator {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Get transliterator IDs + * @link https://php.net/manual/en/transliterator.listids.php + * @return array|false An array of registered transliterator IDs on success, + * or FALSE on failure. + */ + #[TentativeType] + public static function listIDs(): array|false {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Transliterate a string + * @link https://php.net/manual/en/transliterator.transliterate.php + * @param string $string

+ * The string to be transformed. + *

+ * @param int $start [optional]

+ * The start index (in UTF-16 code units) from which the string will start + * to be transformed, inclusive. Indexing starts at 0. The text before will + * be left as is. + *

+ * @param int $end [optional]

+ * The end index (in UTF-16 code units) until which the string will be + * transformed, exclusive. Indexing starts at 0. The text after will be + * left as is. + *

+ * @return string|false The transfomed string on success, or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function transliterate( + #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[TypeAware(['8.0' => 'int'], default: '')] $start = null, + #[TypeAware(['8.0' => 'int'], default: '')] $end = -1 + ): string|false {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Get last error code + * @link https://php.net/manual/en/transliterator.geterrorcode.php + * @return int|false The error code on success, + * or FALSE if none exists, or on failure. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int|false {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Get last error message + * @link https://php.net/manual/en/transliterator.geterrormessage.php + * @return string|false The error code on success, + * or FALSE if none exists, or on failure. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string|false {} } -class IntlDateFormatter +/** + * @link https://php.net/manual/en/class.spoofchecker.php + */ +class Spoofchecker { - /** - * Completely specified style (Tuesday, April 12, 1952 AD or 3:30:42pm PST) - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const FULL = 0; - - /** - * Long style (January 12, 1952 or 3:30:32pm) - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const LONG = 1; - - /** - * Medium style (Jan 12, 1952) - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const MEDIUM = 2; - - /** - * Most abbreviated style, only essential data (12/13/52 or 3:30pm) - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const SHORT = 3; - - /** - * Do not include this element - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const NONE = -1; - - /** - * Gregorian Calendar - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const GREGORIAN = 1; - - /** - * Non-Gregorian Calendar - * @link https://php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants - */ - public const TRADITIONAL = 0; - - public const RELATIVE_FULL = 128; - public const RELATIVE_LONG = 129; - public const RELATIVE_MEDIUM = 130; - public const RELATIVE_SHORT = 131; - - /** - * @param string|null $locale - * @param int $dateType [optional] - * @param int $timeType [optional] - * @param mixed|null $timezone [optional] - * @param mixed|null $calendar [optional] - * @param string $pattern [optional] - */ - #[Pure] - public function __construct( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] $dateType, - #[TypeAware(['8.0' => 'int'], default: '')] $timeType, - $timezone = null, - $calendar = null, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = '' - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Create a date formatter - * @link https://php.net/manual/en/intldateformatter.create.php - * @param string $locale

- * Locale to use when formatting or parsing; default is specified in the ini setting intl.default_locale. - *

- * @param int $dateType [optional]

- * Date type to use (none, - * short, medium, - * long, full). - * This is one of the - * IntlDateFormatter constants. - *

- * @param int $timeType [optional]

- * Time type to use (none, - * short, medium, - * long, full). - * This is one of the - * IntlDateFormatter constants. - *

- * @param string $timezone [optional]

- * Time zone ID, default is system default. - *

- * @param int $calendar [optional]

- * Calendar to use for formatting or parsing; default is Gregorian. - * This is one of the - * IntlDateFormatter calendar constants. - *

- * @param string $pattern [optional]

- * Optional pattern to use when formatting or parsing. - * Possible patterns are documented at http://userguide.icu-project.org/formatparse/datetime. - *

- * @return IntlDateFormatter - */ - public static function create( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] $dateType, - #[TypeAware(['8.0' => 'int'], default: '')] $timeType, - $timezone = null, - #[TypeAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar = null, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = '' - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the datetype used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.getdatetype.php - * @return int The current date type value of the formatter. - */ - #[Pure] - public function getDateType() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the timetype used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.gettimetype.php - * @return int The current date type value of the formatter. - */ - #[Pure] - public function getTimeType() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the calendar used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.getcalendar.php - * @return int The calendar being used by the formatter. - */ - #[Pure] - public function getCalendar() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * sets the calendar used to the appropriate calendar, which must be - * @link https://php.net/manual/en/intldateformatter.setcalendar.php - * @param int $calendar

- * The calendar to use. - * Default is IntlDateFormatter::GREGORIAN. - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setCalendar(#[TypeAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the timezone-id used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.gettimezoneid.php - * @return string ID string for the time zone used by this formatter. - */ - #[Pure] - public function getTimeZoneId() {} - - /** - * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
- * Get copy of formatter's calendar object - * @link https://secure.php.net/manual/en/intldateformatter.getcalendarobject.php - * @return IntlCalendar A copy of the internal calendar object used by this formatter. - */ - #[Pure] - public function getCalendarObject() {} - - /** - * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
- * Get formatter's timezone - * @link https://secure.php.net/manual/en/intldateformatter.gettimezone.php - * @return IntlTimeZone|false The associated IntlTimeZone object or FALSE on failure. - */ - #[Pure] - public function getTimeZone() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Sets the time zone to use - * @link https://php.net/manual/en/intldateformatter.settimezoneid.php - * @param string $zone

- * The time zone ID string of the time zone to use. - * If NULL or the empty string, the default time zone for the runtime is used. - *

- * @return bool TRUE on success or FALSE on failure. - * @removed 7.0 - * @see IntlDateFormatter::setTimeZone() - */ - #[Deprecated(replacement: "%class%->setTimeZone(%parametersList%)", since: "5.5")] - public function setTimeZoneId($zone) {} - - /** - * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
- * Sets formatter's timezone - * @link https://php.net/manual/en/intldateformatter.settimezone.php - * @param mixed $timezone

- * The timezone to use for this formatter. This can be specified in the - * following forms: - *

- *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setTimeZone($timezone) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set the pattern used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.setpattern.php - * @param string $pattern

- * New pattern string to use. - * Possible patterns are documented at http://userguide.icu-project.org/formatparse/datetime. - *

- * @return bool TRUE on success or FALSE on failure. - * Bad formatstrings are usually the cause of the failure. - */ - public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the pattern used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.getpattern.php - * @return string The pattern string being used to format/parse. - */ - #[Pure] - public function getPattern() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the locale used by formatter - * @link https://php.net/manual/en/intldateformatter.getlocale.php - * @param int $type [optional] - * @return string|false the locale of this formatter or 'false' if error - */ - #[Pure] - public function getLocale( - #[ElementAvailable(from: '8.0')] - #[TypeAware(['8.0' => 'int'], default: '')] - $type = null - ) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Set the leniency of the parser - * @link https://php.net/manual/en/intldateformatter.setlenient.php - * @param bool $lenient

- * Sets whether the parser is lenient or not, default is TRUE (lenient). - *

- * @return bool TRUE on success or FALSE on failure. - */ - public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the lenient used for the IntlDateFormatter - * @link https://php.net/manual/en/intldateformatter.islenient.php - * @return bool TRUE if parser is lenient, FALSE if parser is strict. By default the parser is lenient. - */ - #[Pure] - public function isLenient() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Format the date/time value as a string - * @link https://php.net/manual/en/intldateformatter.format.php - * @param mixed $datetime

- * Value to format. This may be a DateTime object, - * an integer representing a Unix timestamp value (seconds - * since epoch, UTC) or an array in the format output by - * localtime. - *

- * @return string|false The formatted string or, if an error occurred, FALSE. - */ - public function format($datetime = null, #[ElementAvailable(from: '5.3', to: '7.4')] $array = null) {} - - /** - * (PHP 5 >= 5.5.0, PECL intl >= 3.0.0)
- * Formats an object - * @link https://secure.php.net/manual/en/intldateformatter.formatobject.php - * @param object $datetime

- * An object of type {@link "https://secure.php.net/manual/en/class.intlcalendar.php" IntlCalendar} or {@link "https://secure.php.net/manual/en/class.datetime.php" DateTime}. The timezone information in the object will be used. - *

- * @param mixed $format [optional]

- * How to format the date/time. This can either be an {@link "https://secure.php.net/manual/en/language.types.array.php" array} with - * two elements (first the date style, then the time style, these being one - * of the constants IntlDateFormatter::NONE, - * IntlDateFormatter::SHORT, - * IntlDateFormatter::MEDIUM, - * IntlDateFormatter::LONG, - * IntlDateFormatter::FULL), a long with - * the value of one of these constants (in which case it will be used both - * for the time and the date) or a {@link "https://secure.php.net/manual/en/language.types.string.php" string} with the format - * described in {@link "http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details" the ICU documentation}. - * If NULL, the default style will be used. - *

- * @param string|null $locale [optional]

- * The locale to use, or NULL to use the {@link "https://secure.php.net/manual/en/intl.configuration.php#ini.intl.default-locale" default one}.

- * @return string|false A string with result or FALSE on failure. - */ - public static function formatObject($datetime, $format = null, #[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Parse string to a timestamp value - * @link https://php.net/manual/en/intldateformatter.parse.php - * @param string $string

- * string to convert to a time - *

- * @param int &$offset [optional]

- * Position at which to start the parsing in $value (zero-based). - * If no error occurs before $value is consumed, $parse_pos will contain -1 - * otherwise it will contain the position at which parsing ended (and the error occurred). - * This variable will contain the end position if the parse fails. - * If $parse_pos > strlen($value), the parse fails immediately. - *

- * @return int timestamp parsed value - */ - public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$offset = null) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Parse string to a field-based time value - * @link https://php.net/manual/en/intldateformatter.localtime.php - * @param string $string

- * string to convert to a time - *

- * @param int &$offset [optional]

- * Position at which to start the parsing in $value (zero-based). - * If no error occurs before $value is consumed, $parse_pos will contain -1 - * otherwise it will contain the position at which parsing ended . - * If $parse_pos > strlen($value), the parse fails immediately. - *

- * @return array Localtime compatible array of integers : contains 24 hour clock value in tm_hour field - */ - public function localtime(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$offset = null) {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the error code from last operation - * @link https://php.net/manual/en/intldateformatter.geterrorcode.php - * @return int The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
- * Get the error text from the last operation. - * @link https://php.net/manual/en/intldateformatter.geterrormessage.php - * @return string Description of the last error. - */ - #[Pure] - public function getErrorMessage() {} + public const SINGLE_SCRIPT_CONFUSABLE = 1; + public const MIXED_SCRIPT_CONFUSABLE = 2; + public const WHOLE_SCRIPT_CONFUSABLE = 4; + public const ANY_CASE = 8; + public const SINGLE_SCRIPT = 16; + public const INVISIBLE = 32; + public const CHAR_LIMIT = 64; + public const ASCII = 268435456; + public const HIGHLY_RESTRICTIVE = 805306368; + public const MODERATELY_RESTRICTIVE = 1073741824; + public const MINIMALLY_RESTRICTIVE = 1342177280; + public const UNRESTRICTIVE = 1610612736; + public const SINGLE_SCRIPT_RESTRICTIVE = 536870912; + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Constructor + * @link https://php.net/manual/en/spoofchecker.construct.php + */ + #[Pure] + public function __construct() {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Checks if a given text contains any suspicious characters + * @link https://php.net/manual/en/spoofchecker.issuspicious.php + * @param string $string

+ *

+ * @param string &$errorCode [optional]

+ *

+ * @return bool + */ + #[TentativeType] + public function isSuspicious(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$errorCode = null): bool {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Checks if a given text contains any confusable characters + * @link https://php.net/manual/en/spoofchecker.areconfusable.php + * @param string $string1

+ *

+ * @param string $string2

+ *

+ * @param string &$errorCode [optional]

+ *

+ * @return bool + */ + #[TentativeType] + public function areConfusable( + #[TypeAware(['8.0' => 'string'], default: '')] $string1, + #[TypeAware(['8.0' => 'string'], default: '')] $string2, + &$errorCode = null + ): bool {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Locales to use when running checks + * @link https://php.net/manual/en/spoofchecker.setallowedlocales.php + * @param string $locales

+ *

+ * @return void + */ + #[TentativeType] + public function setAllowedLocales(#[TypeAware(['8.0' => 'string'], default: '')] $locales): void {} + + /** + * (PHP >= 5.4.0, PECL intl >= 2.0.0)
+ * Set the checks to run + * @link https://php.net/manual/en/spoofchecker.setchecks.php + * @param int $checks

+ *

+ * @return void + */ + #[TentativeType] + public function setChecks(#[TypeAware(['8.0' => 'int'], default: '')] $checks): void {} + + #[TentativeType] + public function setRestrictionLevel(int $level): void {} } -class ResourceBundle implements IteratorAggregate, Countable +/** + * @since 5.5 + */ +class IntlGregorianCalendar extends IntlCalendar { - /** - * @link https://www.php.net/manual/en/resourcebundle.create.php - * @param string $locale

Locale for which the resources should be loaded (locale name, e.g. en_CA).

- * @param string $bundle

The directory where the data is stored or the name of the .dat file.

- * @param bool $fallback [optional]

Whether locale should match exactly or fallback to parent locale is allowed.

- */ - #[Pure] - public function __construct( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $bundle, - #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true - ) {} - - /** - * (PHP >= 5.3.2, PECL intl >= 2.0.0)
- * Create a resource bundle - * @link https://php.net/manual/en/resourcebundle.create.php - * @param string $locale

- * Locale for which the resources should be loaded (locale name, e.g. en_CA). - *

- * @param string $bundle

- * The directory where the data is stored or the name of the .dat file. - *

- * @param bool $fallback [optional]

- * Whether locale should match exactly or fallback to parent locale is allowed. - *

- * @return ResourceBundle|false ResourceBundle object or FALSE on error. - */ - public static function create( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $bundle, - #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true - ) {} - - /** - * (PHP >= 5.3.2, PECL intl >= 2.0.0)
- * Get data from the bundle - * @link https://php.net/manual/en/resourcebundle.get.php - * @param string|int $index

- * Data index, must be string or integer. - *

- * @param bool $fallback - * @return mixed the data located at the index or NULL on error. Strings, integers and binary data strings - * are returned as corresponding PHP types, integer array is returned as PHP array. Complex types are - * returned as ResourceBundle object. - */ - #[Pure] - public function get($index, #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true) {} - - /** - * (PHP >= 5.3.2, PECL intl >= 2.0.0)
- * Get number of elements in the bundle - * @link https://php.net/manual/en/resourcebundle.count.php - * @return int number of elements in the bundle. - */ - #[Pure] - public function count() {} - - /** - * (PHP >= 5.3.2, PECL intl >= 2.0.0)
- * Get supported locales - * @link https://php.net/manual/en/resourcebundle.locales.php - * @param string $bundle

- * Path of ResourceBundle for which to get available locales, or - * empty string for default locales list. - *

- * @return array the list of locales supported by the bundle. - */ - public static function getLocales(#[TypeAware(['8.0' => 'string'], default: '')] $bundle) {} - - /** - * (PHP >= 5.3.2, PECL intl >= 2.0.0)
- * Get bundle's last error code. - * @link https://php.net/manual/en/resourcebundle.geterrorcode.php - * @return int error code from last bundle object call. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP >= 5.3.2, PECL intl >= 2.0.0)
- * Get bundle's last error message. - * @link https://php.net/manual/en/resourcebundle.geterrormessage.php - * @return string error message from last bundle object's call. - */ - #[Pure] - public function getErrorMessage() {} - - /** - * @return Traversable - * @since 8.0 - */ - #[Pure] - public function getIterator() {} + /** + * @link https://www.php.net/manual/en/intlgregoriancalendar.construct + * @param int $timezoneOrYear [optional] + * @param int $localeOrMonth [optional] + * @param int $day [optional] + * @param int $hour [optional] + * @param int $minute [optional] + * @param int $second [optional] + */ + public function __construct($timezoneOrYear, $localeOrMonth, $day, $hour, $minute, $second) {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * @param mixed $timeZone + * @param string $locale + * @return IntlGregorianCalendar + */ + public static function createInstance($timeZone = null, $locale = null) {} + + /** + * @param float $timestamp + */ + #[TentativeType] + public function setGregorianChange(#[TypeAware(['8.0' => 'float'], default: '')] $timestamp): bool {} + + /** + * @return float + */ + #[Pure] + #[TentativeType] + public function getGregorianChange(): float {} + + /** + * @param int $year + * @return bool + */ + #[Pure] + #[TentativeType] + public function isLeapYear(#[TypeAware(['8.0' => 'int'], default: '')] $year): bool {} } /** - * @since 5.4 + * @since 5.5 */ -class Transliterator +class IntlCalendar { - public const FORWARD = 0; - public const REVERSE = 1; - - #[TypeAware(['8.1' => 'string'], default: '')] - public $id; - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Private constructor to deny instantiation - * @link https://php.net/manual/en/transliterator.construct.php - */ - final private function __construct() {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Create a transliterator - * @link https://php.net/manual/en/transliterator.create.php - * @param string $id

- * The id. - *

- * @param int $direction [optional]

- * The direction, defaults to - * Transliterator::FORWARD. - * May also be set to - * Transliterator::REVERSE. - *

- * @return Transliterator|null a Transliterator object on success, - * or NULL on failure. - */ - public static function create( - #[TypeAware(['8.0' => 'string'], default: '')] $id, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null - ) {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Create transliterator from rules - * @link https://php.net/manual/en/transliterator.createfromrules.php - * @param string $rules

- * The rules. - *

- * @param int $direction [optional]

- * The direction, defaults to - * {@see Transliterator::FORWARD}. - * May also be set to - * {@see Transliterator::REVERSE}. - *

- * @return Transliterator|null a Transliterator object on success, - * or NULL on failure. - */ - public static function createFromRules( - #[TypeAware(['8.0' => 'string'], default: '')] $rules, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null - ) {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Create an inverse transliterator - * @link https://php.net/manual/en/transliterator.createinverse.php - * @return Transliterator|null a Transliterator object on success, - * or NULL on failure - */ - #[Pure] - public function createInverse() {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Get transliterator IDs - * @link https://php.net/manual/en/transliterator.listids.php - * @return array An array of registered transliterator IDs on success, - * or FALSE on failure. - */ - public static function listIDs() {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Transliterate a string - * @link https://php.net/manual/en/transliterator.transliterate.php - * @param string $string

- * The string to be transformed. - *

- * @param int $start [optional]

- * The start index (in UTF-16 code units) from which the string will start - * to be transformed, inclusive. Indexing starts at 0. The text before will - * be left as is. - *

- * @param int $end [optional]

- * The end index (in UTF-16 code units) until which the string will be - * transformed, exclusive. Indexing starts at 0. The text after will be - * left as is. - *

- * @return string|false The transfomed string on success, or FALSE on failure. - */ - #[Pure] - public function transliterate( - #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $start = null, - #[TypeAware(['8.0' => 'int'], default: '')] $end = -1 - ) {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Get last error code - * @link https://php.net/manual/en/transliterator.geterrorcode.php - * @return int|false The error code on success, - * or FALSE if none exists, or on failure. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Get last error message - * @link https://php.net/manual/en/transliterator.geterrormessage.php - * @return string|false The error code on success, - * or FALSE if none exists, or on failure. - */ - #[Pure] - public function getErrorMessage() {} -} + /* Constants */ + public const FIELD_ERA = 0; + public const FIELD_YEAR = 1; + public const FIELD_MONTH = 2; + public const FIELD_WEEK_OF_YEAR = 3; + public const FIELD_WEEK_OF_MONTH = 4; + public const FIELD_DATE = 5; + public const FIELD_DAY_OF_YEAR = 6; + public const FIELD_DAY_OF_WEEK = 7; + public const FIELD_DAY_OF_WEEK_IN_MONTH = 8; + public const FIELD_AM_PM = 9; + public const FIELD_HOUR = 10; + public const FIELD_HOUR_OF_DAY = 11; + public const FIELD_MINUTE = 12; + public const FIELD_SECOND = 13; + public const FIELD_MILLISECOND = 14; + public const FIELD_ZONE_OFFSET = 15; + public const FIELD_DST_OFFSET = 16; + public const FIELD_YEAR_WOY = 17; + public const FIELD_DOW_LOCAL = 18; + public const FIELD_EXTENDED_YEAR = 19; + public const FIELD_JULIAN_DAY = 20; + public const FIELD_MILLISECONDS_IN_DAY = 21; + public const FIELD_IS_LEAP_MONTH = 22; + public const FIELD_FIELD_COUNT = 23; + public const FIELD_DAY_OF_MONTH = 5; + public const DOW_SUNDAY = 1; + public const DOW_MONDAY = 2; + public const DOW_TUESDAY = 3; + public const DOW_WEDNESDAY = 4; + public const DOW_THURSDAY = 5; + public const DOW_FRIDAY = 6; + public const DOW_SATURDAY = 7; + public const DOW_TYPE_WEEKDAY = 0; + public const DOW_TYPE_WEEKEND = 1; + public const DOW_TYPE_WEEKEND_OFFSET = 2; + public const DOW_TYPE_WEEKEND_CEASE = 3; + public const WALLTIME_FIRST = 1; + public const WALLTIME_LAST = 0; + public const WALLTIME_NEXT_VALID = 2; + + /* Methods */ + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Add a (signed) amount of time to a field + * @link https://secure.php.net/manual/en/intlcalendar.add.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. + * These are integer values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @param int $value

The signed amount to add to the current field. If the amount is positive, the instant will be moved forward; if it is negative, the instant wil be moved into the past. The unit is implicit to the field type. + * For instance, hours for IntlCalendar::FIELD_HOUR_OF_DAY.

+ * @return bool Returns TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function add( + #[TypeAware(['8.0' => 'int'], default: '')] $field, + #[TypeAware(['8.0' => 'int'], default: '')] $value + ): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether this object's time is after that of the passed object + * https://secure.php.net/manual/en/intlcalendar.after.php + * @param IntlCalendar $other

The calendar whose time will be checked against this object's time.

+ * @return bool + * Returns TRUE if this object's current time is after that of the + * calendar argument's time. Returns FALSE otherwise. + * Also returns FALSE on failure. You can use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or + * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to detect error conditions. + */ + #[Pure] + #[TentativeType] + public function after(IntlCalendar $other): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether this object's time is before that of the passed object + * @link https://secure.php.net/manual/en/intlcalendar.before.php + * @param IntlCalendar $other

The calendar whose time will be checked against this object's time.

+ * @return bool + * Returns TRUE if this object's current time is before that of the + * calendar argument's time. Returns FALSE otherwise. + * Also returns FALSE on failure. You can use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or + * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to detect error conditions. + */ + #[Pure] + #[TentativeType] + public function before(IntlCalendar $other): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Clear a field or all fields + * @link https://secure.php.net/manual/en/intlcalendar.clear.php + * @param int $field [optional]

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return bool Returns TRUE on success or FALSE on failure. Failure can only occur is invalid arguments are provided. + */ + public function clear(#[TypeAware(['8.0' => 'int|null'], default: '')] $field = null) {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Private constructor for disallowing instantiation + * @link https://secure.php.net/manual/en/intlcalendar.construct.php + */ + private function __construct() {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Create a new IntlCalendar + * @link https://secure.php.net/manual/en/intlcalendar.createinstance.php + * @param mixed $timezone [optional]

+ * The timezone to use. + *

+ * + * + *

+ * @param string|null $locale [optional]

+ * A locale to use or NULL to use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.default-locale the default locale}. + *

+ * @return IntlCalendar|null + * The created {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} instance or NULL on + * failure. + */ + #[TentativeType] + public static function createInstance($timezone = null, #[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlCalendar {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Compare time of two IntlCalendar objects for equality + * @link https://secure.php.net/manual/en/intlcalendar.equals.php + * @param IntlCalendar $other + * @return bool

+ * Returns TRUE if the current time of both this and the passed in + * {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} object are the same, or FALSE + * otherwise. The value FALSE can also be returned on failure. This can only + * happen if bad arguments are passed in. In any case, the two cases can be + * distinguished by calling {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()}. + *

+ */ + #[Pure] + #[TentativeType] + public function equals(#[TypeAware(['8.0' => 'IntlCalendar'], default: '')] $other): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Calculate difference between given time and this object's time + * @link https://secure.php.net/manual/en/intlcalendar.fielddifference.php + * @param float $timestamp

+ * The time against which to compare the quantity represented by the + * field. For the result to be positive, the time + * given for this parameter must be ahead of the time of the object the + * method is being invoked on. + *

+ * @param int $field

+ * The field that represents the quantity being compared. + *

+ * + *

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int Returns a (signed) difference of time in the unit associated with the + * specified field or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function fieldDifference( + #[TypeAware(['8.0' => 'float'], default: '')] $timestamp, + #[TypeAware(['8.0' => 'int'], default: '')] $field + ): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
+ * Create an IntlCalendar from a DateTime object or string + * @link https://secure.php.net/manual/en/intlcalendar.fromdatetime.php + * @param mixed $datetime

+ * A {@link https://secure.php.net/manual/en/class.datetime.php DateTime} object or a {@link https://secure.php.net/manual/en/language.types.string.php string} that + * can be passed to {@link https://secure.php.net/manual/en/datetime.construct.php DateTime::__construct()}. + *

+ * @param $locale [optional] + * @return IntlCalendar|null + * The created {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} object or NULL in case of + * failure. If a {@link https://secure.php.net/manual/en/language.types.string.php string} is passed, any exception that occurs + * inside the {@link https://secure.php.net/manual/en/class.datetime.php DateTime} constructor is propagated. + */ + #[TentativeType] + public static function fromDateTime( + #[TypeAware(['8.0' => 'DateTime|string'], default: '')] $datetime, + #[TypeAware(['8.0' => 'string|null'], default: '')] #[ElementAvailable(from: '8.0')] $locale + ): ?IntlCalendar {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the value for a field + * @link https://secure.php.net/manual/en/intlcalendar.get.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int An integer with the value of the time field. + */ + #[Pure] + #[TentativeType] + public function get(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * The maximum value for a field, considering the object's current time + * @link https://secure.php.net/manual/en/intlcalendar.getactualmaximum.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int + * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing the maximum value in the units associated + * with the given field or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getActualMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * The minimum value for a field, considering the object's current time + * @link https://secure.php.net/manual/en/intlcalendar.getactualminimum.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. + * These are integer values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int + * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing the minimum value in the field's + * unit or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getActualMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get array of locales for which there is data + * @link https://secure.php.net/manual/en/intlcalendar.getavailablelocales.php + * @return string[] An array of strings, one for which locale. + */ + #[TentativeType] + public static function getAvailableLocales(): array {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Tell whether a day is a weekday, weekend or a day that has a transition between the two + * @param int $dayOfWeek

+ * One of the constants IntlCalendar::DOW_SUNDAY, + * IntlCalendar::DOW_MONDAY, ..., + * IntlCalendar::DOW_SATURDAY. + *

+ * @return int|false + * Returns one of the constants + * IntlCalendar::DOW_TYPE_WEEKDAY, + * IntlCalendar::DOW_TYPE_WEEKEND, + * IntlCalendar::DOW_TYPE_WEEKEND_OFFSET or + * IntlCalendar::DOW_TYPE_WEEKEND_CEASE or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getDayOfWeekType(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get last error code on the object + * @link https://secure.php.net/manual/en/intlcalendar.geterrorcode.php + * @return int|false An ICU error code indicating either success, failure or a warning. + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get last error message on the object + * @link https://secure.php.net/manual/en/intlcalendar.geterrormessage.php + * @return string|false The error message associated with last error that occurred in a function call on this object, or a string indicating the non-existance of an error. + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the first day of the week for the calendar's locale + * @link https://secure.php.net/manual/en/intlcalendar.getfirstdayofweek.php + * @return int|false + * One of the constants IntlCalendar::DOW_SUNDAY, + * IntlCalendar::DOW_MONDAY, ..., + * IntlCalendar::DOW_SATURDAY or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getFirstDayOfWeek(): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the largest local minimum value for a field + * @link https://secure.php.net/manual/en/intlcalendar.getgreatestminimum.php + * @param int $field + * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + * @return int|false + * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing a field value, in the field's + * unit, or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getGreatestMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get set of locale keyword values + * @param string $keyword

+ * The locale keyword for which relevant values are to be queried. Only + * 'calendar' is supported. + *

+ * @param string $locale

+ * The locale onto which the keyword/value pair are to be appended. + *

+ * @param bool $onlyCommon + *

+ * Whether to show only the values commonly used for the specified locale. + *

+ * @return Iterator|false An iterator that yields strings with the locale keyword values or FALSE on failure. + */ + #[TentativeType] + public static function getKeywordValuesForLocale( + #[TypeAware(['8.0' => 'string'], default: '')] $keyword, + #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[TypeAware(['8.0' => 'bool'], default: '')] $onlyCommon + ): IntlIterator|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the smallest local maximum for a field + * @link https://secure.php.net/manual/en/intlcalendar.getleastmaximum.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int|false + * An {@link https://secure.php.net/manual/en/language.types.integer.ph int} representing a field value in the field's + * unit or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getLeastMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the locale associated with the object + * @link https://secure.php.net/manual/en/intlcalendar.getlocale.php + * @param int $type

+ * Whether to fetch the actual locale (the locale from which the calendar + * data originates, with Locale::ACTUAL_LOCALE) or the + * valid locale, i.e., the most specific locale supported by ICU relatively + * to the requested locale – see Locale::VALID_LOCALE. + * From the most general to the most specific, the locales are ordered in + * this fashion – actual locale, valid locale, requested locale. + *

+ * @return string + */ + #[Pure] + #[TentativeType] + public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the global maximum value for a field + * @link https://secure.php.net/manual/en/intlcalendar.getmaximum.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int|false + */ + #[Pure] + #[TentativeType] + public function getMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get minimal number of days the first week in a year or month can have + * @link https://secure.php.net/manual/en/intlcalendar.getminimaldaysinfirstweek.php + * @return int|false + * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing a number of days or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getMinimalDaysInFirstWeek(): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the global minimum value for a field + * @link https://secure.php.net/manual/en/intlcalendar.getminimum.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return int|false + * An int representing a value for the given field in the field's unit or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get number representing the current time + * @return float A float representing a number of milliseconds since the epoch, not counting leap seconds. + */ + #[TentativeType] + public static function getNow(): float {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get behavior for handling repeating wall time + * @link https://secure.php.net/manual/en/intlcalendar.getrepeatedwalltimeoption.php + * @return int + * One of the constants IntlCalendar::WALLTIME_FIRST or + * IntlCalendar::WALLTIME_LAST. + */ + #[Pure] + #[TentativeType] + public function getRepeatedWallTimeOption(): int {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get behavior for handling skipped wall time + * @link https://secure.php.net/manual/en/intlcalendar.getskippedwalltimeoption.php + * @return int + * One of the constants IntlCalendar::WALLTIME_FIRST, + * IntlCalendar::WALLTIME_LAST or + * IntlCalendar::WALLTIME_NEXT_VALID. + */ + #[Pure] + #[TentativeType] + public function getSkippedWallTimeOption(): int {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get time currently represented by the object + * @return float|false + * A {@link https://secure.php.net/manual/en/language.types.float.php float} representing the number of milliseconds elapsed since the + * reference time (1 Jan 1970 00:00:00 UTC). + */ + #[Pure] + #[TentativeType] + public function getTime(): float|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the object's timezone + * @link https://secure.php.net/manual/en/intlcalendar.gettimezone.php + * @return IntlTimeZone|false + * An {@link https://secure.php.net/manual/en/class.intltimezone.php IntlTimeZone} object corresponding to the one used + * internally in this object. + */ + #[Pure] + #[TentativeType] + public function getTimeZone(): IntlTimeZone|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the calendar type + * @link https://secure.php.net/manual/en/intlcalendar.gettype.php + * @return string + * A {@link https://secure.php.net/manual/en/language.types.string.php string} representing the calendar type, such as + * 'gregorian', 'islamic', etc. + */ + #[Pure] + #[TentativeType] + public function getType(): string {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get time of the day at which weekend begins or ends + * @link https://secure.php.net/manual/en/intlcalendar.getweekendtransition.php + * @param string $dayOfWeek

+ * One of the constants IntlCalendar::DOW_SUNDAY, + * IntlCalendar::DOW_MONDAY, ..., + * IntlCalendar::DOW_SATURDAY. + *

+ * @return int|false + * The number of milliseconds into the day at which the the weekend begins or + * ends or FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function getWeekendTransition(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether the object's time is in Daylight Savings Time + * @link https://secure.php.net/manual/en/intlcalendar.indaylighttime.php + * @return bool + * Returns TRUE if the date is in Daylight Savings Time, FALSE otherwise. + * The value FALSE may also be returned on failure, for instance after + * specifying invalid field values on non-lenient mode; use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or query + * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to disambiguate. + */ + #[Pure] + #[TentativeType] + public function inDaylightTime(): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether another calendar is equal but for a different time + * @link https://secure.php.net/manual/en/intlcalendar.isequivalentto.php + * @param IntlCalendar $other The other calendar against which the comparison is to be made. + * @return bool + * Assuming there are no argument errors, returns TRUE iif the calendars are equivalent except possibly for their set time. + */ + #[Pure] + #[TentativeType] + public function isEquivalentTo(IntlCalendar $other): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether date/time interpretation is in lenient mode + * @link https://secure.php.net/manual/en/intlcalendar.islenient.php + * @return bool + * A {@link https://secure.php.net/manual/en/language.types.boolean.php bool} representing whether the calendar is set to lenient mode. + */ + #[Pure] + #[TentativeType] + public function isLenient(): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether a certain date/time is in the weekend + * @link https://secure.php.net/manual/en/intlcalendar.isweekend.php + * @param float|null $timestamp [optional]

+ * An optional timestamp representing the number of milliseconds since the + * epoch, excluding leap seconds. If NULL, this object's current time is + * used instead. + *

+ * @return bool + *

A {@link https://secure.php.net/manual/en/language.types.boolean.php bool} indicating whether the given or this object's time occurs + * in a weekend. + *

+ *

+ * The value FALSE may also be returned on failure, for instance after giving + * a date out of bounds on non-lenient mode; use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or query + * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to disambiguate.

+ */ + #[Pure] + #[TentativeType] + public function isWeekend(#[TypeAware(['8.0' => 'float|null'], default: '')] $timestamp = null): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Add value to field without carrying into more significant fields + * @link https://secure.php.net/manual/en/intlcalendar.roll.php + * @param int $field + *

One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time + * {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @param mixed $value

+ * The (signed) amount to add to the field, TRUE for rolling up (adding + * 1), or FALSE for rolling down (subtracting + * 1). + *

+ * @return bool Returns TRUE on success or FALSE on failure. + */ + #[TentativeType] + public function roll(#[TypeAware(['8.0' => 'int'], default: '')] $field, $value): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Whether a field is set + * @link https://secure.php.net/manual/en/intlcalendar.isset.php + * @param int $field

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time + * {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. + * These are integer values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @return bool Assuming there are no argument errors, returns TRUE iif the field is set. + */ + #[TentativeType] + public function PS_UNRESERVE_PREFIX_isSet(#[TypeAware(['8.0' => 'int'], default: '')] $field): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set a time field or several common fields at once + * @link https://secure.php.net/manual/en/intlcalendar.set.php + * @param int $year

+ * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer + * values between 0 and + * IntlCalendar::FIELD_COUNT. + *

+ * @param int $month

+ * The new value for IntlCalendar::FIELD_MONTH. + *

+ * @param int $dayOfMonth [optional]

+ * The new value for IntlCalendar::FIELD_DAY_OF_MONTH. + * The month sequence is zero-based, i.e., January is represented by 0, + * February by 1, ..., December is 11 and Undecember (if the calendar has + * it) is 12. + *

+ * @param int $hour [optional] + *

+ * The new value for IntlCalendar::FIELD_HOUR_OF_DAY. + *

+ * @param int $minute [optional] + *

+ * The new value for IntlCalendar::FIELD_MINUTE. + *

+ * @param int $second [optional]

+ * The new value for IntlCalendar::FIELD_SECOND. + *

+ * @return bool Returns TRUE on success and FALSE on failure. + */ + public function set($year, $month, $dayOfMonth = null, $hour = null, $minute = null, $second = null) {} + + /** + * (PHP 5 >= 5.5.0 PECL intl >= 3.0.0a1)
+ * Set a time field or several common fields at once + * @link https://secure.php.net/manual/en/intlcalendar.set.php + * @param int $field One of the IntlCalendar date/time field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT. + * @param int $value The new value of the given field. + * @return bool Returns TRUE on success and FALSE on failure. + * @since 5.5 + */ + public function set($field, $value) {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set the day on which the week is deemed to start + * @link https://secure.php.net/manual/en/intlcalendar.setfirstdayofweek.php + * @param int $dayOfWeek

+ * One of the constants IntlCalendar::DOW_SUNDAY, + * IntlCalendar::DOW_MONDAY, ..., + * IntlCalendar::DOW_SATURDAY. + *

+ * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. + */ + public function setFirstDayOfWeek(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek) {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set whether date/time interpretation is to be lenient + * @link https://secure.php.net/manual/en/intlcalendar.setlenient.php + * @param bool $lenient

+ * Use TRUE to activate the lenient mode; FALSE otherwise. + *

+ * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. + */ + public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient) {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set behavior for handling repeating wall times at negative timezone offset transitions + * @link https://secure.php.net/manual/en/intlcalendar.setrepeatedwalltimeoption.php + * @param int $option

+ * One of the constants IntlCalendar::WALLTIME_FIRST or + * IntlCalendar::WALLTIME_LAST. + *

+ * @return bool + * Returns TRUE on success. Failure can only happen due to invalid parameters. + */ + public function setRepeatedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: '')] $option) {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set behavior for handling skipped wall times at positive timezone offset transitions + * @link https://secure.php.net/manual/en/intlcalendar.setskippedwalltimeoption.php + * @param int $option

+ * One of the constants IntlCalendar::WALLTIME_FIRST, + * IntlCalendar::WALLTIME_LAST or + * IntlCalendar::WALLTIME_NEXT_VALID. + *

+ * @return bool + *

+ * Returns TRUE on success. Failure can only happen due to invalid parameters. + *

+ */ + public function setSkippedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: '')] $option) {} -/** - * @link https://php.net/manual/en/class.spoofchecker.php - */ -class Spoofchecker -{ - public const SINGLE_SCRIPT_CONFUSABLE = 1; - public const MIXED_SCRIPT_CONFUSABLE = 2; - public const WHOLE_SCRIPT_CONFUSABLE = 4; - public const ANY_CASE = 8; - public const SINGLE_SCRIPT = 16; - public const INVISIBLE = 32; - public const CHAR_LIMIT = 64; - public const ASCII = 268435456; - public const HIGHLY_RESTRICTIVE = 805306368; - public const MODERATELY_RESTRICTIVE = 1073741824; - public const MINIMALLY_RESTRICTIVE = 1342177280; - public const UNRESTRICTIVE = 1610612736; - public const SINGLE_SCRIPT_RESTRICTIVE = 536870912; - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Constructor - * @link https://php.net/manual/en/spoofchecker.construct.php - */ - #[Pure] - public function __construct() {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Checks if a given text contains any suspicious characters - * @link https://php.net/manual/en/spoofchecker.issuspicious.php - * @param string $string

- *

- * @param string &$errorCode [optional]

- *

- * @return bool - */ - public function isSuspicious(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$errorCode = null) {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Checks if a given text contains any confusable characters - * @link https://php.net/manual/en/spoofchecker.areconfusable.php - * @param string $string1

- *

- * @param string $string2

- *

- * @param string &$errorCode [optional]

- *

- * @return bool - */ - public function areConfusable( - #[TypeAware(['8.0' => 'string'], default: '')] $string1, - #[TypeAware(['8.0' => 'string'], default: '')] $string2, - &$errorCode = null - ) {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Locales to use when running checks - * @link https://php.net/manual/en/spoofchecker.setallowedlocales.php - * @param string $locales

- *

- * @return void - */ - public function setAllowedLocales(#[TypeAware(['8.0' => 'string'], default: '')] $locales) {} - - /** - * (PHP >= 5.4.0, PECL intl >= 2.0.0)
- * Set the checks to run - * @link https://php.net/manual/en/spoofchecker.setchecks.php - * @param int $checks

- *

- * @return void - */ - public function setChecks(#[TypeAware(['8.0' => 'int'], default: '')] $checks) {} - - public function setRestrictionLevel(int $level) {} -} + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set the calendar time in milliseconds since the epoch + * @link https://secure.php.net/manual/en/intlcalendar.settime.php + * @param float $timestamp

+ * An instant represented by the number of number of milliseconds between + * such instant and the epoch, ignoring leap seconds. + *

+ * @return bool + * Returns TRUE on success and FALSE on failure. + */ + #[TentativeType] + public function setTime(#[TypeAware(['8.0' => 'float'], default: '')] $timestamp): bool {} -/** - * @since 5.5 - */ -class IntlGregorianCalendar extends IntlCalendar -{ - /** - * @link https://www.php.net/manual/en/intlgregoriancalendar.construct - * @param int $timezoneOrYear [optional] - * @param int $localeOrMonth [optional] - * @param int $day [optional] - * @param int $hour [optional] - * @param int $minute [optional] - * @param int $second [optional] - */ - public function __construct($timezoneOrYear, $localeOrMonth, $day, $hour, $minute, $second) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * @param mixed $timeZone - * @param string $locale - * @return IntlGregorianCalendar - */ - public static function createInstance($timeZone = null, $locale = null) {} - - /** - * @param float $timestamp - */ - public function setGregorianChange(#[TypeAware(['8.0' => 'float'], default: '')] $timestamp) {} - - /** - * @return float - */ - #[Pure] - public function getGregorianChange() {} - - /** - * @param int $year - * @return bool - */ - #[Pure] - public function isLeapYear(#[TypeAware(['8.0' => 'int'], default: '')] $year) {} -} + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Set the timezone used by this calendar + * @link https://secure.php.net/manual/en/intlcalendar.settimezone.php + * @param mixed $timezone

+ * The new timezone to be used by this calendar. It can be specified in the + * following ways: + * + *

+ * @return bool Returns TRUE on success and FALSE on failure. + */ + #[TentativeType] + public function setTimeZone($timezone): bool {} -/** - * @since 5.5 - */ -class IntlCalendar -{ - /* Constants */ - public const FIELD_ERA = 0; - public const FIELD_YEAR = 1; - public const FIELD_MONTH = 2; - public const FIELD_WEEK_OF_YEAR = 3; - public const FIELD_WEEK_OF_MONTH = 4; - public const FIELD_DATE = 5; - public const FIELD_DAY_OF_YEAR = 6; - public const FIELD_DAY_OF_WEEK = 7; - public const FIELD_DAY_OF_WEEK_IN_MONTH = 8; - public const FIELD_AM_PM = 9; - public const FIELD_HOUR = 10; - public const FIELD_HOUR_OF_DAY = 11; - public const FIELD_MINUTE = 12; - public const FIELD_SECOND = 13; - public const FIELD_MILLISECOND = 14; - public const FIELD_ZONE_OFFSET = 15; - public const FIELD_DST_OFFSET = 16; - public const FIELD_YEAR_WOY = 17; - public const FIELD_DOW_LOCAL = 18; - public const FIELD_EXTENDED_YEAR = 19; - public const FIELD_JULIAN_DAY = 20; - public const FIELD_MILLISECONDS_IN_DAY = 21; - public const FIELD_IS_LEAP_MONTH = 22; - public const FIELD_FIELD_COUNT = 23; - public const FIELD_DAY_OF_MONTH = 5; - public const DOW_SUNDAY = 1; - public const DOW_MONDAY = 2; - public const DOW_TUESDAY = 3; - public const DOW_WEDNESDAY = 4; - public const DOW_THURSDAY = 5; - public const DOW_FRIDAY = 6; - public const DOW_SATURDAY = 7; - public const DOW_TYPE_WEEKDAY = 0; - public const DOW_TYPE_WEEKEND = 1; - public const DOW_TYPE_WEEKEND_OFFSET = 2; - public const DOW_TYPE_WEEKEND_CEASE = 3; - public const WALLTIME_FIRST = 1; - public const WALLTIME_LAST = 0; - public const WALLTIME_NEXT_VALID = 2; - - /* Methods */ - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Add a (signed) amount of time to a field - * @link https://secure.php.net/manual/en/intlcalendar.add.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. - * These are integer values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @param int $value

The signed amount to add to the current field. If the amount is positive, the instant will be moved forward; if it is negative, the instant wil be moved into the past. The unit is implicit to the field type. - * For instance, hours for IntlCalendar::FIELD_HOUR_OF_DAY.

- * @return bool Returns TRUE on success or FALSE on failure. - */ - public function add( - #[TypeAware(['8.0' => 'int'], default: '')] $field, - #[TypeAware(['8.0' => 'int'], default: '')] $value - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether this object's time is after that of the passed object - * https://secure.php.net/manual/en/intlcalendar.after.php - * @param IntlCalendar $other

The calendar whose time will be checked against this object's time.

- * @return bool - * Returns TRUE if this object's current time is after that of the - * calendar argument's time. Returns FALSE otherwise. - * Also returns FALSE on failure. You can use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or - * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to detect error conditions. - */ - #[Pure] - public function after(IntlCalendar $other) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether this object's time is before that of the passed object - * @link https://secure.php.net/manual/en/intlcalendar.before.php - * @param IntlCalendar $other

The calendar whose time will be checked against this object's time.

- * @return bool - * Returns TRUE if this object's current time is before that of the - * calendar argument's time. Returns FALSE otherwise. - * Also returns FALSE on failure. You can use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or - * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to detect error conditions. - */ - #[Pure] - public function before(IntlCalendar $other) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Clear a field or all fields - * @link https://secure.php.net/manual/en/intlcalendar.clear.php - * @param int $field [optional]

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return bool Returns TRUE on success or FALSE on failure. Failure can only occur is invalid arguments are provided. - */ - public function clear(#[TypeAware(['8.0' => 'int|null'], default: '')] $field = null) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Private constructor for disallowing instantiation - * @link https://secure.php.net/manual/en/intlcalendar.construct.php - */ - private function __construct() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Create a new IntlCalendar - * @link https://secure.php.net/manual/en/intlcalendar.createinstance.php - * @param mixed $timezone [optional]

- * The timezone to use. - *

- * - * - *

- * @param string|null $locale [optional]

- * A locale to use or NULL to use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.default-locale the default locale}. - *

- * @return IntlCalendar|null - * The created {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} instance or NULL on - * failure. - */ - public static function createInstance($timezone = null, #[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Compare time of two IntlCalendar objects for equality - * @link https://secure.php.net/manual/en/intlcalendar.equals.php - * @param IntlCalendar $other - * @return bool

- * Returns TRUE if the current time of both this and the passed in - * {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} object are the same, or FALSE - * otherwise. The value FALSE can also be returned on failure. This can only - * happen if bad arguments are passed in. In any case, the two cases can be - * distinguished by calling {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()}. - *

- */ - #[Pure] - public function equals(#[TypeAware(['8.0' => 'IntlCalendar'], default: '')] $other) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Calculate difference between given time and this object's time - * @link https://secure.php.net/manual/en/intlcalendar.fielddifference.php - * @param float $timestamp

- * The time against which to compare the quantity represented by the - * field. For the result to be positive, the time - * given for this parameter must be ahead of the time of the object the - * method is being invoked on. - *

- * @param int $field

- * The field that represents the quantity being compared. - *

- * - *

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int Returns a (signed) difference of time in the unit associated with the - * specified field or FALSE on failure. - */ - #[Pure] - public function fieldDifference( - #[TypeAware(['8.0' => 'float'], default: '')] $timestamp, - #[TypeAware(['8.0' => 'int'], default: '')] $field - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
- * Create an IntlCalendar from a DateTime object or string - * @link https://secure.php.net/manual/en/intlcalendar.fromdatetime.php - * @param mixed $datetime

- * A {@link https://secure.php.net/manual/en/class.datetime.php DateTime} object or a {@link https://secure.php.net/manual/en/language.types.string.php string} that - * can be passed to {@link https://secure.php.net/manual/en/datetime.construct.php DateTime::__construct()}. - *

- * @param $locale [optional] - * @return IntlCalendar|null - * The created {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} object or NULL in case of - * failure. If a {@link https://secure.php.net/manual/en/language.types.string.php string} is passed, any exception that occurs - * inside the {@link https://secure.php.net/manual/en/class.datetime.php DateTime} constructor is propagated. - */ - public static function fromDateTime( - #[TypeAware(['8.0' => 'DateTime|string'], default: '')] $datetime, - #[TypeAware(['8.0' => 'string|null'], default: '')] #[ElementAvailable(from: '8.0')] $locale - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the value for a field - * @link https://secure.php.net/manual/en/intlcalendar.get.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int An integer with the value of the time field. - */ - #[Pure] - public function get(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * The maximum value for a field, considering the object's current time - * @link https://secure.php.net/manual/en/intlcalendar.getactualmaximum.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int - * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing the maximum value in the units associated - * with the given field or FALSE on failure. - */ - #[Pure] - public function getActualMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * The minimum value for a field, considering the object's current time - * @link https://secure.php.net/manual/en/intlcalendar.getactualminimum.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. - * These are integer values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int - * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing the minimum value in the field's - * unit or FALSE on failure. - */ - #[Pure] - public function getActualMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get array of locales for which there is data - * @link https://secure.php.net/manual/en/intlcalendar.getavailablelocales.php - * @return string[] An array of strings, one for which locale. - */ - public static function getAvailableLocales() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Tell whether a day is a weekday, weekend or a day that has a transition between the two - * @param int $dayOfWeek

- * One of the constants IntlCalendar::DOW_SUNDAY, - * IntlCalendar::DOW_MONDAY, ..., - * IntlCalendar::DOW_SATURDAY. - *

- * @return int - * Returns one of the constants - * IntlCalendar::DOW_TYPE_WEEKDAY, - * IntlCalendar::DOW_TYPE_WEEKEND, - * IntlCalendar::DOW_TYPE_WEEKEND_OFFSET or - * IntlCalendar::DOW_TYPE_WEEKEND_CEASE or FALSE on failure. - */ - #[Pure] - public function getDayOfWeekType(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get last error code on the object - * @link https://secure.php.net/manual/en/intlcalendar.geterrorcode.php - * @return int An ICU error code indicating either success, failure or a warning. - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get last error message on the object - * @link https://secure.php.net/manual/en/intlcalendar.geterrormessage.php - * @return string The error message associated with last error that occurred in a function call on this object, or a string indicating the non-existance of an error. - */ - #[Pure] - public function getErrorMessage() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the first day of the week for the calendar's locale - * @link https://secure.php.net/manual/en/intlcalendar.getfirstdayofweek.php - * @return int - * One of the constants IntlCalendar::DOW_SUNDAY, - * IntlCalendar::DOW_MONDAY, ..., - * IntlCalendar::DOW_SATURDAY or FALSE on failure. - */ - #[Pure] - public function getFirstDayOfWeek() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the largest local minimum value for a field - * @link https://secure.php.net/manual/en/intlcalendar.getgreatestminimum.php - * @param int $field - * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - * @return int - * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing a field value, in the field's - * unit, or FALSE on failure. - */ - #[Pure] - public function getGreatestMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get set of locale keyword values - * @param string $keyword

- * The locale keyword for which relevant values are to be queried. Only - * 'calendar' is supported. - *

- * @param string $locale

- * The locale onto which the keyword/value pair are to be appended. - *

- * @param bool $onlyCommon - *

- * Whether to show only the values commonly used for the specified locale. - *

- * @return Iterator|false An iterator that yields strings with the locale keyword values or FALSE on failure. - */ - public static function getKeywordValuesForLocale( - #[TypeAware(['8.0' => 'string'], default: '')] $keyword, - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'bool'], default: '')] $onlyCommon - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the smallest local maximum for a field - * @link https://secure.php.net/manual/en/intlcalendar.getleastmaximum.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int - * An {@link https://secure.php.net/manual/en/language.types.integer.ph int} representing a field value in the field's - * unit or FALSE on failure. - */ - #[Pure] - public function getLeastMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the locale associated with the object - * @link https://secure.php.net/manual/en/intlcalendar.getlocale.php - * @param int $type

- * Whether to fetch the actual locale (the locale from which the calendar - * data originates, with Locale::ACTUAL_LOCALE) or the - * valid locale, i.e., the most specific locale supported by ICU relatively - * to the requested locale – see Locale::VALID_LOCALE. - * From the most general to the most specific, the locales are ordered in - * this fashion – actual locale, valid locale, requested locale. - *

- * @return string - */ - #[Pure] - public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the global maximum value for a field - * @link https://secure.php.net/manual/en/intlcalendar.getmaximum.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int - */ - #[Pure] - public function getMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get minimal number of days the first week in a year or month can have - * @link https://secure.php.net/manual/en/intlcalendar.getminimaldaysinfirstweek.php - * @return int - * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing a number of days or FALSE on failure. - */ - #[Pure] - public function getMinimalDaysInFirstWeek() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the global minimum value for a field - * @link https://secure.php.net/manual/en/intlcalendar.getminimum.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return int - * An int representing a value for the given field in the field's unit or FALSE on failure. - */ - #[Pure] - public function getMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get number representing the current time - * @return float A float representing a number of milliseconds since the epoch, not counting leap seconds. - */ - public static function getNow() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get behavior for handling repeating wall time - * @link https://secure.php.net/manual/en/intlcalendar.getrepeatedwalltimeoption.php - * @return int - * One of the constants IntlCalendar::WALLTIME_FIRST or - * IntlCalendar::WALLTIME_LAST. - */ - #[Pure] - public function getRepeatedWallTimeOption() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get behavior for handling skipped wall time - * @link https://secure.php.net/manual/en/intlcalendar.getskippedwalltimeoption.php - * @return int - * One of the constants IntlCalendar::WALLTIME_FIRST, - * IntlCalendar::WALLTIME_LAST or - * IntlCalendar::WALLTIME_NEXT_VALID. - */ - #[Pure] - public function getSkippedWallTimeOption() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get time currently represented by the object - * @return float - * A {@link https://secure.php.net/manual/en/language.types.float.php float} representing the number of milliseconds elapsed since the - * reference time (1 Jan 1970 00:00:00 UTC). - */ - #[Pure] - public function getTime() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the object's timezone - * @link https://secure.php.net/manual/en/intlcalendar.gettimezone.php - * @return IntlTimeZone - * An {@link https://secure.php.net/manual/en/class.intltimezone.php IntlTimeZone} object corresponding to the one used - * internally in this object. - */ - #[Pure] - public function getTimeZone() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the calendar type - * @link https://secure.php.net/manual/en/intlcalendar.gettype.php - * @return string - * A {@link https://secure.php.net/manual/en/language.types.string.php string} representing the calendar type, such as - * 'gregorian', 'islamic', etc. - */ - #[Pure] - public function getType() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get time of the day at which weekend begins or ends - * @link https://secure.php.net/manual/en/intlcalendar.getweekendtransition.php - * @param string $dayOfWeek

- * One of the constants IntlCalendar::DOW_SUNDAY, - * IntlCalendar::DOW_MONDAY, ..., - * IntlCalendar::DOW_SATURDAY. - *

- * @return int - * The number of milliseconds into the day at which the the weekend begins or - * ends or FALSE on failure. - */ - #[Pure] - public function getWeekendTransition(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether the object's time is in Daylight Savings Time - * @link https://secure.php.net/manual/en/intlcalendar.indaylighttime.php - * @return bool - * Returns TRUE if the date is in Daylight Savings Time, FALSE otherwise. - * The value FALSE may also be returned on failure, for instance after - * specifying invalid field values on non-lenient mode; use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or query - * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to disambiguate. - */ - #[Pure] - public function inDaylightTime() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether another calendar is equal but for a different time - * @link https://secure.php.net/manual/en/intlcalendar.isequivalentto.php - * @param IntlCalendar $other The other calendar against which the comparison is to be made. - * @return bool - * Assuming there are no argument errors, returns TRUE iif the calendars are equivalent except possibly for their set time. - */ - #[Pure] - public function isEquivalentTo(IntlCalendar $other) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether date/time interpretation is in lenient mode - * @link https://secure.php.net/manual/en/intlcalendar.islenient.php - * @return bool - * A {@link https://secure.php.net/manual/en/language.types.boolean.php bool} representing whether the calendar is set to lenient mode. - */ - #[Pure] - public function isLenient() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether a certain date/time is in the weekend - * @link https://secure.php.net/manual/en/intlcalendar.isweekend.php - * @param float|null $timestamp [optional]

- * An optional timestamp representing the number of milliseconds since the - * epoch, excluding leap seconds. If NULL, this object's current time is - * used instead. - *

- * @return bool - *

A {@link https://secure.php.net/manual/en/language.types.boolean.php bool} indicating whether the given or this object's time occurs - * in a weekend. - *

- *

- * The value FALSE may also be returned on failure, for instance after giving - * a date out of bounds on non-lenient mode; use {@link https://secure.php.net/manual/en/intl.configuration.php#ini.intl.use-exceptions exceptions} or query - * {@link https://secure.php.net/manual/en/function.intl-get-error-code.php intl_get_error_code()} to disambiguate.

- */ - #[Pure] - public function isWeekend(#[TypeAware(['8.0' => 'float|null'], default: '')] $timestamp = null) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Add value to field without carrying into more significant fields - * @link https://secure.php.net/manual/en/intlcalendar.roll.php - * @param int $field - *

One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time - * {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @param mixed $value

- * The (signed) amount to add to the field, TRUE for rolling up (adding - * 1), or FALSE for rolling down (subtracting - * 1). - *

- * @return bool Returns TRUE on success or FALSE on failure. - */ - public function roll(#[TypeAware(['8.0' => 'int'], default: '')] $field, $value) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Whether a field is set - * @link https://secure.php.net/manual/en/intlcalendar.isset.php - * @param int $field

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time - * {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. - * These are integer values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @return bool Assuming there are no argument errors, returns TRUE iif the field is set. - */ - public function PS_UNRESERVE_PREFIX_isSet(#[TypeAware(['8.0' => 'int'], default: '')] $field) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set a time field or several common fields at once - * @link https://secure.php.net/manual/en/intlcalendar.set.php - * @param int $year

- * One of the {@link https://secure.php.net/manual/en/class.intlcalendar.php IntlCalendar} date/time {@link https://secure.php.net/manual/en/class.intlcalendar.php#intlcalendar.constants field constants}. These are integer - * values between 0 and - * IntlCalendar::FIELD_COUNT. - *

- * @param int $month

- * The new value for IntlCalendar::FIELD_MONTH. - *

- * @param int $dayOfMonth [optional]

- * The new value for IntlCalendar::FIELD_DAY_OF_MONTH. - * The month sequence is zero-based, i.e., January is represented by 0, - * February by 1, ..., December is 11 and Undecember (if the calendar has - * it) is 12. - *

- * @param int $hour [optional] - *

- * The new value for IntlCalendar::FIELD_HOUR_OF_DAY. - *

- * @param int $minute [optional] - *

- * The new value for IntlCalendar::FIELD_MINUTE. - *

- * @param int $second [optional]

- * The new value for IntlCalendar::FIELD_SECOND. - *

- * @return bool Returns TRUE on success and FALSE on failure. - */ - public function set($year, $month, $dayOfMonth = null, $hour = null, $minute = null, $second = null) {} - - /** - * (PHP 5 >= 5.5.0 PECL intl >= 3.0.0a1)
- * Set a time field or several common fields at once - * @link https://secure.php.net/manual/en/intlcalendar.set.php - * @param int $field One of the IntlCalendar date/time field constants. These are integer values between 0 and IntlCalendar::FIELD_COUNT. - * @param int $value The new value of the given field. - * @return bool Returns TRUE on success and FALSE on failure. - * @since 5.5 - */ - public function set($field, $value) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set the day on which the week is deemed to start - * @link https://secure.php.net/manual/en/intlcalendar.setfirstdayofweek.php - * @param int $dayOfWeek

- * One of the constants IntlCalendar::DOW_SUNDAY, - * IntlCalendar::DOW_MONDAY, ..., - * IntlCalendar::DOW_SATURDAY. - *

- * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. - */ - public function setFirstDayOfWeek(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set whether date/time interpretation is to be lenient - * @link https://secure.php.net/manual/en/intlcalendar.setlenient.php - * @param bool $lenient

- * Use TRUE to activate the lenient mode; FALSE otherwise. - *

- * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. - */ - public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set behavior for handling repeating wall times at negative timezone offset transitions - * @link https://secure.php.net/manual/en/intlcalendar.setrepeatedwalltimeoption.php - * @param int $option

- * One of the constants IntlCalendar::WALLTIME_FIRST or - * IntlCalendar::WALLTIME_LAST. - *

- * @return bool - * Returns TRUE on success. Failure can only happen due to invalid parameters. - */ - public function setRepeatedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: '')] $option) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set behavior for handling skipped wall times at positive timezone offset transitions - * @link https://secure.php.net/manual/en/intlcalendar.setskippedwalltimeoption.php - * @param int $option

- * One of the constants IntlCalendar::WALLTIME_FIRST, - * IntlCalendar::WALLTIME_LAST or - * IntlCalendar::WALLTIME_NEXT_VALID. - *

- * @return bool - *

- * Returns TRUE on success. Failure can only happen due to invalid parameters. - *

- */ - public function setSkippedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: '')] $option) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set the calendar time in milliseconds since the epoch - * @link https://secure.php.net/manual/en/intlcalendar.settime.php - * @param float $timestamp

- * An instant represented by the number of number of milliseconds between - * such instant and the epoch, ignoring leap seconds. - *

- * @return bool - * Returns TRUE on success and FALSE on failure. - */ - public function setTime(#[TypeAware(['8.0' => 'float'], default: '')] $timestamp) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Set the timezone used by this calendar - * @link https://secure.php.net/manual/en/intlcalendar.settimezone.php - * @param mixed $timezone

- * The new timezone to be used by this calendar. It can be specified in the - * following ways: - * - *

- * @return bool Returns TRUE on success and FALSE on failure. - */ - public function setTimeZone($timezone) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
- * Convert an IntlCalendar into a DateTime object - * @link https://secure.php.net/manual/en/intlcalendar.todatetime.php - * @return DateTime|false - * A {@link https://secure.php.net/manual/en/class.datetime.php DateTime} object with the same timezone as this - * object (though using PHP's database instead of ICU's) and the same time, - * except for the smaller precision (second precision instead of millisecond). - * Returns FALSE on failure. - */ - #[Pure] - public function toDateTime() {} - - /** - * @link https://www.php.net/manual/en/intlcalendar.setminimaldaysinfirstweek.php - * @param int $days - * @return bool - */ - public function setMinimalDaysInFirstWeek(#[TypeAware(['8.0' => 'int'], default: '')] $days) {} + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
+ * Convert an IntlCalendar into a DateTime object + * @link https://secure.php.net/manual/en/intlcalendar.todatetime.php + * @return DateTime|false + * A {@link https://secure.php.net/manual/en/class.datetime.php DateTime} object with the same timezone as this + * object (though using PHP's database instead of ICU's) and the same time, + * except for the smaller precision (second precision instead of millisecond). + * Returns FALSE on failure. + */ + #[Pure] + #[TentativeType] + public function toDateTime(): DateTime|false {} + + /** + * @link https://www.php.net/manual/en/intlcalendar.setminimaldaysinfirstweek.php + * @param int $days + * @return bool + */ + public function setMinimalDaysInFirstWeek(#[TypeAware(['8.0' => 'int'], default: '')] $days) {} } /** @@ -3269,15 +3407,20 @@ public function setMinimalDaysInFirstWeek(#[TypeAware(['8.0' => 'int'], default: */ class IntlIterator implements Iterator { - public function current() {} + #[TentativeType] + public function current(): mixed {} - public function key() {} + #[TentativeType] + public function key(): mixed {} - public function next() {} + #[TentativeType] + public function next(): void {} - public function rewind() {} + #[TentativeType] + public function rewind(): void {} - public function valid() {} + #[TentativeType] + public function valid(): bool {} } /** @@ -3290,270 +3433,294 @@ class IntlException extends Exception {} */ class IntlTimeZone { - /* Constants */ - public const DISPLAY_SHORT = 1; - public const DISPLAY_LONG = 2; - public const DISPLAY_SHORT_GENERIC = 3; - public const DISPLAY_LONG_GENERIC = 4; - public const DISPLAY_SHORT_GMT = 5; - public const DISPLAY_LONG_GMT = 6; - public const DISPLAY_SHORT_COMMONLY_USED = 7; - public const DISPLAY_GENERIC_LOCATION = 8; - public const TYPE_ANY = 0; - public const TYPE_CANONICAL = 1; - public const TYPE_CANONICAL_LOCATION = 2; - - /* Methods */ - - private function __construct() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the number of IDs in the equivalency group that includes the given ID - * @link https://secure.php.net/manual/en/intltimezone.countequivalentids.php - * @param string $timezoneId - * @return int|false number of IDs or FALSE on failure - */ - public static function countEquivalentIDs(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Create a new copy of the default timezone for this host - * @link https://secure.php.net/manual/en/intltimezone.createdefault.php - * @return IntlTimeZone - */ - public static function createDefault() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get an enumeration over time zone IDs associated with the given country or offset - * @link https://secure.php.net/manual/en/intltimezone.createenumeration.php - * @param mixed $countryOrRawOffset [optional] - * @return IntlIterator|false an iterator or FALSE on failure - */ - public static function createEnumeration($countryOrRawOffset) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Create a timezone object for the given ID - * @link https://secure.php.net/manual/en/intltimezone.createtimezone.php - * @param string $timezoneId - * @return IntlTimeZone|null a timezone object or NULL on failure - */ - public static function createTimeZone(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId) {} - - /** - * (PHP 5 >=5.5.0)
- * Get an enumeration over system time zone IDs with the given filter conditions - * @link https://secure.php.net/manual/en/intltimezone.createtimezoneidenumeration.php - * @param int $type - * @param string|null $region [optional] - * @param int $rawOffset [optional] - * @return IntlIterator|false an iterator or FALSE on failure - */ - public static function createTimeZoneIDEnumeration( - #[TypeAware(['8.0' => 'int'], default: '')] $type, - #[TypeAware(['8.0' => 'string|null'], default: '')] $region = null, - #[TypeAware(['8.0' => 'int|null'], default: '')] $rawOffset = 0 - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Create a timezone object from DateTimeZone - * @link https://secure.php.net/manual/en/intltimezone.fromdatetimezone.php - * @param DateTimeZone $timezone - * @return IntlTimeZone|null a timezone object or NULL on failure - */ - public static function fromDateTimeZone(#[TypeAware(['8.0' => 'DateTimeZone'], default: '')] $timezone) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID - * @link https://secure.php.net/manual/en/intltimezone.getcanonicalid.php - * @param string $timezoneId - * @param bool &$isSystemId [optional] - * @return string|false the timezone ID or FALSE on failure - */ - public static function getCanonicalID(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId, &$isSystemId) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get a name of this time zone suitable for presentation to the user - * @param bool $dst [optional] - * @param int $style [optional] - * @param string $locale [optional] - * @return string|false the timezone name or FALSE on failure - */ - #[Pure] - public function getDisplayName( - #[TypeAware(['8.0' => 'bool'], default: '')] $dst = false, - #[TypeAware(['8.0' => 'int'], default: '')] $style = 2, - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the amount of time to be added to local standard time to get local wall clock time - * @link https://secure.php.net/manual/en/intltimezone.getequivalentid.php - * @return int - */ - #[Pure] - public function getDSTSavings() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get an ID in the equivalency group that includes the given ID - * @link https://secure.php.net/manual/en/intltimezone.getequivalentid.php - * @param string $timezoneId - * @param int $offset - * @return string|false the time zone ID or FALSE on failure - */ - public static function getEquivalentID( - #[TypeAware(['8.0' => 'string'], default: '')] $timezoneId, - #[TypeAware(['8.0' => 'int'], default: '')] $offset - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get last error code on the object - * @link https://secure.php.net/manual/en/intltimezone.geterrorcode.php - * @return int - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get last error message on the object - * @link https://secure.php.net/manual/en/intltimezone.geterrormessage.php - * @return string - */ - #[Pure] - public function getErrorMessage() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Create GMT (UTC) timezone - * @link https://secure.php.net/manual/en/intltimezone.getgmt.php - * @return IntlTimeZone - */ - public static function getGMT() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get timezone ID - * @return string - */ - #[Pure] - public function getID() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the time zone raw and GMT offset for the given moment in time - * @link https://secure.php.net/manual/en/intltimezone.getoffset.php - * @param float $timestamp - * moment in time for which to return offsets, in units of milliseconds from - * January 1, 1970 0:00 GMT, either GMT time or local wall time, depending on - * `local'. - * @param bool $local - * if true, `date' is local wall time; otherwise it is in GMT time. - * @param int &$rawOffset - * output parameter to receive the raw offset, that is, the offset not - * including DST adjustments - * @param int &$dstOffset - * output parameter to receive the DST offset, that is, the offset to be added - * to `rawOffset' to obtain the total offset between local and GMT time. If - * DST is not in effect, this value is zero; otherwise it is a positive value, - * typically one hour. - * @return bool boolean indication of success - */ - public function getOffset( - #[TypeAware(['8.0' => 'float'], default: '')] $timestamp, - #[TypeAware(['8.0' => 'bool'], default: '')] $local, - &$rawOffset, - &$dstOffset - ) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the raw GMT offset (before taking daylight savings time into account - * @link https://secure.php.net/manual/en/intltimezone.getrawoffset.php - * @return int - */ - #[Pure] - public function getRawOffset() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the region code associated with the given system time zone ID - * @link https://secure.php.net/manual/en/intltimezone.getregion.php - * @param string $timezoneId - * @return string|false region or FALSE on failure - */ - public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Get the timezone data version currently used by ICU - * @link https://secure.php.net/manual/en/intltimezone.gettzdataversion.php - * @return string - */ - public static function getTZDataVersion() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the "unknown" time zone - * @link https://secure.php.net/manual/en/intltimezone.getunknown.php - * @return IntlTimeZone - */ - public static function getUnknown() {} - - /** - * (PHP 7 >=7.1.0)
- * Translates a system timezone (e.g. "America/Los_Angeles") into a Windows - * timezone (e.g. "Pacific Standard Time"). - * @link https://secure.php.net/manual/en/intltimezone.getwindowsid.php - * @param string $timezoneId - * @return string|false the Windows timezone or FALSE on failure - * @since 7.1 - */ - public static function getWindowsID(string $timezoneId) {} - - /** - * @link https://www.php.net/manual/en/intltimezone.getidforwindowsid.php - * @param string $timezoneId - * @param string|null $region - * @return string|false the Windows timezone or FALSE on failure - * @since 7.1 - */ - public static function getIDForWindowsID(string $timezoneId, ?string $region = null) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Check if this zone has the same rules and offset as another zone - * @link https://secure.php.net/manual/en/intltimezone.hassamerules.php - * @param IntlTimeZone $other - * @return bool - */ - #[Pure] - public function hasSameRules(IntlTimeZone $other) {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Convert to DateTimeZone object - * @link https://secure.php.net/manual/en/intltimezone.todatetimezone.php - * @return DateTimeZone|false the DateTimeZone object or FALSE on failure - */ - #[Pure] - public function toDateTimeZone() {} - - /** - * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
- * Check if this time zone uses daylight savings time - * @link https://secure.php.net/manual/en/intltimezone.usedaylighttime.php - * @return bool - */ - public function useDaylightTime() {} + /* Constants */ + public const DISPLAY_SHORT = 1; + public const DISPLAY_LONG = 2; + public const DISPLAY_SHORT_GENERIC = 3; + public const DISPLAY_LONG_GENERIC = 4; + public const DISPLAY_SHORT_GMT = 5; + public const DISPLAY_LONG_GMT = 6; + public const DISPLAY_SHORT_COMMONLY_USED = 7; + public const DISPLAY_GENERIC_LOCATION = 8; + public const TYPE_ANY = 0; + public const TYPE_CANONICAL = 1; + public const TYPE_CANONICAL_LOCATION = 2; + + /* Methods */ + + private function __construct() {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the number of IDs in the equivalency group that includes the given ID + * @link https://secure.php.net/manual/en/intltimezone.countequivalentids.php + * @param string $timezoneId + * @return int|false number of IDs or FALSE on failure + */ + #[TentativeType] + public static function countEquivalentIDs(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Create a new copy of the default timezone for this host + * @link https://secure.php.net/manual/en/intltimezone.createdefault.php + * @return IntlTimeZone + */ + #[TentativeType] + public static function createDefault(): IntlTimeZone {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get an enumeration over time zone IDs associated with the given country or offset + * @link https://secure.php.net/manual/en/intltimezone.createenumeration.php + * @param mixed $countryOrRawOffset [optional] + * @return IntlIterator|false an iterator or FALSE on failure + */ + #[TentativeType] + public static function createEnumeration($countryOrRawOffset): IntlIterator|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Create a timezone object for the given ID + * @link https://secure.php.net/manual/en/intltimezone.createtimezone.php + * @param string $timezoneId + * @return IntlTimeZone|null a timezone object or NULL on failure + */ + #[TentativeType] + public static function createTimeZone(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId): ?IntlTimeZone {} + + /** + * (PHP 5 >=5.5.0)
+ * Get an enumeration over system time zone IDs with the given filter conditions + * @link https://secure.php.net/manual/en/intltimezone.createtimezoneidenumeration.php + * @param int $type + * @param string|null $region [optional] + * @param int $rawOffset [optional] + * @return IntlIterator|false an iterator or FALSE on failure + */ + #[TentativeType] + public static function createTimeZoneIDEnumeration( + #[TypeAware(['8.0' => 'int'], default: '')] $type, + #[TypeAware(['8.0' => 'string|null'], default: '')] $region = null, + #[TypeAware(['8.0' => 'int|null'], default: '')] $rawOffset = 0 + ): IntlIterator|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Create a timezone object from DateTimeZone + * @link https://secure.php.net/manual/en/intltimezone.fromdatetimezone.php + * @param DateTimeZone $timezone + * @return IntlTimeZone|null a timezone object or NULL on failure + */ + #[TentativeType] + public static function fromDateTimeZone(#[TypeAware(['8.0' => 'DateTimeZone'], default: '')] $timezone): ?IntlTimeZone {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID + * @link https://secure.php.net/manual/en/intltimezone.getcanonicalid.php + * @param string $timezoneId + * @param bool &$isSystemId [optional] + * @return string|false the timezone ID or FALSE on failure + */ + #[TentativeType] + public static function getCanonicalID(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId, &$isSystemId): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get a name of this time zone suitable for presentation to the user + * @param bool $dst [optional] + * @param int $style [optional] + * @param string $locale [optional] + * @return string|false the timezone name or FALSE on failure + */ + #[Pure] + #[TentativeType] + public function getDisplayName( + #[TypeAware(['8.0' => 'bool'], default: '')] $dst = false, + #[TypeAware(['8.0' => 'int'], default: '')] $style = 2, + #[TypeAware(['8.0' => 'string|null'], default: '')] $locale + ): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the amount of time to be added to local standard time to get local wall clock time + * @link https://secure.php.net/manual/en/intltimezone.getequivalentid.php + * @return int + */ + #[Pure] + #[TentativeType] + public function getDSTSavings(): int {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get an ID in the equivalency group that includes the given ID + * @link https://secure.php.net/manual/en/intltimezone.getequivalentid.php + * @param string $timezoneId + * @param int $offset + * @return string|false the time zone ID or FALSE on failure + */ + #[TentativeType] + public static function getEquivalentID( + #[TypeAware(['8.0' => 'string'], default: '')] $timezoneId, + #[TypeAware(['8.0' => 'int'], default: '')] $offset + ): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get last error code on the object + * @link https://secure.php.net/manual/en/intltimezone.geterrorcode.php + * @return int + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get last error message on the object + * @link https://secure.php.net/manual/en/intltimezone.geterrormessage.php + * @return string|false + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Create GMT (UTC) timezone + * @link https://secure.php.net/manual/en/intltimezone.getgmt.php + * @return IntlTimeZone + */ + #[TentativeType] + public static function getGMT(): IntlTimeZone {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get timezone ID + * @return string + */ + #[Pure] + #[TentativeType] + public function getID(): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the time zone raw and GMT offset for the given moment in time + * @link https://secure.php.net/manual/en/intltimezone.getoffset.php + * @param float $timestamp + * moment in time for which to return offsets, in units of milliseconds from + * January 1, 1970 0:00 GMT, either GMT time or local wall time, depending on + * `local'. + * @param bool $local + * if true, `date' is local wall time; otherwise it is in GMT time. + * @param int &$rawOffset + * output parameter to receive the raw offset, that is, the offset not + * including DST adjustments + * @param int &$dstOffset + * output parameter to receive the DST offset, that is, the offset to be added + * to `rawOffset' to obtain the total offset between local and GMT time. If + * DST is not in effect, this value is zero; otherwise it is a positive value, + * typically one hour. + * @return bool boolean indication of success + */ + #[TentativeType] + public function getOffset( + #[TypeAware(['8.0' => 'float'], default: '')] $timestamp, + #[TypeAware(['8.0' => 'bool'], default: '')] $local, + &$rawOffset, + &$dstOffset + ): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the raw GMT offset (before taking daylight savings time into account + * @link https://secure.php.net/manual/en/intltimezone.getrawoffset.php + * @return int + */ + #[Pure] + #[TentativeType] + public function getRawOffset(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the region code associated with the given system time zone ID + * @link https://secure.php.net/manual/en/intltimezone.getregion.php + * @param string $timezoneId + * @return string|false region or FALSE on failure + */ + #[TentativeType] + public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Get the timezone data version currently used by ICU + * @link https://secure.php.net/manual/en/intltimezone.gettzdataversion.php + * @return string + */ + #[TentativeType] + public static function getTZDataVersion(): string|false {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the "unknown" time zone + * @link https://secure.php.net/manual/en/intltimezone.getunknown.php + * @return IntlTimeZone + */ + #[TentativeType] + public static function getUnknown(): IntlTimeZone {} + + /** + * (PHP 7 >=7.1.0)
+ * Translates a system timezone (e.g. "America/Los_Angeles") into a Windows + * timezone (e.g. "Pacific Standard Time"). + * @link https://secure.php.net/manual/en/intltimezone.getwindowsid.php + * @param string $timezoneId + * @return string|false the Windows timezone or FALSE on failure + * @since 7.1 + */ + #[TentativeType] + public static function getWindowsID(string $timezoneId): string|false {} + + /** + * @link https://www.php.net/manual/en/intltimezone.getidforwindowsid.php + * @param string $timezoneId + * @param string|null $region + * @return string|false the Windows timezone or FALSE on failure + * @since 7.1 + */ + #[TentativeType] + public static function getIDForWindowsID(string $timezoneId, ?string $region = null): string|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Check if this zone has the same rules and offset as another zone + * @link https://secure.php.net/manual/en/intltimezone.hassamerules.php + * @param IntlTimeZone $other + * @return bool + */ + #[Pure] + #[TentativeType] + public function hasSameRules(IntlTimeZone $other): bool {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Convert to DateTimeZone object + * @link https://secure.php.net/manual/en/intltimezone.todatetimezone.php + * @return DateTimeZone|false the DateTimeZone object or FALSE on failure + */ + #[Pure] + #[TentativeType] + public function toDateTimeZone(): DateTimeZone|false {} + + /** + * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
+ * Check if this time zone uses daylight savings time + * @link https://secure.php.net/manual/en/intltimezone.usedaylighttime.php + * @return bool + */ + #[TentativeType] + public function useDaylightTime(): bool {} } /** @@ -6806,329 +6973,354 @@ function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null */ class IntlBreakIterator implements IteratorAggregate { - /* Constants */ - public const DONE = -1; - public const WORD_NONE = 0; - public const WORD_NONE_LIMIT = 100; - public const WORD_NUMBER = 100; - public const WORD_NUMBER_LIMIT = 200; - public const WORD_LETTER = 200; - public const WORD_LETTER_LIMIT = 300; - public const WORD_KANA = 300; - public const WORD_KANA_LIMIT = 400; - public const WORD_IDEO = 400; - public const WORD_IDEO_LIMIT = 500; - public const LINE_SOFT = 0; - public const LINE_SOFT_LIMIT = 100; - public const LINE_HARD = 100; - public const LINE_HARD_LIMIT = 200; - public const SENTENCE_TERM = 0; - public const SENTENCE_TERM_LIMIT = 100; - public const SENTENCE_SEP = 100; - public const SENTENCE_SEP_LIMIT = 200; - - /* Methods */ - /** - * (PHP 5 >=5.5.0)
- * Private constructor for disallowing instantiation - */ - private function __construct() {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for boundaries of combining character sequences - * @link https://secure.php.net/manual/en/intlbreakiterator.createcharacterinstance.php - * @param string $locale - * @return IntlBreakIterator - */ - public static function createCharacterInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for boundaries of code points - * @link https://secure.php.net/manual/en/intlbreakiterator.createcodepointinstance.php - * @return IntlBreakIterator - */ - public static function createCodePointInstance() {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for logically possible line breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createlineinstance.php - * @param string $locale [optional] - * @return IntlBreakIterator - */ - public static function createLineInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for sentence breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createsentenceinstance.php - * @param string $locale [optional] - * @return IntlBreakIterator - */ - public static function createSentenceInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for title-casing breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createtitleinstance.php - * @param string $locale [optional] - * @return IntlBreakIterator - */ - public static function createTitleInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for word breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createwordinstance.php - * @param string $locale [optional] - * @return IntlBreakIterator - */ - public static function createWordInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Get index of current position - * @link https://secure.php.net/manual/en/intlbreakiterator.current.php - * @return int - */ - #[Pure] - public function current() {} - - /** - * (PHP 5 >=5.5.0)
- * Set position to the first character in the text - * @link https://secure.php.net/manual/en/intlbreakiterator.first.php - */ - public function first() {} - - /** - * (PHP 5 >=5.5.0)
- * Advance the iterator to the first boundary following specified offset - * @link https://secure.php.net/manual/en/intlbreakiterator.following.php - * @param int $offset - */ - public function following(#[TypeAware(['8.0' => 'int'], default: '')] $offset) {} - - /** - * (PHP 5 >=5.5.0)
- * Get last error code on the object - * @link https://secure.php.net/manual/en/intlbreakiterator.geterrorcode.php - * @return int - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >=5.5.0)
- * Get last error message on the object - * @link https://secure.php.net/manual/en/intlbreakiterator.geterrormessage.php - * @return string - */ - #[Pure] - public function getErrorMessage() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the locale associated with the object - * @link https://secure.php.net/manual/en/intlbreakiterator.getlocale.php - * @param string $type - */ - #[Pure] - public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type) {} - - /** - * (PHP 5 >=5.5.0)
- * Create iterator for navigating fragments between boundaries - * @link https://secure.php.net/manual/en/intlbreakiterator.getpartsiterator.php - * @param int $type [optional] - *

- * Optional key type. Possible values are: - *

- */ - #[Pure] - public function getPartsIterator(#[TypeAware(['8.0' => 'string'], default: '')] $type = IntlPartsIterator::KEY_SEQUENTIAL) {} - - /** - * (PHP 5 >=5.5.0)
- * Get the text being scanned - * @link https://secure.php.net/manual/en/intlbreakiterator.gettext.php - */ - #[Pure] - public function getText() {} - - /** - * (PHP 5 >=5.5.0)
- * Tell whether an offset is a boundary's offset - * @link https://secure.php.net/manual/en/intlbreakiterator.isboundary.php - * @param int $offset - */ - #[Pure] - public function isBoundary(#[TypeAware(['8.0' => 'int'], default: '')] $offset) {} - - /** - * (PHP 5 >=5.5.0)
- * Set the iterator position to index beyond the last character - * @link https://secure.php.net/manual/en/intlbreakiterator.last.php - * @return int - */ - public function last() {} - - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlbreakiterator.next.php - * @param int $offset [optional] - * @return int - */ - public function next(#[TypeAware(['8.0' => 'int|null'], default: '')] $offset = null) {} - - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlbreakiterator.preceding.php - * @param int $offset - */ - public function preceding(#[TypeAware(['8.0' => 'int'], default: '')] $offset) {} - - /** - * (PHP 5 >=5.5.0)
- * Set the iterator position to the boundary immediately before the current - * @link https://secure.php.net/manual/en/intlbreakiterator.previous.php - * @return int - */ - public function previous() {} - - /** - * (PHP 5 >=5.5.0)
- * Set the text being scanned - * @link https://secure.php.net/manual/en/intlbreakiterator.settext.php - * @param string $text - */ - public function setText(#[TypeAware(['8.0' => 'string'], default: '')] $text) {} - - /** - * @return Traversable - */ - #[Pure] - public function getIterator() {} + /* Constants */ + public const DONE = -1; + public const WORD_NONE = 0; + public const WORD_NONE_LIMIT = 100; + public const WORD_NUMBER = 100; + public const WORD_NUMBER_LIMIT = 200; + public const WORD_LETTER = 200; + public const WORD_LETTER_LIMIT = 300; + public const WORD_KANA = 300; + public const WORD_KANA_LIMIT = 400; + public const WORD_IDEO = 400; + public const WORD_IDEO_LIMIT = 500; + public const LINE_SOFT = 0; + public const LINE_SOFT_LIMIT = 100; + public const LINE_HARD = 100; + public const LINE_HARD_LIMIT = 200; + public const SENTENCE_TERM = 0; + public const SENTENCE_TERM_LIMIT = 100; + public const SENTENCE_SEP = 100; + public const SENTENCE_SEP_LIMIT = 200; + + /* Methods */ + /** + * (PHP 5 >=5.5.0)
+ * Private constructor for disallowing instantiation + */ + private function __construct() {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for boundaries of combining character sequences + * @link https://secure.php.net/manual/en/intlbreakiterator.createcharacterinstance.php + * @param string $locale + * @return IntlBreakIterator + */ + #[TentativeType] + public static function createCharacterInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlBreakIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for boundaries of code points + * @link https://secure.php.net/manual/en/intlbreakiterator.createcodepointinstance.php + * @return IntlCodePointBreakIterator + */ + #[TentativeType] + public static function createCodePointInstance(): IntlCodePointBreakIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for logically possible line breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createlineinstance.php + * @param string $locale [optional] + * @return IntlBreakIterator|null + */ + #[TentativeType] + public static function createLineInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for sentence breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createsentenceinstance.php + * @param string $locale [optional] + * @return IntlBreakIterator|null + */ + #[TentativeType] + public static function createSentenceInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for title-casing breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createtitleinstance.php + * @param string $locale [optional] + * @return IntlBreakIterator|null + */ + #[TentativeType] + public static function createTitleInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for word breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createwordinstance.php + * @param string $locale [optional] + * @return IntlBreakIterator|null + */ + #[TentativeType] + public static function createWordInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Get index of current position + * @link https://secure.php.net/manual/en/intlbreakiterator.current.php + * @return int + */ + #[Pure] + #[TentativeType] + public function current(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Set position to the first character in the text + * @link https://secure.php.net/manual/en/intlbreakiterator.first.php + */ + #[TentativeType] + public function first(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Advance the iterator to the first boundary following specified offset + * @link https://secure.php.net/manual/en/intlbreakiterator.following.php + * @param int $offset + */ + #[TentativeType] + public function following(#[TypeAware(['8.0' => 'int'], default: '')] $offset): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Get last error code on the object + * @link https://secure.php.net/manual/en/intlbreakiterator.geterrorcode.php + * @return int + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Get last error message on the object + * @link https://secure.php.net/manual/en/intlbreakiterator.geterrormessage.php + * @return string + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): string {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the locale associated with the object + * @link https://secure.php.net/manual/en/intlbreakiterator.getlocale.php + * @param string $type + */ + #[Pure] + #[TentativeType] + public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): string|false {} + + /** + * (PHP 5 >=5.5.0)
+ * Create iterator for navigating fragments between boundaries + * @link https://secure.php.net/manual/en/intlbreakiterator.getpartsiterator.php + * @param int $type [optional] + *

+ * Optional key type. Possible values are: + *

+ */ + #[Pure] + #[TentativeType] + public function getPartsIterator(#[TypeAware(['8.0' => 'string'], default: '')] $type = IntlPartsIterator::KEY_SEQUENTIAL): IntlPartsIterator {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the text being scanned + * @link https://secure.php.net/manual/en/intlbreakiterator.gettext.php + */ + #[Pure] + #[TentativeType] + public function getText(): ?string {} + + /** + * (PHP 5 >=5.5.0)
+ * Tell whether an offset is a boundary's offset + * @link https://secure.php.net/manual/en/intlbreakiterator.isboundary.php + * @param int $offset + */ + #[Pure] + #[TentativeType] + public function isBoundary(#[TypeAware(['8.0' => 'int'], default: '')] $offset): bool {} + + /** + * (PHP 5 >=5.5.0)
+ * Set the iterator position to index beyond the last character + * @link https://secure.php.net/manual/en/intlbreakiterator.last.php + * @return int + */ + #[TentativeType] + public function last(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlbreakiterator.next.php + * @param int $offset [optional] + * @return int + */ + #[TentativeType] + public function next(#[TypeAware(['8.0' => 'int|null'], default: '')] $offset = null): int {} + + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlbreakiterator.preceding.php + * @param int $offset + */ + #[TentativeType] + public function preceding(#[TypeAware(['8.0' => 'int'], default: '')] $offset): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Set the iterator position to the boundary immediately before the current + * @link https://secure.php.net/manual/en/intlbreakiterator.previous.php + * @return int + */ + #[TentativeType] + public function previous(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Set the text being scanned + * @link https://secure.php.net/manual/en/intlbreakiterator.settext.php + * @param string $text + */ + #[TentativeType] + public function setText(#[TypeAware(['8.0' => 'string'], default: '')] $text): ?bool {} + + /** + * @since 8.0 + * @return Iterator + */ + #[Pure] + public function getIterator(): Iterator {} } class IntlRuleBasedBreakIterator extends IntlBreakIterator implements Traversable { - /* Methods */ - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlbreakiterator.construct.php - * @param string $rules - * @param string $compiled [optional] - */ - #[Pure] - public function __construct( - #[TypeAware(['8.0' => 'string'], default: '')] $rules, - #[TypeAware(['8.0' => 'bool'], default: '')] $compiled = false - ) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for boundaries of combining character sequences - * @link https://secure.php.net/manual/en/intlbreakiterator.createcharacterinstance.php - * @param string $locale - * @return IntlRuleBasedBreakIterator - */ - public static function createCharacterInstance($locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for boundaries of code points - * @link https://secure.php.net/manual/en/intlbreakiterator.createcodepointinstance.php - * @return IntlRuleBasedBreakIterator - */ - public static function createCodePointInstance() {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for logically possible line breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createlineinstance.php - * @param string $locale [optional] - * @return IntlRuleBasedBreakIterator - */ - public static function createLineInstance($locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for sentence breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createsentenceinstance.php - * @param string $locale [optional] - * @return IntlRuleBasedBreakIterator - */ - public static function createSentenceInstance($locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for title-casing breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createtitleinstance.php - * @param string $locale [optional] - * @return IntlRuleBasedBreakIterator - */ - public static function createTitleInstance($locale) {} - - /** - * (PHP 5 >=5.5.0)
- * Create break iterator for word breaks - * @link https://secure.php.net/manual/en/intlbreakiterator.createwordinstance.php - * @param string $locale [optional] - * @return IntlRuleBasedBreakIterator - */ - public static function createWordInstance($locale) {} - - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getbinaryrules.php - * Get the binary form of compiled rules - * @return string - */ - #[Pure] - public function getBinaryRules() {} - - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getrules.php - * Get the rule set used to create this object - * @return string - */ - #[Pure] - public function getRules() {} - - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getrulesstatus.php - * Get the largest status value from the break rules that determined the current break position - * @return int - */ - #[Pure] - public function getRuleStatus() {} - - /** - * (PHP 5 >=5.5.0)
- * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getrulestatusvec.php - * Get the status values from the break rules that determined the current break position - * @return array - */ - #[Pure] - public function getRuleStatusVec() {} + /* Methods */ + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlbreakiterator.construct.php + * @param string $rules + * @param string $compiled [optional] + */ + #[Pure] + public function __construct( + #[TypeAware(['8.0' => 'string'], default: '')] $rules, + #[TypeAware(['8.0' => 'bool'], default: '')] $compiled = false + ) {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for boundaries of combining character sequences + * @link https://secure.php.net/manual/en/intlbreakiterator.createcharacterinstance.php + * @param string $locale + * @return IntlRuleBasedBreakIterator + */ + public static function createCharacterInstance($locale) {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for boundaries of code points + * @link https://secure.php.net/manual/en/intlbreakiterator.createcodepointinstance.php + * @return IntlRuleBasedBreakIterator + */ + public static function createCodePointInstance() {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for logically possible line breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createlineinstance.php + * @param string $locale [optional] + * @return IntlRuleBasedBreakIterator + */ + public static function createLineInstance($locale) {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for sentence breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createsentenceinstance.php + * @param string $locale [optional] + * @return IntlRuleBasedBreakIterator + */ + public static function createSentenceInstance($locale) {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for title-casing breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createtitleinstance.php + * @param string $locale [optional] + * @return IntlRuleBasedBreakIterator + */ + public static function createTitleInstance($locale) {} + + /** + * (PHP 5 >=5.5.0)
+ * Create break iterator for word breaks + * @link https://secure.php.net/manual/en/intlbreakiterator.createwordinstance.php + * @param string $locale [optional] + * @return IntlRuleBasedBreakIterator + */ + public static function createWordInstance($locale) {} + + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getbinaryrules.php + * Get the binary form of compiled rules + * @return string + */ + #[Pure] + #[TentativeType] + public function getBinaryRules(): string|false {} + + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getrules.php + * Get the rule set used to create this object + * @return string|false + */ + #[Pure] + #[TentativeType] + public function getRules(): string|false {} + + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getrulesstatus.php + * Get the largest status value from the break rules that determined the current break position + * @return int + */ + #[Pure] + #[TentativeType] + public function getRuleStatus(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getrulestatusvec.php + * Get the status values from the break rules that determined the current break position + * @return array|false + */ + #[Pure] + #[TentativeType] + public function getRuleStatusVec(): array|false {} } /** @@ -7137,282 +7329,303 @@ public function getRuleStatusVec() {} */ class IntlPartsIterator extends IntlIterator implements Iterator { - public const KEY_SEQUENTIAL = 0; - public const KEY_LEFT = 1; - public const KEY_RIGHT = 2; + public const KEY_SEQUENTIAL = 0; + public const KEY_LEFT = 1; + public const KEY_RIGHT = 2; - /** - * @return IntlBreakIterator - */ - #[Pure] - public function getBreakIterator() {} + /** + * @return IntlBreakIterator + */ + #[Pure] + #[TentativeType] + public function getBreakIterator(): IntlBreakIterator {} /** * @since 8.1 */ - public function getRuleStatus() {} + #[TentativeType] + public function getRuleStatus(): int {} } class IntlCodePointBreakIterator extends IntlBreakIterator implements Traversable { - /** - * (PHP 5 >=5.5.0)
- * Get last code point passed over after advancing or receding the iterator - * @link https://secure.php.net/manual/en/intlcodepointbreakiterator.getlastcodepoint.php - * @return int - */ - #[Pure] - public function getLastCodePoint() {} + /** + * (PHP 5 >=5.5.0)
+ * Get last code point passed over after advancing or receding the iterator + * @link https://secure.php.net/manual/en/intlcodepointbreakiterator.getlastcodepoint.php + * @return int + */ + #[Pure] + #[TentativeType] + public function getLastCodePoint(): int {} } class UConverter { - /* Constants */ - public const REASON_UNASSIGNED = 0; - public const REASON_ILLEGAL = 1; - public const REASON_IRREGULAR = 2; - public const REASON_RESET = 3; - public const REASON_CLOSE = 4; - public const REASON_CLONE = 5; - public const UNSUPPORTED_CONVERTER = -1; - public const SBCS = 0; - public const DBCS = 1; - public const MBCS = 2; - public const LATIN_1 = 3; - public const UTF8 = 4; - public const UTF16_BigEndian = 5; - public const UTF16_LittleEndian = 6; - public const UTF32_BigEndian = 7; - public const UTF32_LittleEndian = 8; - public const EBCDIC_STATEFUL = 9; - public const ISO_2022 = 10; - public const LMBCS_1 = 11; - public const LMBCS_2 = 12; - public const LMBCS_3 = 13; - public const LMBCS_4 = 14; - public const LMBCS_5 = 15; - public const LMBCS_6 = 16; - public const LMBCS_8 = 17; - public const LMBCS_11 = 18; - public const LMBCS_16 = 19; - public const LMBCS_17 = 20; - public const LMBCS_18 = 21; - public const LMBCS_19 = 22; - public const LMBCS_LAST = 22; - public const HZ = 23; - public const SCSU = 24; - public const ISCII = 25; - public const US_ASCII = 26; - public const UTF7 = 27; - public const BOCU1 = 28; - public const UTF16 = 29; - public const UTF32 = 30; - public const CESU8 = 31; - public const IMAP_MAILBOX = 32; - - /* Methods */ - /** - * (PHP 5 >=5.5.0)
- * Create UConverter object - * @link https://php.net/manual/en/uconverter.construct.php - * @param string $destination_encoding - * @param string $source_encoding - */ - #[Pure] - public function __construct( - #[TypeAware(['8.0' => 'string|null'], default: '')] $destination_encoding = null, - #[TypeAware(['8.0' => 'string|null'], default: '')] $source_encoding = null - ) {} - - /** - * (PHP 5 >=5.5.0)
- * Convert string from one charset to anothe - * @link https://php.net/manual/en/uconverter.convert.php - * @param string $str - * @param bool $reverse [optional] - * @return string - */ - #[Pure] - public function convert( - #[TypeAware(['8.0' => 'string'], default: '')] $str, - #[TypeAware(['8.0' => 'bool'], default: '')] $reverse = false - ) {} - - /** - * (PHP 5 >=5.5.0)
- * Default "from" callback function - * @link https://php.net/manual/en/uconverter.fromucallback.php - * @param int $reason - * @param string $source - * @param string $codePoint - * @param int &$error - * @return mixed - */ - public function fromUCallback( - #[TypeAware(['8.0' => 'int'], default: '')] $reason, - #[TypeAware(['8.0' => 'array'], default: '')] $source, - #[TypeAware(['8.0' => 'int'], default: '')] $codePoint, - &$error - ) {} - - /** - * (PHP 5 >=5.5.0)
- * Get the aliases of the given name - * @link https://php.net/manual/en/uconverter.getaliases.php - * @param string $name - * @return array - */ - public static function getAliases(#[TypeAware(['8.0' => 'string'], default: '')] $name = null) {} - - /** - * (PHP 5 >=5.5.0)
- * Get the available canonical converter names - * @link https://php.net/manual/en/uconverter.getavailable.php - * @return array - */ - public static function getAvailable() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the destination encoding - * @link https://php.net/manual/en/uconverter.getdestinationencoding.php - * @return string - */ - #[Pure] - public function getDestinationEncoding() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the destination converter type - * @link https://php.net/manual/en/uconverter.getdestinationtype.php - * @return int - */ - #[Pure] - public function getDestinationType() {} - - /** - * (PHP 5 >=5.5.0)
- * Get last error code on the object - * @link https://php.net/manual/en/uconverter.geterrorcode.php - * @return int - */ - #[Pure] - public function getErrorCode() {} - - /** - * (PHP 5 >=5.5.0)
- * Get last error message on the object - * @link https://php.net/manual/en/uconverter.geterrormessage.php - * @return string - */ - #[Pure] - public function getErrorMessage() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the source encoding - * @link https://php.net/manual/en/uconverter.getsourceencoding.php - * @return string - */ - #[Pure] - public function getSourceEncoding() {} - - /** - * (PHP 5 >=5.5.0)
- * Get the source convertor type - * @link https://php.net/manual/en/uconverter.getsourcetype.php - * @return int - */ - #[Pure] - public function getSourceType() {} - - /** - * (PHP 5 >=5.5.0)
- * Get standards associated to converter names - * @link https://php.net/manual/en/uconverter.getstandards.php - * @return array - */ - #[Pure] - public static function getStandards() {} - - /** - * (PHP 5 >=5.5.0)
- * Get substitution chars - * @link https://php.net/manual/en/uconverter.getsubstchars.php - * @return string - */ - #[Pure] - public function getSubstChars() {} - - /** - * (PHP 5 >=5.5.0)
- * Get string representation of the callback reason - * @link https://php.net/manual/en/uconverter.reasontext.php - * @param int $reason - * @return string - */ - #[Pure] - public static function reasonText(#[TypeAware(['8.0' => 'int'], default: '')] $reason = 0) {} - - /** - * (PHP 5 >=5.5.0)
- * Set the destination encoding - * @link https://php.net/manual/en/uconverter.setdestinationencoding.php - * @param string $encoding - * @return void - */ - public function setDestinationEncoding(#[TypeAware(['8.0' => 'string'], default: '')] $encoding) {} - - /** - * (PHP 5 >=5.5.0)
- * Set the source encoding - * @link https://php.net/manual/en/uconverter.setsourceencoding.php - * @param string $encoding - * @return void - */ - public function setSourceEncoding(#[TypeAware(['8.0' => 'string'], default: '')] $encoding) {} - - /** - * (PHP 5 >=5.5.0)
- * Set the substitution chars - * @link https://php.net/manual/en/uconverter.setsubstchars.php - * @param string $chars - * @return void - */ - public function setSubstChars(#[TypeAware(['8.0' => 'string'], default: '')] $chars) {} - - /** - * (PHP 5 >=5.5.0)
- * Default "to" callback function - * @link https://php.net/manual/en/uconverter.toucallback.php - * @param int $reason - * @param string $source - * @param string $codeUnits - * @param int &$error - * @return mixed - */ - public function toUCallback( - #[TypeAware(['8.0' => 'int'], default: '')] $reason, - #[TypeAware(['8.0' => 'string'], default: '')] $source, - #[TypeAware(['8.0' => 'string'], default: '')] $codeUnits, - &$error - ) {} - - /** - * (PHP 5 >=5.5.0)
- * Convert string from one charset to another - * @link https://php.net/manual/en/uconverter.transcode.php - * @param string $str - * @param string $toEncoding - * @param string $fromEncoding - * @param array $options - * @return string - */ - public static function transcode( - #[TypeAware(['8.0' => 'string'], default: '')] $str, - #[TypeAware(['8.0' => 'string'], default: '')] $toEncoding, - #[TypeAware(['8.0' => 'string'], default: '')] $fromEncoding, - ?array $options = [] - ) {} + /* Constants */ + public const REASON_UNASSIGNED = 0; + public const REASON_ILLEGAL = 1; + public const REASON_IRREGULAR = 2; + public const REASON_RESET = 3; + public const REASON_CLOSE = 4; + public const REASON_CLONE = 5; + public const UNSUPPORTED_CONVERTER = -1; + public const SBCS = 0; + public const DBCS = 1; + public const MBCS = 2; + public const LATIN_1 = 3; + public const UTF8 = 4; + public const UTF16_BigEndian = 5; + public const UTF16_LittleEndian = 6; + public const UTF32_BigEndian = 7; + public const UTF32_LittleEndian = 8; + public const EBCDIC_STATEFUL = 9; + public const ISO_2022 = 10; + public const LMBCS_1 = 11; + public const LMBCS_2 = 12; + public const LMBCS_3 = 13; + public const LMBCS_4 = 14; + public const LMBCS_5 = 15; + public const LMBCS_6 = 16; + public const LMBCS_8 = 17; + public const LMBCS_11 = 18; + public const LMBCS_16 = 19; + public const LMBCS_17 = 20; + public const LMBCS_18 = 21; + public const LMBCS_19 = 22; + public const LMBCS_LAST = 22; + public const HZ = 23; + public const SCSU = 24; + public const ISCII = 25; + public const US_ASCII = 26; + public const UTF7 = 27; + public const BOCU1 = 28; + public const UTF16 = 29; + public const UTF32 = 30; + public const CESU8 = 31; + public const IMAP_MAILBOX = 32; + + /* Methods */ + /** + * (PHP 5 >=5.5.0)
+ * Create UConverter object + * @link https://php.net/manual/en/uconverter.construct.php + * @param string $destination_encoding + * @param string $source_encoding + */ + #[Pure] + public function __construct( + #[TypeAware(['8.0' => 'string|null'], default: '')] $destination_encoding = null, + #[TypeAware(['8.0' => 'string|null'], default: '')] $source_encoding = null + ) {} + + /** + * (PHP 5 >=5.5.0)
+ * Convert string from one charset to anothe + * @link https://php.net/manual/en/uconverter.convert.php + * @param string $str + * @param bool $reverse [optional] + * @return string|false + */ + #[Pure] + #[TentativeType] + public function convert( + #[TypeAware(['8.0' => 'string'], default: '')] $str, + #[TypeAware(['8.0' => 'bool'], default: '')] $reverse = false + ): string|false {} + + /** + * (PHP 5 >=5.5.0)
+ * Default "from" callback function + * @link https://php.net/manual/en/uconverter.fromucallback.php + * @param int $reason + * @param string $source + * @param string $codePoint + * @param int &$error + * @return array|string|int|null + */ + #[TentativeType] + public function fromUCallback( + #[TypeAware(['8.0' => 'int'], default: '')] $reason, + #[TypeAware(['8.0' => 'array'], default: '')] $source, + #[TypeAware(['8.0' => 'int'], default: '')] $codePoint, + &$error + ): array|string|int|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the aliases of the given name + * @link https://php.net/manual/en/uconverter.getaliases.php + * @param string $name + * @return array|false|null + */ + #[TentativeType] + public static function getAliases(#[TypeAware(['8.0' => 'string'], default: '')] $name = null): array|false|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the available canonical converter names + * @link https://php.net/manual/en/uconverter.getavailable.php + * @return array + */ + #[TentativeType] + public static function getAvailable(): array {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the destination encoding + * @link https://php.net/manual/en/uconverter.getdestinationencoding.php + * @return string|false|null + */ + #[Pure] + #[TentativeType] + public function getDestinationEncoding(): string|false|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the destination converter type + * @link https://php.net/manual/en/uconverter.getdestinationtype.php + * @return int|false|null + */ + #[Pure] + #[TentativeType] + public function getDestinationType(): int|false|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get last error code on the object + * @link https://php.net/manual/en/uconverter.geterrorcode.php + * @return int + */ + #[Pure] + #[TentativeType] + public function getErrorCode(): int {} + + /** + * (PHP 5 >=5.5.0)
+ * Get last error message on the object + * @link https://php.net/manual/en/uconverter.geterrormessage.php + * @return string|null + */ + #[Pure] + #[TentativeType] + public function getErrorMessage(): ?string {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the source encoding + * @link https://php.net/manual/en/uconverter.getsourceencoding.php + * @return string|false|null + */ + #[Pure] + #[TentativeType] + public function getSourceEncoding(): string|false|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get the source convertor type + * @link https://php.net/manual/en/uconverter.getsourcetype.php + * @return int|false|null + */ + #[Pure] + #[TentativeType] + public function getSourceType(): int|false|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get standards associated to converter names + * @link https://php.net/manual/en/uconverter.getstandards.php + * @return array|null + */ + #[Pure] + #[TentativeType] + public static function getStandards(): ?array {} + + /** + * (PHP 5 >=5.5.0)
+ * Get substitution chars + * @link https://php.net/manual/en/uconverter.getsubstchars.php + * @return string|false|null + */ + #[Pure] + #[TentativeType] + public function getSubstChars(): string|false|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Get string representation of the callback reason + * @link https://php.net/manual/en/uconverter.reasontext.php + * @param int $reason + * @return string + */ + #[Pure] + #[TentativeType] + public static function reasonText(#[TypeAware(['8.0' => 'int'], default: '')] $reason = 0): string {} + + /** + * (PHP 5 >=5.5.0)
+ * Set the destination encoding + * @link https://php.net/manual/en/uconverter.setdestinationencoding.php + * @param string $encoding + * @return bool + */ + #[TentativeType] + public function setDestinationEncoding(#[TypeAware(['8.0' => 'string'], default: '')] $encoding): bool {} + + /** + * (PHP 5 >=5.5.0)
+ * Set the source encoding + * @link https://php.net/manual/en/uconverter.setsourceencoding.php + * @param string $encoding + * @return bool + */ + #[TentativeType] + public function setSourceEncoding(#[TypeAware(['8.0' => 'string'], default: '')] $encoding): bool {} + + /** + * (PHP 5 >=5.5.0)
+ * Set the substitution chars + * @link https://php.net/manual/en/uconverter.setsubstchars.php + * @param string $chars + * @return bool + */ + #[TentativeType] + public function setSubstChars(#[TypeAware(['8.0' => 'string'], default: '')] $chars): bool {} + + /** + * (PHP 5 >=5.5.0)
+ * Default "to" callback function + * @link https://php.net/manual/en/uconverter.toucallback.php + * @param int $reason + * @param string $source + * @param string $codeUnits + * @param int &$error + * @return array|string|int|null + */ + #[TentativeType] + public function toUCallback( + #[TypeAware(['8.0' => 'int'], default: '')] $reason, + #[TypeAware(['8.0' => 'string'], default: '')] $source, + #[TypeAware(['8.0' => 'string'], default: '')] $codeUnits, + &$error + ): array|string|int|null {} + + /** + * (PHP 5 >=5.5.0)
+ * Convert string from one charset to another + * @link https://php.net/manual/en/uconverter.transcode.php + * @param string $str + * @param string $toEncoding + * @param string $fromEncoding + * @param array $options + * @return string|false + */ + #[TentativeType] + public static function transcode( + #[TypeAware(['8.0' => 'string'], default: '')] $str, + #[TypeAware(['8.0' => 'string'], default: '')] $toEncoding, + #[TypeAware(['8.0' => 'string'], default: '')] $fromEncoding, + ?array $options = [] + ): string|false {} } // End of intl v.1.1.0 diff --git a/json/json.php b/json/json.php index af706a45f..779b77e10 100644 --- a/json/json.php +++ b/json/json.php @@ -1,7 +1,7 @@ 'mixed'], default: '')] - public function jsonSerialize(); + #[TentativeType] + public function jsonSerialize(): mixed; } class JsonIncrementalParser @@ -457,6 +457,6 @@ function json_last_error_msg(): string {} * @since 7.3 * @link https://wiki.php.net/rfc/json_throw_on_error */ -class JsonException extends \Exception {} +class JsonException extends Exception {} // End of json v.1.3.1 diff --git a/meta/attributes/internal/TentativeType.php b/meta/attributes/internal/TentativeType.php new file mode 100644 index 000000000..8bdab771f --- /dev/null +++ b/meta/attributes/internal/TentativeType.php @@ -0,0 +1,13 @@ + * @return bool true on success or false on failure. */ - public function autocommit(bool $enable) {} + #[TentativeType] + public function autocommit(bool $enable): bool {} /** * Starts a transaction @@ -204,10 +206,11 @@ public function autocommit(bool $enable) {} * @return bool true on success or false on failure. * @since 5.5 */ + #[TentativeType] public function begin_transaction( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null - ) {} + ): bool {} /** * Changes the user of the specified database connection @@ -228,14 +231,16 @@ public function begin_transaction( *

* @return bool true on success or false on failure. */ - public function change_user(string $username, string $password, ?string $database) {} + #[TentativeType] + public function change_user(string $username, string $password, ?string $database): bool {} /** * Returns the default character set for the database connection * @link https://php.net/manual/en/mysqli.character-set-name.php * @return string The default character set for the current connection */ - public function character_set_name() {} + #[TentativeType] + public function character_set_name(): string {} /** * @removed 5.4 @@ -257,7 +262,8 @@ public function close() {} * @param string $name If provided then COMMIT $name is executed. * @return bool true on success or false on failure. */ - public function commit(int $flags = -1, ?string $name = null) {} + #[TentativeType] + public function commit(int $flags = -1, ?string $name = null): bool {} /** * @link https://php.net/manual/en/function.mysqli-connect.php @@ -268,6 +274,7 @@ public function commit(int $flags = -1, ?string $name = null) {} * @param int $port [optional] * @param string $socket [optional] */ + #[TentativeType] public function connect( ?string $hostname = null, ?string $username = null, @@ -275,14 +282,15 @@ public function connect( ?string $database = null, ?int $port = null, ?string $socket = null - ) {} + ): bool {} /** * Dump debugging information into the log * @link https://php.net/manual/en/mysqli.dump-debug-info.php * @return bool true on success or false on failure. */ - public function dump_debug_info() {} + #[TentativeType] + public function dump_debug_info(): bool {} /** * Performs debugging operations @@ -297,7 +305,7 @@ public function debug(string $options) {} /** * Returns a character set object * @link https://php.net/manual/en/mysqli.get-charset.php - * @return object The function returns a character set object with the following properties: + * @return object|null The function returns a character set object with the following properties: * charset *

Character set name

* collation @@ -313,35 +321,40 @@ public function debug(string $options) {} * state *

Character set status (?)

*/ - public function get_charset() {} + #[TentativeType] + public function get_charset(): ?object {} /** * Returns the MySQL client version as a string * @link https://php.net/manual/en/mysqli.get-client-info.php * @return string A string that represents the MySQL client library version */ - public function get_client_info() {} + #[TentativeType] + public function get_client_info(): string {} /** * Returns statistics about the client connection * @link https://php.net/manual/en/mysqli.get-connection-stats.php * @return array|false an array with connection stats if success, false otherwise. */ - public function get_connection_stats() {} + #[TentativeType] + public function get_connection_stats(): array {} /** * An undocumented function equivalent to the $server_info property * @link https://php.net/manual/en/mysqli.get-server-info.php * @return string A character string representing the server version. */ - public function get_server_info() {} + #[TentativeType] + public function get_server_info(): string {} /** * Get result of SHOW WARNINGS * @link https://php.net/manual/en/mysqli.get-warnings.php - * @return mysqli_warning + * @return mysqli_warning|false */ - public function get_warnings() {} + #[TentativeType] + public function get_warnings(): mysqli_warning|false {} /** * Initializes MySQLi and returns a resource for use with mysqli_real_connect() @@ -357,7 +370,8 @@ public function init() {} * @param int $process_id * @return bool true on success or false on failure. */ - public function kill(int $process_id) {} + #[TentativeType] + public function kill(int $process_id): bool {} /** * Performs a query on the database @@ -372,7 +386,8 @@ public function kill(int $process_id) {} * To retrieve subsequent errors from other statements you have to call * mysqli_next_result first. */ - public function multi_query(string $query) {} + #[TentativeType] + public function multi_query(string $query): bool {} /** * @link https://php.net/manual/en/mysqli.construct.php @@ -392,14 +407,16 @@ public function mysqli($host = null, $username = null, $password = null, $databa * @link https://php.net/manual/en/mysqli.more-results.php * @return bool true on success or false on failure. */ - public function more_results() {} + #[TentativeType] + public function more_results(): bool {} /** * Prepare next result from multi_query * @link https://php.net/manual/en/mysqli.next-result.php * @return bool true on success or false on failure. */ - public function next_result() {} + #[TentativeType] + public function next_result(): bool {} /** * Set options @@ -450,14 +467,16 @@ public function next_result() {} *

* @return bool true on success or false on failure. */ - public function options(int $option, $value) {} + #[TentativeType] + public function options(int $option, $value): bool {} /** * Pings a server connection, or tries to reconnect if the connection has gone down * @link https://php.net/manual/en/mysqli.ping.php * @return bool true on success or false on failure. */ - public function ping() {} + #[TentativeType] + public function ping(): bool {} /** * Prepare an SQL statement for execution @@ -495,7 +514,8 @@ public function ping() {} *

* @return mysqli_stmt|false mysqli_prepare returns a statement object or false if an error occurred. */ - public function prepare(string $query) {} + #[TentativeType] + public function prepare(string $query): mysqli_stmt|false {} /** * Performs a query on the database @@ -527,7 +547,8 @@ public function prepare(string $query) {} * a mysqli_result object. For other successful queries mysqli_query will * return true and false on failure. */ - public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT) {} + #[TentativeType] + public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} /** * Opens a connection to a mysql server @@ -605,6 +626,7 @@ public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT) {} *

* @return bool true on success or false on failure. */ + #[TentativeType] public function real_connect( ?string $hostname = null, ?string $username = null, @@ -613,7 +635,7 @@ public function real_connect( ?int $port = null, ?string $socket = null, int $flags = null - ) {} + ): bool {} /** * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection @@ -627,7 +649,8 @@ public function real_connect( *

* @return string an escaped string. */ - public function real_escape_string(string $string) {} + #[TentativeType] + public function real_escape_string(string $string): string {} /** * Poll connections @@ -646,14 +669,16 @@ public function real_escape_string(string $string) {} *

* @return int|false number of ready connections in success, false otherwise. */ - public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0) {} + #[TentativeType] + public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {} /** * Get result from async query * @link https://php.net/manual/en/mysqli.reap-async-query.php * @return mysqli_result|false mysqli_result in success, false otherwise. */ - public function reap_async_query() {} + #[TentativeType] + public function reap_async_query(): mysqli_result|bool {} /** * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection @@ -662,7 +687,8 @@ public function reap_async_query() {} * @return string * @link https://secure.php.net/manual/en/mysqli.real-escape-string.php */ - public function escape_string(string $string) {} + #[TentativeType] + public function escape_string(string $string): string {} /** * Execute an SQL query @@ -675,7 +701,8 @@ public function escape_string(string $string) {} *

* @return bool true on success or false on failure. */ - public function real_query(string $query) {} + #[TentativeType] + public function real_query(string $query): bool {} /** * Execute an SQL query @@ -684,7 +711,8 @@ public function real_query(string $query) {} * @return bool Returns TRUE on success or FALSE on failure. * @since 5.5 */ - public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Rolls back current transaction @@ -694,10 +722,11 @@ public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], * @return bool true on success or false on failure. * @since 5.5 Added flags and name parameters. */ + #[TentativeType] public function rollback( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null - ) {} + ): bool {} /** * Set a named transaction savepoint @@ -706,7 +735,8 @@ public function rollback( * @return bool Returns TRUE on success or FALSE on failure. * @since 5.5 */ - public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Selects the default database for database queries @@ -716,7 +746,8 @@ public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: *

* @return bool true on success or false on failure. */ - public function select_db(string $database) {} + #[TentativeType] + public function select_db(string $database): bool {} /** * Sets the default client character set @@ -726,14 +757,16 @@ public function select_db(string $database) {} *

* @return bool true on success or false on failure..5 */ - public function set_charset(string $charset) {} + #[TentativeType] + public function set_charset(string $charset): bool {} /** * @link https://php.net/manual/en/function.mysqli-set-opt - * @param int $option + * @param int $option * @param mixed $value */ - public function set_opt(int $option, $value) {} + #[TentativeType] + public function set_opt(int $option, $value): bool {} /** * Used for establishing secure connections using SSL @@ -762,14 +795,16 @@ public function ssl_set(?string $key, ?string $certificate, ?string $ca_certific * @link https://php.net/manual/en/mysqli.stat.php * @return string|false A string describing the server status. false if an error occurred. */ - public function stat() {} + #[TentativeType] + public function stat(): string|false {} /** * Initializes a statement and returns an object for use with mysqli_stmt_prepare * @link https://php.net/manual/en/mysqli.stmt-init.php * @return mysqli_stmt an object. */ - public function stmt_init() {} + #[TentativeType] + public function stmt_init(): mysqli_stmt|false {} /** * Transfers a result set from the last query @@ -791,21 +826,24 @@ public function stmt_init() {} * mysqli_field_count returns a non-zero value, the * statement should have produced a non-empty result set. */ - public function store_result(int $mode = null) {} + #[TentativeType] + public function store_result(int $mode = null): mysqli_result|false {} /** * Returns whether thread safety is given or not * @link https://php.net/manual/en/mysqli.thread-safe.php * @return bool true if the client library is thread-safe, otherwise false. */ - public function thread_safe() {} + #[TentativeType] + public function thread_safe(): bool {} /** * Initiate a result set retrieval * @link https://php.net/manual/en/mysqli.use-result.php * @return mysqli_result|false an unbuffered result object or false if an error occurred. */ - public function use_result() {} + #[TentativeType] + public function use_result(): mysqli_result|false {} /** * @link https://php.net/manual/en/mysqli.refresh @@ -813,7 +851,8 @@ public function use_result() {} * @return bool TRUE if the refresh was a success, otherwise FALSE * @since 5.3 */ - public function refresh(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags) {} + #[TentativeType] + public function refresh(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): bool {} } /** @@ -857,7 +896,7 @@ protected function __construct() {} * @link https://php.net/manual/en/mysqli-warning.next.php * @return bool True if it successfully moved to the next warning */ - public function next() {} + public function next(): bool {} } /** @@ -908,14 +947,16 @@ public function __construct( * @return void * @link https://php.net/manual/en/mysqli-result.free.php */ - public function close() {} + #[TentativeType] + public function close(): void {} /** * Frees the memory associated with a result * @link https://php.net/manual/en/mysqli-result.free.php * @return void */ - public function free() {} + #[TentativeType] + public function free(): void {} /** * Adjusts the result pointer to an arbitrary row in the result @@ -926,7 +967,8 @@ public function free() {} *

* @return bool true on success or false on failure. */ - public function data_seek(int $offset) {} + #[TentativeType] + public function data_seek(int $offset): bool {} /** * Returns the next field in the result set @@ -995,7 +1037,8 @@ public function data_seek(int $offset) {} * *
*/ - public function fetch_field() {} + #[TentativeType] + public function fetch_field(): object|false {} /** * Returns an array of objects representing the fields in a result set @@ -1056,7 +1099,8 @@ public function fetch_field() {} * * */ - public function fetch_fields() {} + #[TentativeType] + public function fetch_fields(): array {} /** * Fetch meta-data for a single field @@ -1122,7 +1166,8 @@ public function fetch_fields() {} * * */ - public function fetch_field_direct(int $index) {} + #[TentativeType] + public function fetch_field_direct(int $index): object|false {} /** * Fetches all result rows as an associative array, a numeric array, or both @@ -1135,7 +1180,8 @@ public function fetch_field_direct(int $index) {} *

* @return mixed an array of associative or numeric arrays holding result rows. */ - public function fetch_all(int $mode = MYSQLI_NUM) {} + #[TentativeType] + public function fetch_all(int $mode = MYSQLI_NUM): array {} /** * Fetch a result row as an associative, a numeric array, or both @@ -1157,7 +1203,8 @@ public function fetch_all(int $mode = MYSQLI_NUM) {} * @return mixed an array of strings that corresponds to the fetched row or null if there * are no more rows in resultset. */ - public function fetch_array(int $mode = MYSQLI_BOTH) {} + #[TentativeType] + public function fetch_array(int $mode = MYSQLI_BOTH): array|false|null {} /** * Fetch a result row as an associative array @@ -1172,7 +1219,8 @@ public function fetch_array(int $mode = MYSQLI_BOTH) {} * name, you either need to access the result with numeric indices by using * mysqli_fetch_row or add alias names. */ - public function fetch_assoc() {} + #[TentativeType] + public function fetch_assoc(): array|false|null {} /** * Returns the current row of a result set as an object @@ -1188,18 +1236,20 @@ public function fetch_assoc() {} * @return stdClass|object an object with string properties that corresponds to the fetched * row or null if there are no more rows in resultset. */ - public function fetch_object(string $class = 'stdClass', array $constructor_args = null) {} + #[TentativeType] + public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object|false|null {} /** * Get a result row as an enumerated array * @link https://php.net/manual/en/mysqli-result.fetch-row.php - * @return array|null mysqli_fetch_row returns an array of strings that corresponds to the fetched row + * @return array|false|null mysqli_fetch_row returns an array of strings that corresponds to the fetched row * or null if there are no more rows in result set. */ - public function fetch_row() {} + #[TentativeType] + public function fetch_row(): array|false|null {} #[PhpStormStubsElementAvailable('8.1')] - public function fetch_column(int $column = null) {} + public function fetch_column(int $column = null): string|int|float|false|null {} /** * Set result pointer to a specified field offset @@ -1210,20 +1260,22 @@ public function fetch_column(int $column = null) {} *

* @return bool true on success or false on failure. */ - public function field_seek(int $index) {} + #[TentativeType] + public function field_seek(int $index): bool {} /** * Frees the memory associated with a result * @return void * @link https://php.net/manual/en/mysqli-result.free.php */ - public function free_result() {} + #[TentativeType] + public function free_result(): void {} /** + * @return Iterator * @since 8.0 - * @return Traversable */ - public function getIterator() {} + public function getIterator(): Iterator {} } /** @@ -1298,7 +1350,8 @@ public function __construct($mysql, $query) {} *

* @return int|false false if the attribute is not found, otherwise returns the value of the attribute. */ - public function attr_get(int $attribute) {} + #[TentativeType] + public function attr_get(int $attribute): int {} /** * Used to modify the behavior of a prepared statement @@ -1352,7 +1405,8 @@ public function attr_get(int $attribute) {} * @param int $value

The value to assign to the attribute.

* @return bool */ - public function attr_set(int $attribute, int $value) {} + #[TentativeType] + public function attr_set(int $attribute, int $value): bool {} /** * Binds variables to a prepared statement as parameters @@ -1418,56 +1472,64 @@ public function close() {} *

* @return void */ - public function data_seek(int $offset) {} + #[TentativeType] + public function data_seek(int $offset): void {} /** * Executes a prepared Query * @link https://php.net/manual/en/mysqli-stmt.execute.php * @return bool true on success or false on failure. */ - public function execute(#[PhpStormStubsElementAvailable('8.1')] ?array $params = null) {} + #[TentativeType] + public function execute(#[PhpStormStubsElementAvailable('8.1')] ?array $params = null): bool {} /** * Fetch results from a prepared statement into the bound variables * @link https://php.net/manual/en/mysqli-stmt.fetch.php * @return bool|null */ - public function fetch() {} + #[TentativeType] + public function fetch(): ?bool {} /** * Get result of SHOW WARNINGS * @link https://php.net/manual/en/mysqli-stmt.get-warnings.php - * @return object + * @return object|false */ - public function get_warnings() {} + #[TentativeType] + public function get_warnings(): mysqli_warning|false {} /** * Returns result set metadata from a prepared statement * @link https://php.net/manual/en/mysqli-stmt.result-metadata.php * @return mysqli_result|false a result object or false if an error occurred. */ - public function result_metadata() {} + #[TentativeType] + public function result_metadata(): mysqli_result|false {} /** * Check if there are more query results from a multiple query * @link https://php.net/manual/en/mysqli-stmt.more-results.php * @return bool */ - public function more_results() {} + #[TentativeType] + public function more_results(): bool {} /** * Reads the next result from a multiple query * @link https://php.net/manual/en/mysqli-stmt.next-result.php * @return bool */ - public function next_result() {} + #[TentativeType] + public function next_result(): bool {} /** * Return the number of rows in statements result set * @link https://php.net/manual/en/mysqli-stmt.num-rows.php - * @return int An integer representing the number of rows in result set. + * @return string|int An integer representing the number of rows in result set. */ - public function num_rows() {} + #[TentativeType] + public function num_rows(): string|int {} /** * Send data in blocks @@ -1481,7 +1543,8 @@ public function num_rows() {} *

* @return bool true on success or false on failure. */ - public function send_long_data(int $param_num, string $data) {} + #[TentativeType] + public function send_long_data(int $param_num, string $data): bool {} /** * No documentation available @@ -1495,14 +1558,16 @@ public function stmt() {} * @link https://php.net/manual/en/mysqli-stmt.free-result.php * @return void */ - public function free_result() {} + #[TentativeType] + public function free_result(): void {} /** * Resets a prepared statement * @link https://php.net/manual/en/mysqli-stmt.reset.php * @return bool true on success or false on failure. */ - public function reset() {} + #[TentativeType] + public function reset(): bool {} /** * Prepare an SQL statement for execution @@ -1536,21 +1601,24 @@ public function reset() {} *

* @return bool true on success or false on failure. */ - public function prepare(string $query) {} + #[TentativeType] + public function prepare(string $query): bool {} /** * Transfers a result set from a prepared statement * @link https://php.net/manual/en/mysqli-stmt.store-result.php * @return bool true on success or false on failure. */ - public function store_result() {} + #[TentativeType] + public function store_result(): bool {} /** * Gets a result set from a prepared statement * @link https://php.net/manual/en/mysqli-stmt.get-result.php * @return mysqli_result|false Returns a resultset or FALSE on failure */ - public function get_result() {} + #[TentativeType] + public function get_result(): mysqli_result|false {} } /** diff --git a/session/SessionHandler.php b/session/SessionHandler.php index 96801526e..28560304c 100644 --- a/session/SessionHandler.php +++ b/session/SessionHandler.php @@ -1,6 +1,7 @@ SessionHandlerInterface is an interface which defines @@ -22,7 +23,8 @@ interface SessionHandlerInterface *

* @since 5.4 */ - public function close(); + #[TentativeType] + public function close(): bool; /** * Destroy a session @@ -34,7 +36,8 @@ public function close(); *

* @since 5.4 */ - public function destroy(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id); + #[TentativeType] + public function destroy(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id): bool; /** * Cleanup old sessions @@ -50,7 +53,8 @@ public function destroy(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ' * @since 5.4 */ #[LanguageLevelTypeAware(['7.1' => 'int|false'], default: 'bool')] - public function gc(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $max_lifetime); + #[TentativeType] + public function gc(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $max_lifetime): int|false; /** * Initialize session @@ -63,10 +67,11 @@ public function gc(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $max *

* @since 5.4 */ + #[TentativeType] public function open( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name - ); + ): bool; /** * Read session data @@ -79,7 +84,8 @@ public function open( *

* @since 5.4 */ - public function read(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id); + #[TentativeType] + public function read(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id): string|false; /** * Write session data @@ -98,10 +104,11 @@ public function read(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] *

* @since 5.4 */ + #[TentativeType] public function write( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data - ); + ): bool; } /** @@ -118,7 +125,8 @@ interface SessionIdInterface * The new session ID. Note that this value is returned internally to PHP for processing. *

*/ - public function create_sid(); + #[TentativeType] + public function create_sid(): string; } /** @@ -138,7 +146,8 @@ interface SessionUpdateTimestampHandlerInterface * Note this value is returned internally to PHP for processing. *

*/ - public function validateId(string $id); + #[TentativeType] + public function validateId(string $id): bool; /** * Update timestamp of a session @@ -153,7 +162,8 @@ public function validateId(string $id); *

* @return bool */ - public function updateTimestamp(string $id, string $data); + #[TentativeType] + public function updateTimestamp(string $id, string $data): bool; } /** @@ -182,7 +192,8 @@ class SessionHandler implements SessionHandlerInterface, SessionIdInterface *

* @since 5.4 */ - public function close() {} + #[TentativeType] + public function close(): bool {} /** * Return a new session ID @@ -190,7 +201,8 @@ public function close() {} * @return string

A session ID valid for the default session handler.

* @since 5.5.1 */ - public function create_sid() {} + #[TentativeType] + public function create_sid(): string {} /** * Destroy a session @@ -202,7 +214,8 @@ public function create_sid() {} *

* @since 5.4 */ - public function destroy(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id) {} + #[TentativeType] + public function destroy(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id): bool {} /** * Cleanup old sessions @@ -217,7 +230,8 @@ public function destroy(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ' *

* @since 5.4 */ - public function gc(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $max_lifetime) {} + #[TentativeType] + public function gc(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $max_lifetime): int|false {} /** * Initialize session @@ -230,10 +244,11 @@ public function gc(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $max *

* @since 5.4 */ + #[TentativeType] public function open( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name - ) {} + ): bool {} /** * Read session data @@ -246,7 +261,8 @@ public function open( *

* @since 5.4 */ - public function read(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id) {} + #[TentativeType] + public function read(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id): string|false {} /** * Write session data @@ -265,10 +281,11 @@ public function read(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] *

* @since 5.4 */ + #[TentativeType] public function write( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $id, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data - ) {} + ): bool {} /** * Validate session id diff --git a/soap/soap.php b/soap/soap.php index 423052931..f0fba940d 100644 --- a/soap/soap.php +++ b/soap/soap.php @@ -3,6 +3,8 @@ // Start of soap v. use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; +use JetBrains\PhpStorm\Pure; /** * The SoapClient class provides a client for SOAP 1.1, SOAP 1.2 servers. It can be used in WSDL @@ -275,10 +277,11 @@ public function __construct( * @since 5.0.1 */ #[Deprecated] + #[TentativeType] public function __call( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, array $args - ) {} + ): mixed {} /** * Calls a SOAP function @@ -321,62 +324,69 @@ public function __call( * option set to FALSE, a SoapFault object will be returned. * @since 5.0.1 */ + #[TentativeType] public function __soapCall( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, array $args, #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $options = null, $inputHeaders = null, &$outputHeaders = null - ) {} + ): mixed {} /** * Returns last SOAP request * @link https://php.net/manual/en/soapclient.getlastrequest.php - * @return string The last SOAP request, as an XML string. + * @return string|null The last SOAP request, as an XML string. * @since 5.0.1 */ - public function __getLastRequest() {} + #[TentativeType] + public function __getLastRequest(): ?string {} /** * Returns last SOAP response * @link https://php.net/manual/en/soapclient.getlastresponse.php - * @return string The last SOAP response, as an XML string. + * @return string|null The last SOAP response, as an XML string. * @since 5.0.1 */ - public function __getLastResponse() {} + #[TentativeType] + public function __getLastResponse(): ?string {} /** * Returns the SOAP headers from the last request * @link https://php.net/manual/en/soapclient.getlastrequestheaders.php - * @return string The last SOAP request headers. + * @return string|null The last SOAP request headers. * @since 5.0.1 */ - public function __getLastRequestHeaders() {} + #[TentativeType] + public function __getLastRequestHeaders(): ?string {} /** * Returns the SOAP headers from the last response * @link https://php.net/manual/en/soapclient.getlastresponseheaders.php - * @return string The last SOAP response headers. + * @return string|null The last SOAP response headers. * @since 5.0.1 */ - public function __getLastResponseHeaders() {} + #[TentativeType] + public function __getLastResponseHeaders(): ?string {} /** * Returns list of available SOAP functions * @link https://php.net/manual/en/soapclient.getfunctions.php - * @return array The array of SOAP function prototypes, detailing the return type, + * @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() {} + #[TentativeType] + public function __getFunctions(): ?array {} /** * Returns a list of SOAP types * @link https://php.net/manual/en/soapclient.gettypes.php - * @return array The array of SOAP types, detailing all structures and types. + * @return array|null The array of SOAP types, detailing all structures and types. * @since 5.0.1 */ - public function __getTypes() {} + #[TentativeType] + public function __getTypes(): ?array {} /** * Returns a list of all cookies @@ -384,7 +394,8 @@ public function __getTypes() {} * @return array The array of all cookies * @since 5.4.3 */ - public function __getCookies() {} + #[TentativeType] + public function __getCookies(): array {} /** * Performs a SOAP request @@ -408,13 +419,14 @@ public function __getCookies() {} * @return string|null The XML SOAP response. * @since 5.0.1 */ + #[TentativeType] public function __doRequest( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $request, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $location, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $action, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $version, #[LanguageLevelTypeAware(["8.0" => 'bool'], default: 'int')] $oneWay = false - ) {} + ): ?string {} /** * The __setCookie purpose @@ -428,10 +440,11 @@ public function __doRequest( * @return void No value is returned. * @since 5.0.4 */ + #[TentativeType] public function __setCookie( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(["8.0" => "string|null"], default: "string")] $value - ) {} + ): void {} /** * Sets the location of the Web service to use @@ -442,7 +455,8 @@ public function __setCookie( * @return string|null The old endpoint URL. * @since 5.0.1 */ - public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $location = '') {} + #[TentativeType] + public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $location = ''): ?string {} /** * Sets SOAP headers for subsequent calls @@ -455,7 +469,8 @@ public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], * @return bool TRUE on success or FALSE on failure. * @since 5.0.5 */ - public function __setSoapHeaders($headers = null) {} + #[TentativeType] + public function __setSoapHeaders($headers = null): bool {} } /** @@ -673,7 +688,8 @@ public function SoapServer($wsdl, array $options = null) {} * @return void No value is returned. * @since 5.1.2 */ - public function setPersistence(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode) {} + #[TentativeType] + public function setPersistence(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode): void {} /** * Sets the class which handles SOAP requests @@ -685,10 +701,11 @@ public function setPersistence(#[LanguageLevelTypeAware(['8.0' => 'int'], defaul * @return void No value is returned. * @since 5.0.1 */ + #[TentativeType] public function setClass( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $class, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args - ) {} + ): void {} /** * Sets the object which will be used to handle SOAP requests @@ -698,7 +715,8 @@ public function setClass( *

* @return void No value is returned. */ - public function setObject(object $object) {} + #[TentativeType] + public function setObject(object $object): void {} /** * Adds one or more functions to handle SOAP requests @@ -722,7 +740,8 @@ public function setObject(object $object) {} * @return void No value is returned. * @since 5.0.1 */ - public function addFunction($functions) {} + #[TentativeType] + public function addFunction($functions): void {} /** * Returns list of defined functions @@ -730,7 +749,8 @@ public function addFunction($functions) {} * @return array An array of the defined functions. * @since 5.0.1 */ - public function getFunctions() {} + #[TentativeType] + public function getFunctions(): array {} /** * Handles a SOAP request @@ -742,7 +762,8 @@ public function getFunctions() {} * @return void No value is returned. * @since 5.0.1 */ - public function handle(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $request = null) {} + #[TentativeType] + public function handle(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $request = null): void {} /** * Issue SoapServer fault indicating an error @@ -765,13 +786,14 @@ public function handle(#[LanguageLevelTypeAware(['8.0' => 'string|null'], defaul * @return void No value is returned. * @since 5.0.1 */ + #[TentativeType] public function fault( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $code, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $actor = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $details = null, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name = null - ) {} + ): void {} /** * Add a SOAP header to the response @@ -782,7 +804,8 @@ public function fault( * @return void No value is returned. * @since 5.0.1 */ - public function addSoapHeader(SoapHeader $header) {} + #[TentativeType] + public function addSoapHeader(SoapHeader $header): void {} } /** @@ -863,7 +886,7 @@ class SoapFault extends Exception *

* @since 5.0.1 */ - #[\JetBrains\PhpStorm\Pure] + #[Pure] public function __construct( #[LanguageLevelTypeAware(['8.0' => 'array|string|null'], default: '')] $code, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, @@ -906,6 +929,7 @@ public function SoapFault($faultcode, $faultstring, $faultactor = null, $detail * @return string A string describing the SoapFault. * @since 5.0.1 */ + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function __toString() {} } diff --git a/sqlite3/sqlite3.php b/sqlite3/sqlite3.php index 2b1c37ac0..1b32e974a 100644 --- a/sqlite3/sqlite3.php +++ b/sqlite3/sqlite3.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; /** * A class that interfaces SQLite 3 databases. @@ -69,11 +70,12 @@ class SQLite3 *

* @return void No value is returned. */ + #[TentativeType] public function open( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null - ) {} + ): void {} /** * Closes the database connection @@ -91,7 +93,8 @@ public function close() {} *

* @return bool TRUE if the query succeeded, FALSE on failure. */ - public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query) {} + #[TentativeType] + public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query): bool {} /** * Returns the SQLite3 library version as a string constant and as a number @@ -100,14 +103,16 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] * "versionNumber". */ #[ArrayShape(["versionString" => "string", "versionNumber" => "int"])] - public static function version() {} + #[TentativeType] + public static function version(): array {} /** * Returns the row ID of the most recent INSERT into the database * @link https://php.net/manual/en/sqlite3.lastinsertrowid.php * @return int the row ID of the most recent INSERT into the database */ - public function lastInsertRowID() {} + #[TentativeType] + public function lastInsertRowID(): int {} /** * Returns the numeric result code of the most recent failed SQLite request @@ -115,14 +120,16 @@ public function lastInsertRowID() {} * @return int an integer value representing the numeric result code of the most * recent failed SQLite request. */ - public function lastErrorCode() {} + #[TentativeType] + public function lastErrorCode(): int {} /** * Returns English text describing the most recent failed SQLite request * @link https://php.net/manual/en/sqlite3.lasterrormsg.php * @return string an English string describing the most recent failed SQLite request. */ - public function lastErrorMsg() {} + #[TentativeType] + public function lastErrorMsg(): string {} /** * Sets the busy connection handler @@ -134,7 +141,8 @@ public function lastErrorMsg() {} * @return bool TRUE on success, FALSE on failure. * @since 5.3.3 */ - public function busyTimeout(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $milliseconds) {} + #[TentativeType] + public function busyTimeout(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $milliseconds): bool {} /** * Attempts to load an SQLite extension library @@ -145,7 +153,8 @@ public function busyTimeout(#[LanguageLevelTypeAware(['8.0' => 'int'], default: *

* @return bool TRUE if the extension is successfully loaded, FALSE on failure. */ - public function loadExtension(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function loadExtension(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Returns the number of database rows that were changed (or inserted or @@ -155,7 +164,8 @@ public function loadExtension(#[LanguageLevelTypeAware(['8.0' => 'string'], defa * database rows changed (or inserted or deleted) by the most recent SQL * statement. */ - public function changes() {} + #[TentativeType] + public function changes(): int {} /** * Returns a string that has been properly escaped @@ -166,7 +176,8 @@ public function changes() {} * @return string a properly escaped string that may be used safely in an SQL * statement. */ - public static function escapeString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string) {} + #[TentativeType] + public static function escapeString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string): string {} /** * Prepares an SQL statement for execution @@ -176,7 +187,8 @@ public static function escapeString(#[LanguageLevelTypeAware(['8.0' => 'string'] *

* @return SQLite3Stmt|false an SQLite3Stmt object on success or FALSE on failure. */ - public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query) {} + #[TentativeType] + public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query): SQLite3Stmt|false {} /** * Executes an SQL query @@ -186,7 +198,8 @@ public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ' *

* @return SQLite3Result|false an SQLite3Result object, or FALSE on failure. */ - public function query(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query) {} + #[TentativeType] + public function query(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query): SQLite3Result|false {} /** * Executes a query and returns a single result @@ -211,10 +224,11 @@ public function query(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '') *

* Invalid or failing queries will return FALSE. */ + #[TentativeType] public function querySingle( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $entireRow = false - ) {} + ): mixed {} /** * Registers a PHP function for use as an SQL scalar function @@ -237,12 +251,13 @@ public function querySingle( * the same result given the same inputs within a single SQL statement.

* @return bool TRUE upon successful creation of the function, FALSE on failure. */ + #[TentativeType] public function createFunction( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $argCount = -1, int $flags = 0 - ) {} + ): bool {} /** * Registers a PHP function for use as an SQL aggregate function @@ -266,12 +281,13 @@ public function createFunction( * @return bool TRUE upon successful creation of the aggregate, FALSE on * failure. */ + #[TentativeType] public function createAggregate( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $stepCallback, #[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $finalCallback, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $argCount = -1 - ) {} + ): bool {} /** * Registers a PHP function for use as an SQL collating function @@ -289,7 +305,8 @@ public function createAggregate( * @return bool TRUE on success or FALSE on failure. * @since 5.3.11 */ - public function createCollation(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, callable $callback) {} + #[TentativeType] + public function createCollation(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, callable $callback): bool {} /** * Opens a stream resource to read a BLOB @@ -316,7 +333,8 @@ public function openBlob( * @param bool $enable * @return bool Returns the old value; true if exceptions were enabled, false otherwise. */ - public function enableExceptions(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $enable = false) {} + #[TentativeType] + public function enableExceptions(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $enable = false): bool {} /** * Instantiates an SQLite3 object and opens an SQLite 3 database @@ -347,13 +365,15 @@ public function __construct( * @return int * @since 7.4 */ - public function lastExtendedErrorCode() {} + #[TentativeType] + public function lastExtendedErrorCode(): int {} /** * @param bool $enable * @since 7.4 */ - public function enableExtendedResultCodes(bool $enable = true) {} + #[TentativeType] + public function enableExtendedResultCodes(bool $enable = true): bool {} /** * @param SQLite3 $destination @@ -362,14 +382,16 @@ public function enableExtendedResultCodes(bool $enable = true) {} * @return bool * @since 7.4 */ - public function backup(SQLite3 $destination, string $sourceDatabase = 'main', string $destinationDatabase = 'main') {} + #[TentativeType] + public function backup(SQLite3 $destination, string $sourceDatabase = 'main', string $destinationDatabase = 'main'): bool {} /** * @param null|callable $callback * @return bool * @since 8.0 */ - public function setAuthorizer(?callable $callback) {} + #[TentativeType] + public function setAuthorizer(?callable $callback): bool {} } /** @@ -383,21 +405,24 @@ class SQLite3Stmt * @link https://php.net/manual/en/sqlite3stmt.paramcount.php * @return int the number of parameters within the prepared statement. */ - public function paramCount() {} + #[TentativeType] + public function paramCount(): int {} /** * Closes the prepared statement * @link https://php.net/manual/en/sqlite3stmt.close.php * @return bool TRUE */ - public function close() {} + #[TentativeType] + public function close(): bool {} /** * Resets the prepared statement * @link https://php.net/manual/en/sqlite3stmt.reset.php * @return bool TRUE if the statement is successfully reset, FALSE on failure. */ - public function reset() {} + #[TentativeType] + public function reset(): bool {} /** * Clears all current bound parameters @@ -405,7 +430,8 @@ public function reset() {} * @return bool TRUE on successful clearing of bound parameters, FALSE on * failure. */ - public function clear() {} + #[TentativeType] + public function clear(): bool {} /** * Executes a prepared statement and returns a result set object @@ -413,7 +439,8 @@ public function clear() {} * @return SQLite3Result|false an SQLite3Result object on successful execution of the prepared * statement, FALSE on failure. */ - public function execute() {} + #[TentativeType] + public function execute(): SQLite3Result|false {} /** * Binds a parameter to a statement variable @@ -436,11 +463,12 @@ public function execute() {} * @return bool TRUE if the parameter is bound to the statement variable, FALSE * on failure. */ + #[TentativeType] public function bindParam( #[LanguageLevelTypeAware(['8.0' => 'string|int'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = SQLITE3_TEXT - ) {} + ): bool {} /** * Binds the value of a parameter to a statement variable @@ -463,13 +491,15 @@ public function bindParam( * @return bool TRUE if the value is bound to the statement variable, FALSE * on failure. */ + #[TentativeType] public function bindValue( #[LanguageLevelTypeAware(['8.0' => 'string|int'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = SQLITE3_TEXT - ) {} + ): bool {} - public function readOnly() {} + #[TentativeType] + public function readOnly(): bool {} /** * @param SQLite3 $sqlite3 @@ -487,7 +517,8 @@ private function __construct( * @return string|false Returns the SQL of the prepared statement, or FALSE on failure. * @since 7.4 */ - public function getSQL(bool $expand = false) {} + #[TentativeType] + public function getSQL(bool $expand = false): string|false {} } /** @@ -501,7 +532,8 @@ class SQLite3Result * @link https://php.net/manual/en/sqlite3result.numcolumns.php * @return int the number of columns in the result set. */ - public function numColumns() {} + #[TentativeType] + public function numColumns(): int {} /** * Returns the name of the nth column @@ -509,10 +541,11 @@ public function numColumns() {} * @param int $column

* The numeric zero-based index of the column. *

- * @return string the string name of the column identified by + * @return string|false the string name of the column identified by * column_number. */ - public function columnName(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column) {} + #[TentativeType] + public function columnName(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): string|false {} /** * Returns the type of the nth column @@ -520,13 +553,14 @@ public function columnName(#[LanguageLevelTypeAware(['8.0' => 'int'], default: ' * @param int $column

* The numeric zero-based index of the column. *

- * @return int the data type index of the column identified by + * @return int|false the data type index of the column identified by * column_number (one of * SQLITE3_INTEGER, SQLITE3_FLOAT, * SQLITE3_TEXT, SQLITE3_BLOB, or * SQLITE3_NULL). */ - public function columnType(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column) {} + #[TentativeType] + public function columnType(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): int|false {} /** * Fetches a result row as an associative or numerically indexed array or both @@ -543,7 +577,8 @@ public function columnType(#[LanguageLevelTypeAware(['8.0' => 'int'], default: ' * @return array|false a result row as an associatively or numerically indexed array or * both. Alternately will return FALSE if there are no more rows. */ - public function fetchArray(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = SQLITE3_BOTH) {} + #[TentativeType] + public function fetchArray(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = SQLITE3_BOTH): array|false {} /** * Resets the result set back to the first row @@ -551,7 +586,8 @@ public function fetchArray(#[LanguageLevelTypeAware(['8.0' => 'int'], default: ' * @return bool TRUE if the result set is successfully reset * back to the first row, FALSE on failure. */ - public function reset() {} + #[TentativeType] + public function reset(): bool {} /** * Closes the result set diff --git a/standard/_types.php b/standard/_types.php index 5a92c1543..5edb31580 100644 --- a/standard/_types.php +++ b/standard/_types.php @@ -15,7 +15,7 @@ *

* @return array an array of the parameters. The parameters can be given an index with the => operator. */ - function PS_UNRESERVE_PREFIX_array(...$_) {}; + function PS_UNRESERVE_PREFIX_array(...$_) {} /** * Assigns a list of variables in one operation. @@ -24,7 +24,7 @@ function PS_UNRESERVE_PREFIX_array(...$_) {}; * @param mixed ...$_ [optional]

Another variable ...

* @return array the assigned array. */ - function PS_UNRESERVE_PREFIX_list($var1, ...$_) {}; + function PS_UNRESERVE_PREFIX_list($var1, ...$_) {} /** *

Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit is called.

@@ -42,7 +42,7 @@ function PS_UNRESERVE_PREFIX_list($var1, ...$_) {}; *

* @return void */ - function PS_UNRESERVE_PREFIX_die($status = "") {}; + function PS_UNRESERVE_PREFIX_die($status = "") {} /** *

Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit is called.

@@ -60,7 +60,7 @@ function PS_UNRESERVE_PREFIX_die($status = "") {}; *

* @return void */ - function PS_UNRESERVE_PREFIX_exit($status = "") {}; + function PS_UNRESERVE_PREFIX_exit($status = "") {} /** * Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value @@ -89,7 +89,7 @@ function PS_UNRESERVE_PREFIX_exit($status = "") {}; * *

*/ - function PS_UNRESERVE_PREFIX_empty($var) {}; + function PS_UNRESERVE_PREFIX_empty($var) {} /** *

Determine if a variable is set and is not NULL.

@@ -102,7 +102,7 @@ function PS_UNRESERVE_PREFIX_empty($var) {}; * @param mixed ...$_ [optional]

Another variable ...

* @return bool Returns TRUE if var exists and has value other than NULL, FALSE otherwise. */ - function PS_UNRESERVE_PREFIX_isset($var, ...$_) {}; + function PS_UNRESERVE_PREFIX_isset($var, ...$_) {} /** *

Destroys the specified variables.

@@ -112,7 +112,7 @@ function PS_UNRESERVE_PREFIX_isset($var, ...$_) {}; * @param mixed ...$_ [optional]

Another variable ...

* @return void */ - function PS_UNRESERVE_PREFIX_unset($var, ...$_) {}; + function PS_UNRESERVE_PREFIX_unset($var, ...$_) {} /** *

Evaluates the given code as PHP.

@@ -144,7 +144,7 @@ function PS_UNRESERVE_PREFIX_unset($var, ...$_) {}; * case eval() returned FALSE and execution of the following code continued normally. It is not possible to catch a parse * error in eval() using set_error_handler(). */ - function PS_UNRESERVE_PREFIX_eval($code) {}; + function PS_UNRESERVE_PREFIX_eval($code) {} /** * Generator objects are returned from generators, cannot be instantiated via new. @@ -152,55 +152,59 @@ function PS_UNRESERVE_PREFIX_eval($code) {}; * @link https://wiki.php.net/rfc/generators */ final class Generator implements Iterator -{ + { /** * Throws an exception if the generator is currently after the first yield. * @return void */ - public function rewind() {} + public function rewind(): void {} + /** * Returns false if the generator has been closed, true otherwise. * @return bool */ - public function valid() {} + public function valid(): bool {} + /** * Returns whatever was passed to yield or null if nothing was passed or the generator is already closed. * @return mixed */ - public function current() {} + public function current(): mixed {} + /** * Returns the yielded key or, if none was specified, an auto-incrementing key or null if the generator is already closed. - * @return string|float|int|bool|null + * @return mixed */ - public function key() {} + public function key(): mixed {} + /** * Resumes the generator (unless the generator is already closed). * @return void */ - public function next() {} + public function next(): void {} /** * Sets the return value of the yield expression and resumes the generator (unless the generator is already closed). * @param mixed $value * @return mixed */ - public function send(mixed $value) {} + public function send(mixed $value): mixed {} /** * Throws an exception at the current suspension point in the generator. * @param Throwable $exception * @return mixed */ - public function PS_UNRESERVE_PREFIX_throw(Throwable $exception) {} + public function PS_UNRESERVE_PREFIX_throw(Throwable $exception): mixed {} /** * Returns whatever was passed to return or null if nothing. * Throws an exception if the generator is still valid. * @link https://wiki.php.net/rfc/generator-return-expressions - * @return mixed|null + * @return mixed * @since 7.0 */ - public function getReturn() {} + public function getReturn(): mixed {} /** * Serialize callback @@ -215,181 +219,184 @@ class ClosedGeneratorException extends Exception {} } namespace ___PHPSTORM_HELPERS { -class PS_UNRESERVE_PREFIX_this {} -class PS_UNRESERVE_PREFIX_static {} -class object -{ - /** - * PHP 5 allows developers to declare constructor methods for classes. - * Classes which have a constructor method call this method on each newly-created object, - * so it is suitable for any initialization that the object may need before it is used. - * - * Note: Parent constructors are not called implicitly if the child class defines a constructor. - * In order to run a parent constructor, a call to parent::__construct() within the child constructor is required. - * - * param [ mixed $args [, $... ]] - * @link https://php.net/manual/en/language.oop5.decon.php - */ - public function __construct() {} - - /** - * PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++. - * The destructor method will be called as soon as all references to a particular object are removed or - * when the object is explicitly destroyed or in any order in shutdown sequence. - * - * Like constructors, parent destructors will not be called implicitly by the engine. - * In order to run a parent destructor, one would have to explicitly call parent::__destruct() in the destructor body. - * - * Note: Destructors called during the script shutdown have HTTP headers already sent. - * The working directory in the script shutdown phase can be different with some SAPIs (e.g. Apache). - * - * Note: Attempting to throw an exception from a destructor (called in the time of script termination) causes a fatal error. - * - * @return void - * @link https://php.net/manual/en/language.oop5.decon.php - */ - public function __destruct() {} - - /** - * is triggered when invoking inaccessible methods in an object context. - * - * @param string $name - * @param array $arguments - * @return mixed - * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods - */ - public function __call(string $name, array $arguments) {} - - /** - * is triggered when invoking inaccessible methods in a static context. - * - * @param string $name - * @param array $arguments - * @return mixed - * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods - */ - public static function __callStatic(string $name, array $arguments) {} - - /** - * is utilized for reading data from inaccessible members. - * - * @param string $name - * @return mixed - * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members - */ - public function __get(string $name) {} - - /** - * run when writing data to inaccessible members. - * - * @param string $name - * @param mixed $value - * @return void - * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members - */ - public function __set(string $name, $value): void {} - - /** - * is triggered by calling isset() or empty() on inaccessible members. - * - * @param string $name - * @return bool - * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members - */ - public function __isset(string $name): bool {} - /** - * is invoked when unset() is used on inaccessible members. - * - * @param string $name - * @return void - * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members - */ - public function __unset(string $name): void {} - - /** - * serialize() checks if your class has a function with the magic name __sleep. - * If so, that function is executed prior to any serialization. - * It can clean up the object and is supposed to return an array with the names of all variables of that object that should be serialized. - * If the method doesn't return anything then NULL is serialized and E_NOTICE is issued. - * The intended use of __sleep is to commit pending data or perform similar cleanup tasks. - * Also, the function is useful if you have very large objects which do not need to be saved completely. - * - * @return string[] - * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep - */ - public function __sleep(): array {} - - /** - * unserialize() checks for the presence of a function with the magic name __wakeup. - * If present, this function can reconstruct any resources that the object may have. - * The intended use of __wakeup is to reestablish any database connections that may have been lost during - * serialization and perform other reinitialization tasks. - * - * @return void - * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep - */ - public function __wakeup(): void {} - - /** - * The __toString method allows a class to decide how it will react when it is converted to a string. - * - * @return string - * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring - */ - public function __toString(): string {} - - /** - * The __invoke method is called when a script tries to call an object as a function. - * - * @return mixed - * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.invoke - */ - public function __invoke() {} + class PS_UNRESERVE_PREFIX_this {} - /** - * This method is called by var_dump() when dumping an object to get the properties that should be shown. - * If the method isn't defined on an object, then all public, protected and private properties will be shown. - * - * @return array|null - * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - */ - public function __debugInfo(): ?array {} - - /** - * This static method is called for classes exported by var_export() since PHP 5.1.0. - * The only parameter of this method is an array containing exported properties in the form array('property' => value, ...). - * - * @param array $an_array - * @return object - * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.set-state - */ - public static function __set_state(array $an_array): object {} - - /** - * When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties. - * Any properties that are references to other variables, will remain references. - * Once the cloning is complete, if a __clone() method is defined, - * then the newly created object's __clone() method will be called, to allow any necessary properties that need to be changed. - * NOT CALLABLE DIRECTLY. - * - * @return void - * @link https://php.net/manual/en/language.oop5.cloning.php - */ - public function __clone(): void {} + class PS_UNRESERVE_PREFIX_static {} - /** - * Returns array containing all the necessary state of the object. - * @since 7.4 - * @link https://wiki.php.net/rfc/custom_object_serialization - */ - public function __serialize(): array {} + class object + { + /** + * PHP 5 allows developers to declare constructor methods for classes. + * Classes which have a constructor method call this method on each newly-created object, + * so it is suitable for any initialization that the object may need before it is used. + * + * Note: Parent constructors are not called implicitly if the child class defines a constructor. + * In order to run a parent constructor, a call to parent::__construct() within the child constructor is required. + * + * param [ mixed $args [, $... ]] + * @link https://php.net/manual/en/language.oop5.decon.php + */ + public function __construct() {} - /** - * Restores the object state from the given data array. - * @param array $data - * @since 7.4 - * @link https://wiki.php.net/rfc/custom_object_serialization - */ - public function __unserialize(array $data): void {} -} + /** + * PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++. + * The destructor method will be called as soon as all references to a particular object are removed or + * when the object is explicitly destroyed or in any order in shutdown sequence. + * + * Like constructors, parent destructors will not be called implicitly by the engine. + * In order to run a parent destructor, one would have to explicitly call parent::__destruct() in the destructor body. + * + * Note: Destructors called during the script shutdown have HTTP headers already sent. + * The working directory in the script shutdown phase can be different with some SAPIs (e.g. Apache). + * + * Note: Attempting to throw an exception from a destructor (called in the time of script termination) causes a fatal error. + * + * @return void + * @link https://php.net/manual/en/language.oop5.decon.php + */ + public function __destruct() {} + + /** + * is triggered when invoking inaccessible methods in an object context. + * + * @param string $name + * @param array $arguments + * @return mixed + * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods + */ + public function __call(string $name, array $arguments) {} + + /** + * is triggered when invoking inaccessible methods in a static context. + * + * @param string $name + * @param array $arguments + * @return mixed + * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods + */ + public static function __callStatic(string $name, array $arguments) {} + + /** + * is utilized for reading data from inaccessible members. + * + * @param string $name + * @return mixed + * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members + */ + public function __get(string $name) {} + + /** + * run when writing data to inaccessible members. + * + * @param string $name + * @param mixed $value + * @return void + * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members + */ + public function __set(string $name, $value): void {} + + /** + * is triggered by calling isset() or empty() on inaccessible members. + * + * @param string $name + * @return bool + * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members + */ + public function __isset(string $name): bool {} + + /** + * is invoked when unset() is used on inaccessible members. + * + * @param string $name + * @return void + * @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members + */ + public function __unset(string $name): void {} + + /** + * serialize() checks if your class has a function with the magic name __sleep. + * If so, that function is executed prior to any serialization. + * It can clean up the object and is supposed to return an array with the names of all variables of that object that should be serialized. + * If the method doesn't return anything then NULL is serialized and E_NOTICE is issued. + * The intended use of __sleep is to commit pending data or perform similar cleanup tasks. + * Also, the function is useful if you have very large objects which do not need to be saved completely. + * + * @return string[] + * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep + */ + public function __sleep(): array {} + + /** + * unserialize() checks for the presence of a function with the magic name __wakeup. + * If present, this function can reconstruct any resources that the object may have. + * The intended use of __wakeup is to reestablish any database connections that may have been lost during + * serialization and perform other reinitialization tasks. + * + * @return void + * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep + */ + public function __wakeup(): void {} + + /** + * The __toString method allows a class to decide how it will react when it is converted to a string. + * + * @return string + * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring + */ + public function __toString(): string {} + + /** + * The __invoke method is called when a script tries to call an object as a function. + * + * @return mixed + * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.invoke + */ + public function __invoke() {} + + /** + * This method is called by var_dump() when dumping an object to get the properties that should be shown. + * If the method isn't defined on an object, then all public, protected and private properties will be shown. + * + * @return array|null + * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo + */ + public function __debugInfo(): ?array {} + + /** + * This static method is called for classes exported by var_export() since PHP 5.1.0. + * The only parameter of this method is an array containing exported properties in the form array('property' => value, ...). + * + * @param array $an_array + * @return object + * @link https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.set-state + */ + public static function __set_state(array $an_array): object {} + + /** + * When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties. + * Any properties that are references to other variables, will remain references. + * Once the cloning is complete, if a __clone() method is defined, + * then the newly created object's __clone() method will be called, to allow any necessary properties that need to be changed. + * NOT CALLABLE DIRECTLY. + * + * @return void + * @link https://php.net/manual/en/language.oop5.cloning.php + */ + public function __clone(): void {} + + /** + * Returns array containing all the necessary state of the object. + * @since 7.4 + * @link https://wiki.php.net/rfc/custom_object_serialization + */ + public function __serialize(): array {} + + /** + * Restores the object state from the given data array. + * @param array $data + * @since 7.4 + * @link https://wiki.php.net/rfc/custom_object_serialization + */ + public function __unserialize(array $data): void {} + } } diff --git a/standard/standard_0.php b/standard/standard_0.php index 90720886e..78004d9b8 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -5,14 +5,15 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\ExpectedValues; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; class __PHP_Incomplete_Class { - /** - * @var string - */ - public $__PHP_Incomplete_Class_Name; + /** + * @var string + */ + public $__PHP_Incomplete_Class_Name; } class php_user_filter @@ -68,23 +69,26 @@ class php_user_filter * * */ + #[TentativeType] public function filter( $in, $out, &$consumed, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $closing - ) {} + ): int {} /** * @link https://php.net/manual/en/php-user-filter.oncreate.php * @return bool */ - public function onCreate() {} + #[TentativeType] + public function onCreate(): bool {} /** * @link https://php.net/manual/en/php-user-filter.onclose.php */ - public function onClose() {} + #[TentativeType] + public function onClose(): void {} } /** diff --git a/standard/standard_8.php b/standard/standard_8.php index 0c7537d35..d101e2bc8 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -81,8 +81,6 @@ function header_register_callback(callable $callback): bool {} /** * Get the size of an image from a string. - * @since 5.4 - * @link https://secure.php.net/manual/en/function.getimagesizefromstring.php * @param string $string The image data, as a string. * @param array &$image_info [optional] This optional parameter allows you to extract
* some extended information from the image file. Currently, this will
@@ -98,6 +96,8 @@ function header_register_callback(callable $callback): bool {} * On failure, FALSE is returned. * @link https://secure.php.net/manual/en/function.getimagesizefromstring.php * @since 5.4 + * @link https://secure.php.net/manual/en/function.getimagesizefromstring.php + * @since 5.4 */ function getimagesizefromstring(string $string, &$image_info): array|false {} @@ -650,7 +650,7 @@ function count(Countable|array $value, int $mode = COUNT_NORMAL): int {} * a function returning an array because only actual variables may be * passed by reference. *

- * @return mixed|false the value of the last element or false for empty array. + * @return mixed the value of the last element or false for empty array. * @meta */ function end(object|array &$array): mixed {} @@ -812,7 +812,7 @@ function array_search(mixed $needle, array $haystack, bool $strict = false): str /** * Import variables into the current symbol table from an array * @link https://php.net/manual/en/function.extract.php - * @param array &$array

+ * @param array &$array

* Note that prefix is only required if * extract_type is EXTR_PREFIX_SAME, * EXTR_PREFIX_ALL, EXTR_PREFIX_INVALID @@ -838,14 +838,14 @@ function array_search(mixed $needle, array $haystack, bool $strict = false): str function extract( array &$array, #[ExpectedValues(flags: [ - EXTR_OVERWRITE, - EXTR_SKIP, - EXTR_PREFIX_SAME, - EXTR_PREFIX_ALL, - EXTR_PREFIX_INVALID, - EXTR_PREFIX_IF_EXISTS, - EXTR_REFS - ])] int $flags, + EXTR_OVERWRITE, + EXTR_SKIP, + EXTR_PREFIX_SAME, + EXTR_PREFIX_ALL, + EXTR_PREFIX_INVALID, + EXTR_PREFIX_IF_EXISTS, + EXTR_REFS + ])] int $flags, string $prefix ): int {} diff --git a/standard/standard_9.php b/standard/standard_9.php index fd4a61185..ed178439a 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -978,21 +978,21 @@ function version_compare( string $version1, string $version2, #[ExpectedValues(values: [ - "<", - "lt", - "<=", - "le", - ">", - "gt", - ">=", - "ge", - "==", - "=", - "eq", - "!=", - "<>", - "ne" - ])] ?string $operator + "<", + "lt", + "<=", + "le", + ">", + "gt", + ">=", + "ge", + "==", + "=", + "eq", + "!=", + "<>", + "ne" + ])] ?string $operator ): int|bool {} /** diff --git a/tests/DockerImages/8.1/Dockerfile b/tests/DockerImages/8.1/Dockerfile index 63d06aa3d..6b17acb15 100644 --- a/tests/DockerImages/8.1/Dockerfile +++ b/tests/DockerImages/8.1/Dockerfile @@ -6,7 +6,7 @@ RUN set -eux; \ libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - gpgme gpgme-dev + gpgme gpgme-dev git RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ - pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap + pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap \ diff --git a/tests/Model/BasePHPElement.php b/tests/Model/BasePHPElement.php index b1abffb9c..a0a81531a 100644 --- a/tests/Model/BasePHPElement.php +++ b/tests/Model/BasePHPElement.php @@ -6,6 +6,7 @@ use Exception; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; use phpDocumentor\Reflection\Type; use PhpParser\Node; use PhpParser\Node\AttributeGroup; @@ -197,6 +198,18 @@ protected static function findAvailableVersionsRangeFromAttribute(array $attrGro return $versionRange; } + protected static function hasTentativeTypeAttribute(array $attrGroups): bool + { + foreach ($attrGroups as $attrGroup) { + foreach ($attrGroup->attrs as $attr) { + if ($attr->name->toString() === TentativeType::class) { + return true; + } + } + } + return false; + } + public function hasMutedProblem(int $stubProblemType): bool { if (array_key_exists($stubProblemType, $this->mutedProblems)) { diff --git a/tests/Model/PHPFunction.php b/tests/Model/PHPFunction.php index 64c208d56..c6fe6a380 100644 --- a/tests/Model/PHPFunction.php +++ b/tests/Model/PHPFunction.php @@ -12,6 +12,7 @@ use PhpParser\Node\FunctionLike; use PhpParser\Node\Stmt\Function_; use ReflectionFunction; +use ReflectionFunctionAbstract; use RuntimeException; use stdClass; use StubTests\Parsers\DocFactoryProvider; @@ -37,7 +38,7 @@ class PHPFunction extends BasePHPElement public $returnTypesFromSignature = []; /** - * @param ReflectionFunction $reflectionObject + * @param ReflectionFunction|ReflectionFunctionAbstract $reflectionObject * @return static */ public function readObjectFromReflection($reflectionObject) @@ -84,7 +85,7 @@ public function readObjectFromStubNode($node) }); /** @var Param $relatedParamTag */ $relatedParamTag = array_pop($relatedParamTags); - if ($relatedParamTag !== null){ + if ($relatedParamTag !== null) { $parameter->isOptional = $parameter->isOptional || str_contains((string)$relatedParamTag->getDescription(), '[optional]'); } } diff --git a/tests/Model/PHPMethod.php b/tests/Model/PHPMethod.php index 2d77ee92b..74e0a397d 100644 --- a/tests/Model/PHPMethod.php +++ b/tests/Model/PHPMethod.php @@ -30,20 +30,21 @@ class PHPMethod extends PHPFunction */ public $parentName; + /** + * @var bool + */ + public $isReturnTypeTentative; + /** * @param ReflectionMethod $reflectionObject * @return static */ public function readObjectFromReflection($reflectionObject) { - $this->name = $reflectionObject->name; + parent::readObjectFromReflection($reflectionObject); $this->isStatic = $reflectionObject->isStatic(); $this->isFinal = $reflectionObject->isFinal(); $this->parentName = $reflectionObject->class; - foreach ($reflectionObject->getParameters() as $parameter) { - $this->parameters[] = (new PHPParameter())->readObjectFromReflection($parameter); - } - if ($reflectionObject->isProtected()) { $access = 'protected'; } elseif ($reflectionObject->isPrivate()) { @@ -52,6 +53,17 @@ public function readObjectFromReflection($reflectionObject) $access = 'public'; } $this->access = $access; + if (method_exists($reflectionObject, 'hasTentativeReturnType')) { + $this->isReturnTypeTentative = $reflectionObject->hasTentativeReturnType(); + if ($this->isReturnTypeTentative) { + $returnTypes = self::getReflectionTypeAsArray($reflectionObject->getTentativeReturnType()); + if (!empty($returnTypes)) { + array_push($this->returnTypesFromSignature, ...$returnTypes); + } + } + } else { + $this->isReturnTypeTentative = false; + } return $this; } @@ -65,6 +77,7 @@ public function readObjectFromStubNode($node) $this->parentName = self::getFQN($node->getAttribute('parent')); $this->name = $node->name->name; $typesFromAttribute = self::findTypesFromAttribute($node->attrGroups); + $this->isReturnTypeTentative = self::hasTentativeTypeAttribute($node->attrGroups); $this->availableVersionsRangeFromAttribute = self::findAvailableVersionsRangeFromAttribute($node->attrGroups); $this->returnTypesFromAttribute = $typesFromAttribute; array_push($this->returnTypesFromSignature, ...self::convertParsedTypeToArray($node->getReturnType())); diff --git a/tests/Model/PhpVersions.php b/tests/Model/PhpVersions.php index 47abf0ba0..f9ca94976 100644 --- a/tests/Model/PhpVersions.php +++ b/tests/Model/PhpVersions.php @@ -6,6 +6,7 @@ use ArrayAccess; use ArrayIterator; use IteratorAggregate; +use ReturnTypeWillChange; use RuntimeException; class PhpVersions implements ArrayAccess, IteratorAggregate @@ -27,16 +28,19 @@ public function offsetExists($offset): bool return isset(self::$versions[$offset]); } + #[ReturnTypeWillChange] public function offsetGet($offset) { return $this->offsetExists($offset) ? self::$versions[$offset] : null; } + #[ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new RuntimeException('Unsupported operation'); } + #[ReturnTypeWillChange] public function offsetUnset($offset) { throw new RuntimeException('Unsupported operation'); diff --git a/tests/StubsPhp81Tests.php b/tests/StubsPhp81Tests.php index 7b9c7c5a2..bdab566d5 100644 --- a/tests/StubsPhp81Tests.php +++ b/tests/StubsPhp81Tests.php @@ -4,6 +4,8 @@ use RuntimeException; use StubTests\Model\PHPClass; +use StubTests\Model\PHPInterface; +use StubTests\Model\PHPMethod; use StubTests\Model\PHPProperty; use StubTests\TestData\Providers\PhpStormStubsSingleton; @@ -23,4 +25,51 @@ public function testPropertyReadonly(PHPClass $class, PHPProperty $property) "Property $className::$property->name readonly modifier is incorrect" ); } + + /** + * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionMethodsProvider::classMethodsWithTentitiveReturnTypeProvider + * @throws RuntimeException + */ + public function testTentativeReturnTypeHints(PHPClass|PHPInterface $class, PHPMethod $method) + { + $functionName = $method->name; + if ($class instanceof PHPClass) { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class->name)->getMethod($functionName); + } else { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($class->name)->getMethod($functionName); + } + $unifiedStubsReturnTypes = []; + $unifiedStubsAttributesReturnTypes = []; + $unifiedReflectionReturnTypes = []; + self::convertNullableTypesToUnion($method->returnTypesFromSignature, $unifiedReflectionReturnTypes); + if (!empty($stubMethod->returnTypesFromSignature)) { + self::convertNullableTypesToUnion($stubMethod->returnTypesFromSignature, $unifiedStubsReturnTypes); + } else { + foreach ($stubMethod->returnTypesFromAttribute as $languageVersion => $listOfTypes) { + $unifiedStubsAttributesReturnTypes[$languageVersion] = []; + self::convertNullableTypesToUnion($listOfTypes, $unifiedStubsAttributesReturnTypes[$languageVersion]); + } + } + $conditionToCompareWithSignature = BaseStubsTest::isReflectionTypesMatchSignature( + $unifiedReflectionReturnTypes, + $unifiedStubsReturnTypes + ); + $typesFromAttribute = []; + if (!empty($unifiedStubsAttributesReturnTypes)) { + $typesFromAttribute = !empty($unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')]) ? + $unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')] : + $unifiedStubsAttributesReturnTypes['default']; + } + $conditionToCompareWithAttribute = BaseStubsTest::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); + $testCondition = $conditionToCompareWithSignature || $conditionToCompareWithAttribute; + self::assertTrue( + $testCondition, + "Method $class->name::$functionName has invalid return type. Reflection method has return type " . + implode('|', $method->returnTypesFromSignature) . + ' but stubs has return type ' . implode('|', $stubMethod->returnTypesFromSignature) . + ' in signature and attribute has types ' . implode('|', $typesFromAttribute) + ); + self::assertTrue($stubMethod->isReturnTypeTentative, "Reflection method $class->name::$functionName has " . + "tentative return type but stub's method isn't declared as tentative"); + } } diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index 489c40f74..44a97f6f5 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -80,7 +80,7 @@ public function testFunctionsParametersTypeHints(PHPFunction $function, PHPParam } /** - * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionMethodsProvider::classMethodsWithReturnTypeHintProvider + * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionMethodsProvider::classMethodsWithoutTentitiveReturnTypeProvider * @throws RuntimeException */ public function testMethodsReturnTypeHints(PHPClass|PHPInterface $class, PHPMethod $method) @@ -115,8 +115,8 @@ public function testMethodsReturnTypeHints(PHPClass|PHPInterface $class, PHPMeth } $conditionToCompareWithAttribute = BaseStubsTest::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); $testCondition = $conditionToCompareWithSignature || $conditionToCompareWithAttribute; - self::assertTrue($testCondition, "Function $functionName has invalid return type. - Reflection method $class->name::$functionName has return type " . implode('|', $method->returnTypesFromSignature) . ' but stubs has return type ' . + self::assertTrue($testCondition, "Method $class->name::$functionName has invalid return type. + Reflection method has return type " . implode('|', $method->returnTypesFromSignature) . ' but stubs has return type ' . implode('|', $stubMethod->returnTypesFromSignature) . ' in signature and attribute has types ' . implode('|', $typesFromAttribute)); } diff --git a/tests/TestData/Providers/EntitiesFilter.php b/tests/TestData/Providers/EntitiesFilter.php index 003ae866f..2eff58ef5 100644 --- a/tests/TestData/Providers/EntitiesFilter.php +++ b/tests/TestData/Providers/EntitiesFilter.php @@ -80,12 +80,6 @@ public static function getFilteredParameters(PHPFunction $function, callable $ad return $resultArray; } - public static function getFilterFunctionForLanguageLevel(float $languageVersion): callable - { - return fn (PHPClass|PHPInterface $class, PHPMethod $method, ?float $firstSinceVersion) => !$method->isFinal && - !$class->isFinal && $firstSinceVersion !== null && $firstSinceVersion < $languageVersion; - } - public static function getFilterFunctionForAllowedTypeHintsInLanguageLevel(float $languageVersion): callable { return function (PHPClass|PHPInterface $stubClass, PHPMethod $stubMethod, ?float $firstSinceVersion) use ($languageVersion) { diff --git a/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php b/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php index 7cbda376f..c1d32bb7a 100644 --- a/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php +++ b/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php @@ -4,6 +4,7 @@ namespace StubTests\TestData\Providers\Reflection; use Generator; +use StubTests\Model\PHPMethod; use StubTests\Model\StubProblemType; use StubTests\TestData\Providers\EntitiesFilter; use StubTests\TestData\Providers\ReflectionStubsSingleton; @@ -43,6 +44,38 @@ public static function classMethodsWithParametersProvider(): ?Generator ); } + public static function classMethodsWithoutTentitiveReturnTypeProvider(): ?Generator + { + $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { + foreach (EntitiesFilter::getFiltered( + $class->methods, + fn (PHPMethod $method) => $method->isReturnTypeTentative, + StubProblemType::HAS_DUPLICATION, + StubProblemType::FUNCTION_PARAMETER_MISMATCH + ) as $method) { + yield "Method $class->name::$method->name" => [$class, $method]; + } + } + } + + public static function classMethodsWithTentitiveReturnTypeProvider(): ?Generator + { + $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { + foreach (EntitiesFilter::getFiltered( + $class->methods, + fn (PHPMethod $method) => !$method->isReturnTypeTentative, + StubProblemType::HAS_DUPLICATION, + StubProblemType::FUNCTION_PARAMETER_MISMATCH + ) as $method) { + yield "Method $class->name::$method->name" => [$class, $method]; + } + } + } + private static function yieldFilteredMethods(int ...$problemTypes): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + diff --git a/tests/TestData/Providers/Stubs/StubMethodsProvider.php b/tests/TestData/Providers/Stubs/StubMethodsProvider.php index 0f68fb6f2..a1bd1e6f1 100644 --- a/tests/TestData/Providers/Stubs/StubMethodsProvider.php +++ b/tests/TestData/Providers/Stubs/StubMethodsProvider.php @@ -5,7 +5,9 @@ use Generator; use RuntimeException; +use StubTests\Model\PHPClass; use StubTests\Model\PHPFunction; +use StubTests\Model\PHPInterface; use StubTests\Model\PHPMethod; use StubTests\Model\StubProblemType; use StubTests\Parsers\ParserUtils; @@ -58,7 +60,7 @@ public static function allFunctionAndMethodsWithReturnTypeHintsProvider(): ?Gene */ public static function methodsForReturnTypeHintTestsProvider(): ?Generator { - $filterFunction = EntitiesFilter::getFilterFunctionForLanguageLevel(7); + $filterFunction = self::getFilterFunctionForLanguageLevel(7); return self::yieldFilteredMethods( $filterFunction, StubProblemType::FUNCTION_HAS_RETURN_TYPEHINT, @@ -71,7 +73,7 @@ public static function methodsForReturnTypeHintTestsProvider(): ?Generator */ public static function methodsForNullableReturnTypeHintTestsProvider(): ?Generator { - $filterFunction = EntitiesFilter::getFilterFunctionForLanguageLevel(7.1); + $filterFunction = self::getFilterFunctionForLanguageLevel(7.1); return self::yieldFilteredMethods( $filterFunction, StubProblemType::HAS_NULLABLE_TYPEHINT, @@ -84,7 +86,7 @@ public static function methodsForNullableReturnTypeHintTestsProvider(): ?Generat */ public static function methodsForUnionReturnTypeHintTestsProvider(): ?Generator { - $filterFunction = EntitiesFilter::getFilterFunctionForLanguageLevel(8); + $filterFunction = self::getFilterFunctionForLanguageLevel(8); return self::yieldFilteredMethods( $filterFunction, StubProblemType::HAS_UNION_TYPEHINT, @@ -92,6 +94,12 @@ public static function methodsForUnionReturnTypeHintTestsProvider(): ?Generator ); } + private static function getFilterFunctionForLanguageLevel(float $languageVersion): callable + { + return fn (PHPClass|PHPInterface $class, PHPMethod $method, ?float $firstSinceVersion) => !$method->isFinal && + !$class->isFinal && $firstSinceVersion !== null && $firstSinceVersion < $languageVersion && !$method->isReturnTypeTentative; + } + /** * @throws RuntimeException */ diff --git a/tests/TestData/Providers/Stubs/StubsParametersProvider.php b/tests/TestData/Providers/Stubs/StubsParametersProvider.php index 8464e76e6..d412e47e9 100644 --- a/tests/TestData/Providers/Stubs/StubsParametersProvider.php +++ b/tests/TestData/Providers/Stubs/StubsParametersProvider.php @@ -5,6 +5,9 @@ use Generator; use RuntimeException; +use StubTests\Model\PHPClass; +use StubTests\Model\PHPInterface; +use StubTests\Model\PHPMethod; use StubTests\Model\StubProblemType; use StubTests\Parsers\ParserUtils; use StubTests\TestData\Providers\EntitiesFilter; @@ -17,7 +20,7 @@ class StubsParametersProvider */ public static function parametersForScalarTypeHintTestsProvider(): ?Generator { - $filterFunction = EntitiesFilter::getFilterFunctionForLanguageLevel(7); + $filterFunction = self::getFilterFunctionForLanguageLevel(7); return self::yieldFilteredMethodParameters($filterFunction, StubProblemType::PARAMETER_HAS_SCALAR_TYPEHINT); } @@ -26,7 +29,7 @@ public static function parametersForScalarTypeHintTestsProvider(): ?Generator */ public static function parametersForNullableTypeHintTestsProvider(): ?Generator { - $filterFunction = EntitiesFilter::getFilterFunctionForLanguageLevel(7.1); + $filterFunction = self::getFilterFunctionForLanguageLevel(7.1); return self::yieldFilteredMethodParameters($filterFunction, StubProblemType::HAS_NULLABLE_TYPEHINT); } @@ -35,7 +38,7 @@ public static function parametersForNullableTypeHintTestsProvider(): ?Generator */ public static function parametersForUnionTypeHintTestsProvider(): ?Generator { - $filterFunction = EntitiesFilter::getFilterFunctionForLanguageLevel(8); + $filterFunction = self::getFilterFunctionForLanguageLevel(8); return self::yieldFilteredMethodParameters($filterFunction, StubProblemType::HAS_UNION_TYPEHINT); } @@ -88,4 +91,10 @@ private static function yieldFilteredMethodParameters(callable $filterFunction, } } } + + private static function getFilterFunctionForLanguageLevel(float $languageVersion): callable + { + return fn (PHPClass|PHPInterface $class, PHPMethod $method, ?float $firstSinceVersion) => !$method->isFinal && + !$class->isFinal && $firstSinceVersion !== null && $firstSinceVersion < $languageVersion; + } } diff --git a/tokenizer/PhpToken.php b/tokenizer/PhpToken.php index 3d8e8ecc4..23097a3eb 100644 --- a/tokenizer/PhpToken.php +++ b/tokenizer/PhpToken.php @@ -42,7 +42,7 @@ final public function __construct(int $id, string $text, int $line = -1, int $po * * @return string|null */ - public function getTokenName() {} + public function getTokenName(): ?string {} /** * Same as {@see token_get_all()}, but returning array of {@see PhpToken} @@ -52,7 +52,7 @@ public function getTokenName() {} * @param int $flags * @return static[] */ - public static function tokenize(string $code, int $flags = 0) {} + public static function tokenize(string $code, int $flags = 0): array {} /** * Whether the token has the given ID, the given text, or has an ID/text @@ -61,17 +61,17 @@ public static function tokenize(string $code, int $flags = 0) {} * @param int|string|array $kind * @return bool */ - public function is($kind) {} + public function is($kind): bool {} /** * Whether this token would be ignored by the PHP parser. * * @return bool */ - public function isIgnorable() {} + public function isIgnorable(): bool {} /** * {@inheritDoc} */ - public function __toString() {} + public function __toString(): string {} } diff --git a/xdebug/xdebug.php b/xdebug/xdebug.php index b8bfc586e..e4e68a8ad 100644 --- a/xdebug/xdebug.php +++ b/xdebug/xdebug.php @@ -3,7 +3,7 @@ /** * Show diagnostic information */ -function xdebug_info() {} +function xdebug_info(string $category = '') {} /** * Returns an array of ALL valid ini options with values and is not the same as ini_get_all() which returns only @@ -27,7 +27,7 @@ function xdebug_get_function_stack(): array {} /** * Displays the current function stack, in a similar way as what Xdebug would display in an error situation. * @param string $message - * @param int $options A bit mask of the following constants: XDEBUG_STACK_NO_DESC + * @param int $options A bit mask of the following constants: XDEBUG_STACK_NO_DESC * @return void */ function xdebug_print_function_stack(string $message = 'user triggered', int $options = 0) {} @@ -349,13 +349,17 @@ function xdebug_get_gc_run_count(): int {} function xdebug_get_gc_total_collected_roots(): int {} /** - * @param int $group - * @param int $listType + * @param int $group + * @param int $listType * @param array $configuration * @return void */ function xdebug_set_filter(int $group, int $listType, array $configuration) {} +function xdebug_connect_to_client(): bool {} + +function xdebug_notify(mixed $data): bool {} + define('XDEBUG_STACK_NO_DESC', 1); define('XDEBUG_TRACE_APPEND', 1); define('XDEBUG_TRACE_COMPUTERIZED', 2); diff --git a/xmlreader/xmlreader.php b/xmlreader/xmlreader.php index cbd3ec962..1e9e42119 100644 --- a/xmlreader/xmlreader.php +++ b/xmlreader/xmlreader.php @@ -2,6 +2,7 @@ // Start of xmlreader v.0.2 use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\TentativeType; /** * The XMLReader extension is an XML Pull parser. The reader acts as a @@ -129,11 +130,12 @@ public function close() {} * @param string $name

* The name of the attribute. *

- * @return string The value of the attribute, or NULL if no attribute with the given + * @return string|null The value of the attribute, or NULL if no attribute with the given * name is found or not positioned on an element node. * @since 5.1.2 */ - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): ?string {} /** * Get the value of an attribute by index @@ -145,7 +147,8 @@ public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], defau * at index or not positioned of element. * @since 5.1.2 */ - public function getAttributeNo(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index) {} + #[TentativeType] + public function getAttributeNo(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index): ?string {} /** * Get the value of an attribute by localname and URI @@ -161,10 +164,11 @@ public function getAttributeNo(#[LanguageLevelTypeAware(['8.0' => 'int'], defaul * namespaceURI is found or not positioned of element. * @since 5.1.2 */ + #[TentativeType] public function getAttributeNs( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace - ) {} + ): ?string {} /** * Indicates if specified property has been set @@ -176,7 +180,8 @@ public function getAttributeNs( * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function getParserProperty(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property) {} + #[TentativeType] + public function getParserProperty(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property): bool {} /** * Indicates if the parsed document is valid @@ -184,7 +189,8 @@ public function getParserProperty(#[LanguageLevelTypeAware(['8.0' => 'int'], def * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function isValid() {} + #[TentativeType] + public function isValid(): bool {} /** * Lookup namespace for a prefix @@ -192,10 +198,11 @@ public function isValid() {} * @param string $prefix

* String containing the prefix. *

- * @return bool TRUE on success or FALSE on failure. + * @return string|null TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function lookupNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $prefix) {} + #[TentativeType] + public function lookupNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $prefix): ?string {} /** * Move cursor to an attribute by index @@ -206,7 +213,8 @@ public function lookupNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], de * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function moveToAttributeNo(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index) {} + #[TentativeType] + public function moveToAttributeNo(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index): bool {} /** * Move cursor to a named attribute @@ -217,7 +225,8 @@ public function moveToAttributeNo(#[LanguageLevelTypeAware(['8.0' => 'int'], def * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function moveToAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function moveToAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * Move cursor to a named attribute @@ -231,10 +240,11 @@ public function moveToAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], de * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ + #[TentativeType] public function moveToAttributeNs( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace - ) {} + ): bool {} /** * Position cursor on the parent Element of current Attribute @@ -243,7 +253,8 @@ public function moveToAttributeNs( * Attribute when this method is called. * @since 5.1.2 */ - public function moveToElement() {} + #[TentativeType] + public function moveToElement(): bool {} /** * Position cursor on the first Attribute @@ -251,7 +262,8 @@ public function moveToElement() {} * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function moveToFirstAttribute() {} + #[TentativeType] + public function moveToFirstAttribute(): bool {} /** * Position cursor on the next Attribute @@ -259,7 +271,8 @@ public function moveToFirstAttribute() {} * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function moveToNextAttribute() {} + #[TentativeType] + public function moveToNextAttribute(): bool {} /** * Set the URI containing the XML to parse @@ -290,7 +303,8 @@ public static function open( * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function read() {} + #[TentativeType] + public function read(): bool {} /** * Move cursor to next node skipping all subtrees @@ -301,21 +315,24 @@ public function read() {} * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function next(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null) {} + #[TentativeType] + public function next(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): bool {} /** * Retrieve XML from current node * @link https://php.net/manual/en/xmlreader.readinnerxml.php * @return string the contents of the current node as a string. Empty string on failure. */ - public function readInnerXml() {} + #[TentativeType] + public function readInnerXml(): string {} /** * Retrieve XML from current node, including it self * @link https://php.net/manual/en/xmlreader.readouterxml.php * @return string the contents of current node, including itself, as a string. Empty string on failure. */ - public function readOuterXml() {} + #[TentativeType] + public function readOuterXml(): string {} /** * Reads the contents of the current node as a string @@ -323,7 +340,8 @@ public function readOuterXml() {} * @return string the content of the current node as a string. Empty string on * failure. */ - public function readString() {} + #[TentativeType] + public function readString(): string {} /** * Validate document against XSD @@ -333,7 +351,8 @@ public function readString() {} *

* @return bool TRUE on success or FALSE on failure. */ - public function setSchema(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename) {} + #[TentativeType] + public function setSchema(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename): bool {} /** * Set parser options @@ -349,10 +368,11 @@ public function setSchema(#[LanguageLevelTypeAware(['8.0' => 'string|null'], def * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ + #[TentativeType] public function setParserProperty( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $property, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $value - ) {} + ): bool {} /** * Set the filename or URI for a RelaxNG Schema @@ -362,7 +382,8 @@ public function setParserProperty( *

* @return bool TRUE on success or FALSE on failure. */ - public function setRelaxNGSchema(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename) {} + #[TentativeType] + public function setRelaxNGSchema(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename): bool {} /** * Set the data containing a RelaxNG Schema @@ -373,7 +394,8 @@ public function setRelaxNGSchema(#[LanguageLevelTypeAware(['8.0' => 'string|null * @return bool TRUE on success or FALSE on failure. * @since 5.1.2 */ - public function setRelaxNGSchemaSource(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $source) {} + #[TentativeType] + public function setRelaxNGSchemaSource(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $source): bool {} /** * Set the data containing the XML to parse @@ -405,6 +427,7 @@ public static function XML( * @return DOMNode|false The resulting DOMNode or FALSE on error. * @since 5.1.2 */ - public function expand(#[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $baseNode = null) {} + #[TentativeType] + public function expand(#[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $baseNode = null): DOMNode|false {} } // End of xmlreader v.0.2 diff --git a/xmlwriter/xmlwriter.php b/xmlwriter/xmlwriter.php index cc19a4342..1cec7a3a3 100644 --- a/xmlwriter/xmlwriter.php +++ b/xmlwriter/xmlwriter.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Internal\TentativeType; class XMLWriter { @@ -20,7 +21,8 @@ class XMLWriter * Procedural style: Returns a new xmlwriter resource for later use with the * xmlwriter functions on success, FALSE on error. */ - public function openUri(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $uri) {} + #[TentativeType] + public function openUri(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $uri): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -32,7 +34,8 @@ public function openUri(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ' * Procedural style: Returns a new xmlwriter resource for later use with the * xmlwriter functions on success, FALSE on error. */ - public function openMemory() {} + #[TentativeType] + public function openMemory(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -43,7 +46,8 @@ public function openMemory() {} *

* @return bool TRUE on success or FALSE on failure. */ - public function setIndent(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $enable) {} + #[TentativeType] + public function setIndent(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $enable): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -54,7 +58,8 @@ public function setIndent(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: ' *

* @return bool TRUE on success or FALSE on failure. */ - public function setIndentString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $indentation) {} + #[TentativeType] + public function setIndentString(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $indentation): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 1.0.0)
@@ -62,7 +67,8 @@ public function setIndentString(#[LanguageLevelTypeAware(['8.0' => 'string'], de * @link https://php.net/manual/en/function.xmlwriter-startcomment.php * @return bool TRUE on success or FALSE on failure. */ - public function startComment() {} + #[TentativeType] + public function startComment(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 1.0.0)
@@ -70,7 +76,8 @@ public function startComment() {} * @link https://php.net/manual/en/function.xmlwriter-endcomment.php * @return bool TRUE on success or FALSE on failure. */ - public function endComment() {} + #[TentativeType] + public function endComment(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -81,7 +88,8 @@ public function endComment() {} *

* @return bool TRUE on success or FALSE on failure. */ - public function startAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function startAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -89,7 +97,8 @@ public function startAttribute(#[LanguageLevelTypeAware(['8.0' => 'string'], def * @link https://php.net/manual/en/function.xmlwriter-endattribute.php * @return bool TRUE on success or FALSE on failure. */ - public function endAttribute() {} + #[TentativeType] + public function endAttribute(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -103,10 +112,11 @@ public function endAttribute() {} *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeAttribute( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -123,11 +133,12 @@ public function writeAttribute( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function startAttributeNs( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $prefix, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -147,12 +158,13 @@ public function startAttributeNs( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeAttributeNs( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $prefix, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -163,7 +175,8 @@ public function writeAttributeNs( *

* @return bool TRUE on success or FALSE on failure. */ - public function startElement(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function startElement(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -171,7 +184,8 @@ public function startElement(#[LanguageLevelTypeAware(['8.0' => 'string'], defau * @link https://php.net/manual/en/function.xmlwriter-endelement.php * @return bool TRUE on success or FALSE on failure. */ - public function endElement() {} + #[TentativeType] + public function endElement(): bool {} /** * (PHP 5 >= 5.2.0, PECL xmlwriter >= 2.0.4)
@@ -179,7 +193,8 @@ public function endElement() {} * @link https://php.net/manual/en/function.xmlwriter-fullendelement.php * @return bool TRUE on success or FALSE on failure. */ - public function fullEndElement() {} + #[TentativeType] + public function fullEndElement(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -196,11 +211,12 @@ public function fullEndElement() {} *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function startElementNs( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $prefix, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -214,10 +230,11 @@ public function startElementNs( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeElement( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $content = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -237,12 +254,13 @@ public function writeElement( *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeElementNs( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $prefix, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $content = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -253,7 +271,8 @@ public function writeElementNs( *

* @return bool TRUE on success or FALSE on failure. */ - public function startPi(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $target) {} + #[TentativeType] + public function startPi(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $target): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -261,7 +280,8 @@ public function startPi(#[LanguageLevelTypeAware(['8.0' => 'string'], default: ' * @link https://php.net/manual/en/function.xmlwriter-endpi.php * @return bool TRUE on success or FALSE on failure. */ - public function endPi() {} + #[TentativeType] + public function endPi(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -275,10 +295,11 @@ public function endPi() {} *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writePi( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $target, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -286,7 +307,8 @@ public function writePi( * @link https://php.net/manual/en/function.xmlwriter-startcdata.php * @return bool TRUE on success or FALSE on failure. */ - public function startCdata() {} + #[TentativeType] + public function startCdata(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -294,7 +316,8 @@ public function startCdata() {} * @link https://php.net/manual/en/function.xmlwriter-endcdata.php * @return bool TRUE on success or FALSE on failure. */ - public function endCdata() {} + #[TentativeType] + public function endCdata(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -305,7 +328,8 @@ public function endCdata() {} *

* @return bool TRUE on success or FALSE on failure. */ - public function writeCdata(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content) {} + #[TentativeType] + public function writeCdata(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -316,7 +340,8 @@ public function writeCdata(#[LanguageLevelTypeAware(['8.0' => 'string'], default *

* @return bool TRUE on success or FALSE on failure. */ - public function text(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content) {} + #[TentativeType] + public function text(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content): bool {} /** * (PHP 5 >= 5.2.0, PECL xmlwriter >= 2.0.4)
@@ -327,7 +352,8 @@ public function text(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] *

* @return bool TRUE on success or FALSE on failure. */ - public function writeRaw(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content) {} + #[TentativeType] + public function writeRaw(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -344,11 +370,12 @@ public function writeRaw(#[LanguageLevelTypeAware(['8.0' => 'string'], default: *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function startDocument( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $version = '1.0', #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $encoding = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $standalone = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -356,7 +383,8 @@ public function startDocument( * @link https://php.net/manual/en/function.xmlwriter-enddocument.php * @return bool TRUE on success or FALSE on failure. */ - public function endDocument() {} + #[TentativeType] + public function endDocument(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -367,7 +395,8 @@ public function endDocument() {} *

* @return bool TRUE on success or FALSE on failure. */ - public function writeComment(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content) {} + #[TentativeType] + public function writeComment(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -384,11 +413,12 @@ public function writeComment(#[LanguageLevelTypeAware(['8.0' => 'string'], defau *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function startDtd( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $publicId = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $systemId = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -396,7 +426,8 @@ public function startDtd( * @link https://php.net/manual/en/function.xmlwriter-enddtd.php * @return bool TRUE on success or FALSE on failure. */ - public function endDtd() {} + #[TentativeType] + public function endDtd(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -416,12 +447,13 @@ public function endDtd() {} *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeDtd( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $publicId = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $systemId = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $content = null - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -432,7 +464,8 @@ public function writeDtd( *

* @return bool TRUE on success or FALSE on failure. */ - public function startDtdElement(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName) {} + #[TentativeType] + public function startDtdElement(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -440,7 +473,8 @@ public function startDtdElement(#[LanguageLevelTypeAware(['8.0' => 'string'], de * @link https://php.net/manual/en/function.xmlwriter-enddtdelement.php * @return bool TRUE on success or FALSE on failure. */ - public function endDtdElement() {} + #[TentativeType] + public function endDtdElement(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -454,10 +488,11 @@ public function endDtdElement() {} *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeDtdElement( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -468,7 +503,8 @@ public function writeDtdElement( *

* @return bool TRUE on success or FALSE on failure. */ - public function startDtdAttlist(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name) {} + #[TentativeType] + public function startDtdAttlist(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -476,7 +512,8 @@ public function startDtdAttlist(#[LanguageLevelTypeAware(['8.0' => 'string'], de * @link https://php.net/manual/en/function.xmlwriter-enddtdattlist.php * @return bool TRUE on success or FALSE on failure. */ - public function endDtdAttlist() {} + #[TentativeType] + public function endDtdAttlist(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -490,10 +527,11 @@ public function endDtdAttlist() {} *

* @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function writeDtdAttlist( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $content - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -505,10 +543,11 @@ public function writeDtdAttlist( * @param bool $isParam * @return bool TRUE on success or FALSE on failure. */ + #[TentativeType] public function startDtdEntity( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $isParam - ) {} + ): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -516,7 +555,8 @@ public function startDtdEntity( * @link https://php.net/manual/en/function.xmlwriter-enddtdentity.php * @return bool TRUE on success or FALSE on failure. */ - public function endDtdEntity() {} + #[TentativeType] + public function endDtdEntity(): bool {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 0.1.0)
@@ -552,7 +592,8 @@ public function writeDtdEntity( *

* @return string the current buffer as a string. */ - public function outputMemory(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $flush = true) {} + #[TentativeType] + public function outputMemory(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $flush = true): string {} /** * (PHP 5 >= 5.1.2, PECL xmlwriter >= 1.0.0)
@@ -561,11 +602,12 @@ public function outputMemory(#[LanguageLevelTypeAware(['8.0' => 'bool'], default * @param bool $empty [optional]

* Whether to empty the buffer or not. Default is TRUE. *

- * @return mixed If you opened the writer in memory, this function returns the generated XML buffer, + * @return string|int If you opened the writer in memory, this function returns the generated XML buffer, * Else, if using URI, this function will write the buffer and return the number of * written bytes. */ - public function flush(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $empty = true) {} + #[TentativeType] + public function flush(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $empty = true): string|int {} } /** diff --git a/zip/zip.php b/zip/zip.php index fa4cd1af9..eea29b64c 100644 --- a/zip/zip.php +++ b/zip/zip.php @@ -442,137 +442,137 @@ class ZipArchive implements Countable */ public const ER_CANCELLED = 32; - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_DOS = 0; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_AMIGA = 1; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_OPENVMS = 2; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_UNIX = 3; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_VM_CMS = 4; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_ATARI_ST = 5; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_OS_2 = 6; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_MACINTOSH = 7; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_Z_SYSTEM = 8; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @removed 8.0 Use {@link ZipArchive::ZOPSYS_CPM} instead. - * @since 5.6 - */ - public const OPSYS_Z_CPM = 9; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_WINDOWS_NTFS = 10; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_MVS = 11; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_VSE = 12; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_ACORN_RISC = 13; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_VFAT = 14; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_ALTERNATE_MVS = 15; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_BEOS = 16; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_TANDEM = 17; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_OS_400 = 18; - - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_OS_X = 19; + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_DOS = 0; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_AMIGA = 1; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_OPENVMS = 2; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_UNIX = 3; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_VM_CMS = 4; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_ATARI_ST = 5; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_OS_2 = 6; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_MACINTOSH = 7; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_Z_SYSTEM = 8; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @removed 8.0 Use {@link ZipArchive::ZOPSYS_CPM} instead. + * @since 5.6 + */ + public const OPSYS_Z_CPM = 9; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_WINDOWS_NTFS = 10; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_MVS = 11; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_VSE = 12; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_ACORN_RISC = 13; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_VFAT = 14; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_ALTERNATE_MVS = 15; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_BEOS = 16; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_TANDEM = 17; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_OS_400 = 18; + + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_OS_X = 19; /** * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default */ public const OPSYS_CPM = 9; - /** - * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default - * @since 5.6 - */ - public const OPSYS_DEFAULT = 3; + /** + * @link https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.opsys.default + * @since 5.6 + */ + public const OPSYS_DEFAULT = 3; /** * Status of the Zip Archive