From 5673f43c2dd4071d8be05199decbdc75b5f3818f Mon Sep 17 00:00:00 2001 From: Bibi Date: Thu, 6 Jul 2023 07:56:50 +0200 Subject: [PATCH] Updated the FlagBag templates --- src/FlagBag.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/FlagBag.php b/src/FlagBag.php index e80ec35..981bb66 100644 --- a/src/FlagBag.php +++ b/src/FlagBag.php @@ -76,9 +76,11 @@ private static function checkIntBackedEnumType(string|object $enumOrType): void } /** - * @param class-string $enumType + * @template E of \BackedEnum + * + * @param class-string $enumType * - * @return FlagBag + * @return FlagBag */ public static function fromAll(string $enumType): FlagBag { @@ -86,7 +88,15 @@ public static function fromAll(string $enumType): FlagBag } /** + * @psalm-template E of \BackedEnum + * * @param class-string|T $enumOrType + * + * @psalm-param E ...$flags + * + * @phpstan-return FlagBag + * + * @psalm-return FlagBag */ public static function from(string|\BackedEnum $enumOrType, \BackedEnum ...$flags): static {