1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/src/Psalm/Internal/Stubs/CoreGenericFunctions.php

181 lines
3.0 KiB
PHP
Raw Normal View History

<?php
/**
* @psalm-template T as array-key
*
* @param array<T, mixed> $arr
2017-03-24 15:13:20 +01:00
* @param mixed $search_value
* @param bool $strict
2019-07-05 22:24:00 +02:00
*
2019-10-09 00:44:46 +02:00
* @return list<T>
* @psalm-pure
*/
2019-07-05 22:24:00 +02:00
function array_keys(array $arr, $search_value = null, bool $strict = false)
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
2019-10-06 21:28:41 +02:00
* @param array ...$arr3
2019-07-05 22:24:00 +02:00
*
* @return array<TKey, TValue>
* @psalm-pure
*/
2019-10-06 21:28:41 +02:00
function array_intersect(array $arr, array $arr2, array ...$arr3)
2019-07-05 22:24:00 +02:00
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
2019-10-06 21:28:41 +02:00
* @param array ...$arr3
2019-07-05 22:24:00 +02:00
*
* @return array<TKey, TValue>
* @psalm-pure
*/
2019-10-06 21:28:41 +02:00
function array_intersect_key(array $arr, array $arr2, array ...$arr3)
2019-07-05 22:24:00 +02:00
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<mixed, TKey> $arr
* @param array<mixed, TValue> $arr2
2019-07-05 22:24:00 +02:00
*
* @return array<TKey, TValue>|false
* @psalm-ignore-falsable-return
* @psalm-pure
*/
2019-07-05 22:24:00 +02:00
function array_combine(array $arr, array $arr2)
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
2019-10-06 21:28:41 +02:00
* @param array ...$arr3
2019-07-05 22:24:00 +02:00
*
* @return array<TKey, TValue>
* @psalm-pure
*/
2019-10-06 21:28:41 +02:00
function array_diff(array $arr, array $arr2, array ...$arr3)
2019-07-05 22:24:00 +02:00
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
2019-10-06 21:28:41 +02:00
* @param array ...$arr3
2019-07-05 22:24:00 +02:00
*
* @return array<TKey, TValue>
* @psalm-pure
*/
2019-10-06 21:28:41 +02:00
function array_diff_key(array $arr, array $arr2, array ...$arr3)
2019-07-05 22:24:00 +02:00
{
}
2018-02-22 00:59:31 +01:00
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
2018-02-22 00:59:31 +01:00
*
* @param array<TKey, TValue> $arr
2019-07-05 22:24:00 +02:00
*
2018-02-22 00:59:31 +01:00
* @return array<TValue, TKey>
* @psalm-pure
2018-02-22 00:59:31 +01:00
*/
2019-07-05 22:24:00 +02:00
function array_flip(array $arr)
{
}
2018-02-22 00:59:31 +01:00
2018-04-05 06:21:14 +02:00
/**
* @psalm-template TKey as array-key
2018-04-05 06:21:14 +02:00
*
* @param array<TKey, mixed> $arr
2019-07-05 22:24:00 +02:00
*
* @return TKey|null
* @psalm-ignore-nullable-return
* @psalm-pure
2018-04-05 06:21:14 +02:00
*/
2019-07-05 22:24:00 +02:00
function key($arr)
{
}
2018-04-05 06:21:14 +02:00
/**
* @psalm-template T
*
* @param mixed $needle
* @param array<T, mixed> $haystack
* @param bool $strict
2019-07-05 22:24:00 +02:00
*
* @return T|false
* @psalm-pure
*/
2019-07-05 22:24:00 +02:00
function array_search($needle, array $haystack, bool $strict = false)
{
}
2019-01-20 00:11:39 +01:00
/**
* @template T
2019-07-05 22:24:00 +02:00
*
2019-01-20 00:11:39 +01:00
* @param array<mixed,T> $arr
* @param callable(T,T):int $callback
* @param-out array<int,T> $arr
* @psalm-pure
2019-01-20 00:11:39 +01:00
*/
2019-07-05 22:24:00 +02:00
function usort(array &$arr, callable $callback): bool
{
}
2019-01-20 00:11:39 +01:00
/**
* @psalm-template T
*
* @param array<string, T> $arr
2019-07-05 22:24:00 +02:00
*
* @return array<string, T>
* @psalm-pure
*/
2019-07-05 22:24:00 +02:00
function array_change_key_case(array $arr, int $case = CASE_LOWER)
{
}
/**
* @psalm-template TKey as array-key
2019-07-05 22:24:00 +02:00
*
* @param TKey $key
* @param array<TKey, mixed> $search
2019-07-05 22:24:00 +02:00
*
* @return bool
* @psalm-pure
*/
2019-07-05 22:24:00 +02:00
function array_key_exists($key, array $search) : bool
{
}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array<TKey, TValue> ...$arr2
2019-07-05 22:24:00 +02:00
*
* @return array<TKey, TValue>
* @psalm-pure
*/
2019-07-05 22:24:00 +02:00
function array_merge_recursive(array $arr, array ...$arr2)
{
}