Composer updates

This commit is contained in:
Clemens Schwaighofer
2023-05-29 16:21:31 +09:00
parent 250067927a
commit 7b5ad92e66
304 changed files with 11398 additions and 3199 deletions

View File

@@ -531,3 +531,93 @@ final class ReturnTypeWillChange
public function __construct() {}
}
class DateInterval
{
/**
* Number of years
* @var int
* @readonly
*/
public $y;
/**
* Number of months
* @var int
* @readonly
*/
public $m;
/**
* Number of days
* @var int
* @readonly
*/
public $d;
/**
* Number of hours
* @var int
* @readonly
*/
public $h;
/**
* Number of minutes
* @var int
* @readonly
*/
public $i;
/**
* Number of seconds
* @var int
* @readonly
*/
public $s;
/**
* Number of microseconds
* @since 7.1.0
* @var float
* @readonly
*/
public $f;
/**
* Is 1 if the interval is inverted and 0 otherwise
* @var int
* @readonly
*/
public $invert;
/**
* Total number of days the interval spans. If this is unknown, days will be FALSE.
* @var int|false
* @readonly
*/
public $days;
/**
* @throws Exception when the $duration cannot be parsed as an interval.
* @link https://php.net/manual/en/dateinterval.construct.php
*/
public function __construct(string $duration = '') {}
/**
* Formats the interval
* @return string
* @link https://php.net/manual/en/dateinterval.format.php
* @psalm-pure
*/
public function format(string $format = ''): string {}
/**
* Sets up a DateInterval from the relative parts of the string
* @return DateInterval|false Returns a new {@link https://www.php.net/manual/en/class.dateinterval.php DateInterval}
* instance on success, or <b>FALSE</b> on failure.
* @link https://php.net/manual/en/dateinterval.createfromdatestring.php
* @psalm-ignore-falsable-return
*/
public static function createFromDateString(string $datetime = ''): DateInterval|false {}
}

View File

@@ -122,13 +122,27 @@ function array_diff_assoc(array $array, array ...$arrays)
*
* @param array<TKey, TValue> $array
*
* @return array<TValue, TKey>
* @return ($array is non-empty-array ? non-empty-array<TValue, TKey> : array<TValue, TKey>)
* @psalm-pure
*/
function array_flip(array $array)
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
* @psalm-template TArray as array<TKey, TValue>
*
* @param TArray $array
*
* @return (TArray is non-empty-array ? non-empty-array<TKey, TValue> : array<TKey, TValue>)
* @psalm-pure
*/
function array_unique(array $array, int $flags = 0)
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TArray as array<TKey, mixed>
@@ -545,17 +559,6 @@ function abs($num) {}
*/
function range($start, $end, $step = 1) {}
/**
* @psalm-pure
*
* @return (
* $format is 'd'|'j'|'N'|'w'|'z'|'W'|'m'|'n'|'t'|'L'|'o'|'Y'|'y'|'B'|'g'|'G'|'h'|'H'|'i'|'s'|'u'|'v'|'Z'|'U'|'I'
* ? numeric-string
* : ($timestamp is numeric ? string : string|false)
* )
*/
function date(string $format, int $timestamp = 0) {}
/**
* @psalm-pure
*
@@ -624,12 +627,23 @@ function substr_replace($string, $replace, $offset, $length = null) {}
/**
* @psalm-pure
*
* @param string $haystack
*
* @param string $needle
* @param int $offset
* @psalm-assert-if-true =non-empty-string $haystack
* @psalm-return positive-int|0|false
*/
function strpos($haystack, $needle, int $offset = 0) : int|false {}
function strpos(string $haystack, string $needle, int $offset = 0) {}
/**
* @psalm-pure
* @param string $haystack
* @param string $needle
* @param int $offset
* @psalm-assert-if-true =non-empty-string $haystack
* @psalm-return positive-int|0|false
*/
function stripos(string $haystack, string $needle, int $offset = 0) {}
/**
* @psalm-pure
@@ -1050,12 +1064,40 @@ function str_shuffle(string $string): string {}
/**
* @psalm-pure
* @return ($length is positive-int ? list<string> : false)
* @param positive-int $length
* @return non-empty-list<string>
*
* @psalm-flow ($string) -> return
*/
function str_split(string $string, int $length = 1) {}
/**
* @psalm-pure
* @template T as string
* @param T $needle
* @psalm-assert-if-true =(T is '' ? string : non-empty-string) $haystack
* @return ($needle is '' ? true : ($haystack is '' ? false : bool))
*/
function str_starts_with(string $haystack, string $needle): bool {}
/**
* @psalm-pure
* @template T as string
* @param T $needle
* @psalm-assert-if-true =(T is '' ? string : non-empty-string) $haystack
* @return ($needle is '' ? true : ($haystack is '' ? false : bool))
*/
function str_ends_with(string $haystack, string $needle): bool {}
/**
* @psalm-pure
* @template T as string
* @param T $needle
* @psalm-assert-if-true =(T is '' ? string : non-empty-string) $haystack
* @return ($needle is '' ? true : ($haystack is '' ? false : bool))
*/
function str_contains(string $haystack, string $needle): bool {}
/**
* @psalm-pure
* @return string|false
@@ -1459,15 +1501,19 @@ function ldap_escape(string $value, string $ignore = "", int $flags = 0) : strin
/**
* @psalm-pure
*
* @param int<1, 2147483647> $depth
* @return mixed
* @psalm-flow ($json) -> return
*/
function json_decode(string $json, ?bool $associative = null, int $depth = 512, int $flags = 0) {}
/**
* The conditional return type below relies on the fact that JSON_THROW_ON_ERROR is
* the highest-valued of JSON constants
* @psalm-pure
*
* @return ($flags is 4194304 ? non-empty-string : non-empty-string|false)
* @param int<1, 2147483647> $depth
* @return ($flags is int<4194304, 8388607> ? non-empty-string : non-empty-string|false)
*
* @psalm-flow ($value) -> return
* @psalm-ignore-falsable-return

View File

@@ -114,7 +114,7 @@ class IteratorIterator implements OuterIterator {
/**
* @param TIterator $iterator
*/
public function __construct(Traversable $iterator) {}
public function __construct(Traversable $iterator, ?string $class = null) {}
/**
* @return TValue|null current value or null when iterator is drained

View File

@@ -45,4 +45,13 @@ namespace {
{
public function __construct() {}
}
/**
* @psalm-pure
* @param positive-int $length
* @return list<non-empty-string>
*
* @psalm-flow ($string) -> return
*/
function str_split(string $string, int $length = 1) {}
}

View File

@@ -1,5 +1,13 @@
<?php
class mysqli
{
/**
* @var int<-1, max>|numeric-string
*/
public int|string $affected_rows;
}
/**
* @template TValue
*
@@ -7,6 +15,11 @@
*/
class mysqli_result implements Traversable
{
/**
* @var int<0, max>|numeric-string
*/
public int|string $num_rows;
/**
* @psalm-taint-sink callable $class
*
@@ -18,6 +31,44 @@ class mysqli_result implements Traversable
function fetch_object(string $class = stdClass::class, array $constructor_args = []): object|false|null {}
}
class mysqli_stmt
{
/**
* @var int<-1, max>|numeric-string
*/
public int|string $affected_rows;
public int $errno;
/**
* @var list<array{errno: int, sqlstate: string, error: string}>
*/
public $error_list;
public string $error;
/**
* @var 0|positive-int
*/
public int $field_count;
public int|string $insert_id;
/**
* @var int<0,max>|numeric-string
*/
public int|string $num_rows;
/**
* @var 0|positive-int
*/
public int $param_count;
/**
* @var non-empty-string
*/
public string $sqlstate;
}
/**
* @psalm-taint-sink callable $class

View File

@@ -53,6 +53,7 @@ class SimpleXMLElement implements Traversable, Countable
final public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = '', bool $isPrefix = false) {}
/** @psalm-ignore-nullable-return */
public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElement {}
public function addAttribute(string $qualifiedName, string $value, ?string $namespace = null): void {}