1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Merge pull request #7661 from weirdan/fix-array_fill_keys

This commit is contained in:
Bruce Weirdan 2022-02-13 11:05:05 +02:00 committed by GitHub
commit 52ad607c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ use Psalm\Progress\VoidProgress;
use Throwable;
use function abs;
use function array_flip;
use function array_fill_keys;
use function array_intersect_key;
use function array_map;
use function array_merge;
@ -216,15 +216,8 @@ class StatementsProvider
$file_contents
);
$unchanged_members = array_map(
fn(int $_): bool => true,
array_flip($unchanged_members)
);
$unchanged_signature_members = array_map(
fn(int $_): bool => true,
array_flip($unchanged_signature_members)
);
$unchanged_members = array_fill_keys($unchanged_members, true);
$unchanged_signature_members = array_fill_keys($unchanged_signature_members, true);
$file_path_hash = md5($file_path);
@ -239,15 +232,7 @@ class StatementsProvider
$changed_members
);
$changed_members = array_map(
/**
* @param int $_
*
* @return bool
*/
fn($_): bool => true,
array_flip($changed_members)
);
$changed_members = array_fill_keys($changed_members, true);
if (isset($this->unchanged_members[$file_path])) {
$this->unchanged_members[$file_path] = array_intersect_key(