From b3698794a019b4c5545b884d40fa954d323865ac Mon Sep 17 00:00:00 2001 From: Dragos Protung Date: Tue, 20 Dec 2022 13:14:24 +0100 Subject: [PATCH] Return might be non-empty-list/non-empty-array for map functions --- src/Psl/Dict/map.php | 2 +- src/Psl/Dict/map_keys.php | 2 +- src/Psl/Dict/map_with_key.php | 2 +- src/Psl/Vec/map.php | 2 +- src/Psl/Vec/map_with_key.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Psl/Dict/map.php b/src/Psl/Dict/map.php index 868f7912..5033b3bb 100644 --- a/src/Psl/Dict/map.php +++ b/src/Psl/Dict/map.php @@ -26,7 +26,7 @@ * @param iterable $iterable Iterable to be mapped over * @param (Closure(Tv): T) $function * - * @return array + * @return ($iterable is non-empty-array ? non-empty-array : array) */ function map(iterable $iterable, Closure $function): array { diff --git a/src/Psl/Dict/map_keys.php b/src/Psl/Dict/map_keys.php index 25cb35a9..1f999179 100644 --- a/src/Psl/Dict/map_keys.php +++ b/src/Psl/Dict/map_keys.php @@ -26,7 +26,7 @@ * @param iterable $iterable Iterable to be mapped over * @param (Closure(Tk1): Tk2) $function * - * @return array + * @return ($iterable is non-empty-array ? non-empty-array : array) */ function map_keys(iterable $iterable, Closure $function): array { diff --git a/src/Psl/Dict/map_with_key.php b/src/Psl/Dict/map_with_key.php index bf756f6c..746c5d36 100644 --- a/src/Psl/Dict/map_with_key.php +++ b/src/Psl/Dict/map_with_key.php @@ -26,7 +26,7 @@ * @param iterable $iterable Iterable to be mapped over * @param (Closure(Tk,Tv): T) $function * - * @return array + * @return ($iterable is non-empty-array ? non-empty-array : array) */ function map_with_key(iterable $iterable, Closure $function): array { diff --git a/src/Psl/Vec/map.php b/src/Psl/Vec/map.php index b9f404b7..d7e2a8f4 100644 --- a/src/Psl/Vec/map.php +++ b/src/Psl/Vec/map.php @@ -28,7 +28,7 @@ * @param iterable $iterable Iterable to be mapped over * @param (Closure(Tv): T) $function * - * @return list + * @return ($iterable is non-empty-array ? non-empty-list : list) */ function map(iterable $iterable, Closure $function): array { diff --git a/src/Psl/Vec/map_with_key.php b/src/Psl/Vec/map_with_key.php index 5f11a095..e4c97780 100644 --- a/src/Psl/Vec/map_with_key.php +++ b/src/Psl/Vec/map_with_key.php @@ -24,7 +24,7 @@ * @param iterable $iterable Iterable to be mapped over * @param (Closure(Tk,Tv): T) $function * - * @return list + * @return ($iterable is non-empty-array ? non-empty-list : list) */ function map_with_key(iterable $iterable, Closure $function): array {