From 9cd8917b88736087d92e29ea269efb60692f60e4 Mon Sep 17 00:00:00 2001 From: orklah Date: Sat, 4 Sep 2021 13:25:23 +0200 Subject: [PATCH] create callmap for 8.1 and introduce array_is_list --- dictionaries/CallMap.php | 3 ++- dictionaries/CallMap_81_delta.php | 27 +++++++++++++++++++ .../Codebase/InternalCallMapHandler.php | 4 +-- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 dictionaries/CallMap_81_delta.php diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index 2140536f5..cadac23ab 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -2,7 +2,7 @@ namespace Phan\Language\Internal; /** - * CURRENT PHP TARGET VERSION: 8.0 + * CURRENT PHP TARGET VERSION: 8.1 * The version above has to match Psalm\Internal\Codebase\InternalCallMapHandler::PHP_(MAJOR|MINOR)_VERSION * * Format @@ -382,6 +382,7 @@ return [ 'array_intersect_uassoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest'=>'array|callable(mixed,mixed):int'], 'array_intersect_ukey' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'key_compare_func'=>'callable(mixed,mixed):int'], 'array_intersect_ukey\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest'=>'array|callable(mixed,mixed):int'], +'array_is_list' => ['bool', 'array'=>'array'], 'array_key_exists' => ['bool', 'key'=>'string|int', 'array'=>'array|ArrayObject'], 'array_key_first' => ['int|string|null', 'array'=>'array'], 'array_key_last' => ['int|string|null', 'array'=>'array'], diff --git a/dictionaries/CallMap_81_delta.php b/dictionaries/CallMap_81_delta.php new file mode 100644 index 000000000..62c738e1d --- /dev/null +++ b/dictionaries/CallMap_81_delta.php @@ -0,0 +1,27 @@ + [ + 'array_is_list' => ['bool', 'array'=>'array'], + ], + 'changed' => [ + + ], + 'removed' => [ + + ], +]; diff --git a/src/Psalm/Internal/Codebase/InternalCallMapHandler.php b/src/Psalm/Internal/Codebase/InternalCallMapHandler.php index f7807fd97..57c187a60 100644 --- a/src/Psalm/Internal/Codebase/InternalCallMapHandler.php +++ b/src/Psalm/Internal/Codebase/InternalCallMapHandler.php @@ -26,7 +26,7 @@ use function version_compare; class InternalCallMapHandler { private const PHP_MAJOR_VERSION = 8; - private const PHP_MINOR_VERSION = 0; + private const PHP_MINOR_VERSION = 1; private const LOWEST_AVAILABLE_DELTA = 71; /** @@ -404,7 +404,7 @@ class InternalCallMapHandler $cased_key = strtolower($key); self::$call_map[$cased_key] = $value; } - + foreach ($diff_call_map['changed'] as $key => ['old' => $value]) { $cased_key = strtolower($key); self::$call_map[$cased_key] = $value;