Skip to content

Commit

Permalink
Merge pull request #6398 from orklah/array_is_list
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Sep 4, 2021
2 parents a655ca8 + 9cd8917 commit d9ceb87
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dictionaries/CallMap.php
Expand Up @@ -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
Expand Down Expand Up @@ -382,6 +382,7 @@
'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'],
Expand Down
27 changes: 27 additions & 0 deletions dictionaries/CallMap_81_delta.php
@@ -0,0 +1,27 @@
<?php // phpcs:ignoreFile

/**
* This contains the information needed to convert the function signatures for php 8.1 to php 8.0 (and vice versa)
*
* This file has three sections.
* The 'added' section contains function/method names from FunctionSignatureMap (And alternates, if applicable) that do not exist in php 8.0
* The 'removed' section contains the signatures that were removed in php 8.1
* The 'changed' section contains functions for which the signature has changed for php 8.1.
* Each function in the 'changed' section has an 'old' and a 'new' section,
* representing the function as it was in PHP 8.0 and in PHP 8.1, respectively
*
* @see CallMap.php
*
* @phan-file-suppress PhanPluginMixedKeyNoKey (read by Phan when analyzing this file)
*/
return [
'added' => [
'array_is_list' => ['bool', 'array'=>'array'],
],
'changed' => [

],
'removed' => [

],
];
4 changes: 2 additions & 2 deletions src/Psalm/Internal/Codebase/InternalCallMapHandler.php
Expand Up @@ -26,7 +26,7 @@
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;

/**
Expand Down Expand Up @@ -404,7 +404,7 @@ public static function getCallMap(): array
$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;
Expand Down

0 comments on commit d9ceb87

Please sign in to comment.