1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/src/Psalm/Internal/Stubs/CoreGenericFunctions.php

124 lines
2.8 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
* @return array<int, T>
*/
2017-03-24 15:13:20 +01:00
function array_keys(array $arr, $search_value = null, bool $strict = false) {}
/**
* @psalm-template T
*
* @param array<mixed, T> $arr
* @return array<int, T>
*/
function array_values(array $arr) {}
/**
* @psalm-template T
*
* @param array<mixed, T> $arr
* @param int $sort_flags
* @return array<int, T>
*/
function array_unique(array $arr, int $sort_flags = 0) {}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
* @param array|null $arr3
* @param array|null $arr4
* @return array<TKey, TValue>
*/
function array_intersect(array $arr, array $arr2, array $arr3 = null, array $arr4 = null) {}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
* @param array|null $arr3
* @param array|null $arr4
* @return array<TKey, TValue>
*/
function array_intersect_key(array $arr, array $arr2, array $arr3 = null, array $arr4 = null) {}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<mixed, TKey> $arr
* @param array<mixed, TValue> $arr2
* @return array<TKey, TValue>
*/
function array_combine(array $arr, array $arr2) {}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
* @param array|null $arr3
* @param array|null $arr4
* @return array<TKey, TValue>
*/
function array_diff(array $arr, array $arr2, array $arr3 = null, array $arr4 = null) {}
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
*
* @param array<TKey, TValue> $arr
* @param array $arr2
* @param array|null $arr3
* @param array|null $arr4
* @return array<TKey, TValue>
*/
function array_diff_key(array $arr, array $arr2, array $arr3 = null, array $arr4 = null) {}
2017-03-13 21:50:25 +01:00
/**
* @psalm-template TKey as array-key
* @psalm-template TValue
2017-03-13 21:50:25 +01:00
*
* @param array<TKey, TValue> $arr
* @param bool $preserve_keys
2017-03-13 21:50:25 +01:00
* @return array<TKey, TValue>
*/
function array_reverse(array $arr, bool $preserve_keys = false) {}
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
* @return array<TValue, TKey>
*/
function array_flip(array $arr) {}
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
* @return TKey|null
* @psalm-ignore-nullable-return
2018-04-05 06:21:14 +02:00
*/
function key($arr) {}
/**
* @psalm-template T
*
* @param mixed $needle
* @param array<T, mixed> $haystack
* @param bool $strict
* @return T|false
*/
function array_search($needle, array $haystack, bool $strict = false) {}