diff --git a/src/Assert.php b/src/Assert.php index 31c861b9..8fd1d419 100644 --- a/src/Assert.php +++ b/src/Assert.php @@ -2030,9 +2030,11 @@ public static function implementsInterface(mixed $value, mixed $interface, strin /** * @psalm-pure * - * @param string|object $classOrObject + * @template T as class-string|object + * @param T $classOrObject * @param string|callable():string $message * + * @return T * @throws InvalidArgumentException */ public static function propertyExists(mixed $classOrObject, mixed $property, string|callable $message = ''): object|string diff --git a/src/Mixin.php b/src/Mixin.php index a714f16c..13b77849 100644 --- a/src/Mixin.php +++ b/src/Mixin.php @@ -4711,10 +4711,12 @@ public static function allNullOrImplementsInterface(mixed $value, mixed $interfa /** * @psalm-pure * - * @param string|object|null $classOrObject + * @template T as class-string|object + * + * @param T|null $classOrObject * @param string|callable():string $message * - * @return string|object|null + * @return T|null * * @throws InvalidArgumentException */ @@ -4728,10 +4730,12 @@ public static function nullOrPropertyExists(mixed $classOrObject, mixed $propert /** * @psalm-pure * - * @param iterable $classOrObject + * @template T as class-string|object + * + * @param iterable $classOrObject * @param string|callable():string $message * - * @return iterable + * @return iterable * * @throws InvalidArgumentException */ @@ -4749,10 +4753,12 @@ public static function allPropertyExists(mixed $classOrObject, mixed $property, /** * @psalm-pure * - * @param iterable $classOrObject - * @param string|callable():string $message + * @template T as class-string|object|null + * + * @param iterable $classOrObject + * @param string|callable():string $message * - * @return iterable + * @return iterable * * @throws InvalidArgumentException */ diff --git a/tests/static-analysis/assert-alnum.php b/tests/static-analysis/assert-alnum.php index 39efb287..a3c4b685 100644 --- a/tests/static-analysis/assert-alnum.php +++ b/tests/static-analysis/assert-alnum.php @@ -26,6 +26,7 @@ function nullOrAlnum(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allAlnum(iterable $value): iterable { @@ -36,6 +37,7 @@ function allAlnum(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrAlnum(iterable $value): iterable { diff --git a/tests/static-analysis/assert-boolean.php b/tests/static-analysis/assert-boolean.php index f9d5ff7a..bf840916 100644 --- a/tests/static-analysis/assert-boolean.php +++ b/tests/static-analysis/assert-boolean.php @@ -24,6 +24,8 @@ function nullOrBoolean(mixed $value): ?bool /** * @psalm-pure + * + * @return iterable */ function allBoolean(mixed $value): iterable { @@ -32,6 +34,8 @@ function allBoolean(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrBoolean(mixed $value): iterable { diff --git a/tests/static-analysis/assert-classExists.php b/tests/static-analysis/assert-classExists.php index 9965eb46..df722545 100644 --- a/tests/static-analysis/assert-classExists.php +++ b/tests/static-analysis/assert-classExists.php @@ -22,11 +22,17 @@ function nullOrClassExists(mixed $value): ?string return Assert::nullOrClassExists($value); } +/** + * @return iterable + */ function allClassExists(mixed $value): iterable { return Assert::allClassExists($value); } +/** + * @return iterable + */ function allNullOrClassExists(mixed $value): iterable { return Assert::allNullOrClassExists($value); diff --git a/tests/static-analysis/assert-contains.php b/tests/static-analysis/assert-contains.php index 7209ebb1..34fe10e6 100644 --- a/tests/static-analysis/assert-contains.php +++ b/tests/static-analysis/assert-contains.php @@ -26,6 +26,7 @@ function nullOrContains(?string $value, string $subString): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allContains(iterable $value, string $subString): iterable { @@ -36,6 +37,7 @@ function allContains(iterable $value, string $subString): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrContains(iterable $value, string $subString): iterable { diff --git a/tests/static-analysis/assert-count.php b/tests/static-analysis/assert-count.php index ee8f1251..dbc49515 100644 --- a/tests/static-analysis/assert-count.php +++ b/tests/static-analysis/assert-count.php @@ -9,6 +9,7 @@ /** * @param Countable|array $value + * @return Countable|array */ function count(Countable|array $value, int $number): Countable|array { @@ -17,6 +18,7 @@ function count(Countable|array $value, int $number): Countable|array /** * @param null|Countable|array $value + * @return null|Countable|array */ function nullOrCount(Countable|array|null $value, int $number): Countable|array|null { @@ -25,6 +27,7 @@ function nullOrCount(Countable|array|null $value, int $number): Countable|array| /** * @param iterable $value + * @return iterable */ function allCount(iterable $value, int $number): iterable { @@ -33,6 +36,7 @@ function allCount(iterable $value, int $number): iterable /** * @param iterable $value + * @return iterable */ function allNullOrCount(iterable $value, int $number): iterable { diff --git a/tests/static-analysis/assert-countBetween.php b/tests/static-analysis/assert-countBetween.php index 896b9274..ce589883 100644 --- a/tests/static-analysis/assert-countBetween.php +++ b/tests/static-analysis/assert-countBetween.php @@ -11,6 +11,7 @@ * @param Countable|array $value * @param int|float $min * @param int|float $max + * @return Countable|array */ function countBetween(mixed $value, $min, $max): Countable|array { @@ -21,6 +22,7 @@ function countBetween(mixed $value, $min, $max): Countable|array * @param null|Countable|array $value * @param int|float $min * @param int|float $max + * @return null|Countable|array */ function nullOrCountBetween(mixed $value, $min, $max): Countable|array|null { @@ -31,6 +33,7 @@ function nullOrCountBetween(mixed $value, $min, $max): Countable|array|null * @param iterable $value * @param int|float $min * @param int|float $max + * @return iterable */ function allCountBetween(iterable $value, $min, $max): iterable { @@ -41,6 +44,7 @@ function allCountBetween(iterable $value, $min, $max): iterable * @param iterable $value * @param int|float $min * @param int|float $max + * @return iterable */ function allNullOrCountBetween(iterable $value, $min, $max): iterable { diff --git a/tests/static-analysis/assert-digits.php b/tests/static-analysis/assert-digits.php index 41d51c08..c409682c 100644 --- a/tests/static-analysis/assert-digits.php +++ b/tests/static-analysis/assert-digits.php @@ -26,6 +26,7 @@ function nullOrDigits(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allDigits(iterable $value): iterable { @@ -36,6 +37,7 @@ function allDigits(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrDigits(iterable $value): iterable { diff --git a/tests/static-analysis/assert-endsWith.php b/tests/static-analysis/assert-endsWith.php index 90075ca1..edf9d1bc 100644 --- a/tests/static-analysis/assert-endsWith.php +++ b/tests/static-analysis/assert-endsWith.php @@ -26,6 +26,7 @@ function nullOrEndsWith(?string $value, string $suffix): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allEndsWith(iterable $value, string $suffix): iterable { @@ -36,6 +37,7 @@ function allEndsWith(iterable $value, string $suffix): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrEndsWith(iterable $value, string $suffix): iterable { diff --git a/tests/static-analysis/assert-false.php b/tests/static-analysis/assert-false.php index b73004fb..30c54d77 100644 --- a/tests/static-analysis/assert-false.php +++ b/tests/static-analysis/assert-false.php @@ -28,6 +28,8 @@ function nullOrFalse(mixed $value): ?bool /** * @psalm-pure + * + * @return iterable */ function allFalse(mixed $value): iterable { @@ -36,6 +38,8 @@ function allFalse(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrFalse(mixed $value): iterable { diff --git a/tests/static-analysis/assert-float.php b/tests/static-analysis/assert-float.php index 125dc5bb..754bd63b 100644 --- a/tests/static-analysis/assert-float.php +++ b/tests/static-analysis/assert-float.php @@ -24,6 +24,8 @@ function nullOrFloat(mixed $value): ?float /** * @psalm-pure + * + * @return iterable */ function allFloat(mixed $value): iterable { @@ -32,6 +34,8 @@ function allFloat(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrFloat(mixed $value): iterable { diff --git a/tests/static-analysis/assert-implementsInterface.php b/tests/static-analysis/assert-implementsInterface.php index 03e1c22a..3426b268 100644 --- a/tests/static-analysis/assert-implementsInterface.php +++ b/tests/static-analysis/assert-implementsInterface.php @@ -29,6 +29,8 @@ function nullOrImplementsInterface(mixed $value) /** * @psalm-pure + * + * @return iterable> */ function allImplementsInterface(mixed $value): iterable { @@ -37,6 +39,8 @@ function allImplementsInterface(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|null> */ function allNullOrImplementsInterface(mixed $value): iterable { diff --git a/tests/static-analysis/assert-integer.php b/tests/static-analysis/assert-integer.php index 49db520b..9a041b23 100644 --- a/tests/static-analysis/assert-integer.php +++ b/tests/static-analysis/assert-integer.php @@ -24,6 +24,8 @@ function nullOrInteger(mixed $value): ?int /** * @psalm-pure + * + * @return iterable */ function allInteger(mixed $value): iterable { @@ -32,6 +34,8 @@ function allInteger(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrInteger(mixed $value): iterable { diff --git a/tests/static-analysis/assert-integerish.php b/tests/static-analysis/assert-integerish.php index 023dc1cc..c0bf1530 100644 --- a/tests/static-analysis/assert-integerish.php +++ b/tests/static-analysis/assert-integerish.php @@ -28,6 +28,8 @@ function nullOrIntegerish(mixed $value) /** * @psalm-pure + * + * @return iterable */ function allIntegerish(mixed $value): iterable { @@ -36,6 +38,8 @@ function allIntegerish(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIntegerish(mixed $value): iterable { diff --git a/tests/static-analysis/assert-interfaceExists.php b/tests/static-analysis/assert-interfaceExists.php index 3299b5f6..eb325396 100644 --- a/tests/static-analysis/assert-interfaceExists.php +++ b/tests/static-analysis/assert-interfaceExists.php @@ -22,11 +22,17 @@ function nullOrInterfaceExists(mixed $value): ?string return Assert::nullOrInterfaceExists($value); } +/** + * @return iterable + */ function allInterfaceExists(mixed $value): iterable { return Assert::allInterfaceExists($value); } +/** + * @return iterable + */ function allNullOrInterfaceExists(mixed $value): iterable { return Assert::allNullOrInterfaceExists($value); diff --git a/tests/static-analysis/assert-isAnyOf.php b/tests/static-analysis/assert-isAnyOf.php index 268f610d..8ed6b7e7 100644 --- a/tests/static-analysis/assert-isAnyOf.php +++ b/tests/static-analysis/assert-isAnyOf.php @@ -11,6 +11,7 @@ * * @param object|string $value * @param array $classes + * @return object|string */ function isAnyOf(mixed $value, array $classes): object|string { @@ -22,6 +23,7 @@ function isAnyOf(mixed $value, array $classes): object|string * * @param null|object|string $value * @param array $classes + * @return null|object|string */ function nullOrIsAnyOf(mixed $value, array $classes): object|string|null { @@ -33,6 +35,7 @@ function nullOrIsAnyOf(mixed $value, array $classes): object|string|null * * @param iterable $value * @param array $classes + * @return iterable */ function allIsAnyOf(mixed $value, array $classes): iterable { @@ -44,6 +47,7 @@ function allIsAnyOf(mixed $value, array $classes): iterable * * @param iterable $value * @param array $classes + * @return iterable */ function allNullOrIsAnyOf(mixed $value, array $classes): iterable { diff --git a/tests/static-analysis/assert-isArray.php b/tests/static-analysis/assert-isArray.php index 76828646..27b71951 100644 --- a/tests/static-analysis/assert-isArray.php +++ b/tests/static-analysis/assert-isArray.php @@ -24,6 +24,8 @@ function nullOrIsArray(mixed $value): ?array /** * @psalm-pure + * + * @return iterable */ function allIsArray(mixed $value): iterable { @@ -32,6 +34,8 @@ function allIsArray(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsArray(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isArrayAccessible.php b/tests/static-analysis/assert-isArrayAccessible.php index 6989b74e..7692c34b 100644 --- a/tests/static-analysis/assert-isArrayAccessible.php +++ b/tests/static-analysis/assert-isArrayAccessible.php @@ -9,6 +9,8 @@ /** * @psalm-pure + * + * @return array|ArrayAccess */ function isArrayAccessible(mixed $value): array|ArrayAccess { @@ -17,6 +19,8 @@ function isArrayAccessible(mixed $value): array|ArrayAccess /** * @psalm-pure + * + * @return null|array|ArrayAccess */ function nullOrIsArrayAccessible(mixed $value): array|ArrayAccess|null { @@ -25,6 +29,8 @@ function nullOrIsArrayAccessible(mixed $value): array|ArrayAccess|null /** * @psalm-pure + * + * @return iterable */ function allIsArrayAccessible(mixed $value): iterable { @@ -33,6 +39,8 @@ function allIsArrayAccessible(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsArrayAccessible(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isCallable.php b/tests/static-analysis/assert-isCallable.php index 62a733f8..8eb94756 100644 --- a/tests/static-analysis/assert-isCallable.php +++ b/tests/static-analysis/assert-isCallable.php @@ -24,6 +24,8 @@ function nullOrIsCallable(mixed $value): ?callable /** * @psalm-pure + * + * @return iterable */ function allIsCallable(mixed $value): iterable { @@ -32,6 +34,8 @@ function allIsCallable(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsCallable(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isCountable.php b/tests/static-analysis/assert-isCountable.php index c5024bbb..9a3291eb 100644 --- a/tests/static-analysis/assert-isCountable.php +++ b/tests/static-analysis/assert-isCountable.php @@ -9,6 +9,8 @@ /** * @psalm-pure + * + * @return countable */ function isCountable(mixed $value): Countable { @@ -17,6 +19,8 @@ function isCountable(mixed $value): Countable /** * @psalm-pure + * + * @return null|countable */ function nullOrIsCountable(mixed $value): ?Countable { diff --git a/tests/static-analysis/assert-isEmpty.php b/tests/static-analysis/assert-isEmpty.php index 281a33d4..c30f9c4f 100644 --- a/tests/static-analysis/assert-isEmpty.php +++ b/tests/static-analysis/assert-isEmpty.php @@ -8,6 +8,8 @@ /** * @psalm-pure + * + * @return null */ function isEmptyNullableObject(?object $value): null { @@ -66,6 +68,8 @@ function nullOrIsEmpty(?object $value): null /** * @psalm-pure + * + * @return iterable */ function allIsEmpty(mixed $value): iterable { @@ -74,6 +78,8 @@ function allIsEmpty(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsEmpty(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isInstanceOf.php b/tests/static-analysis/assert-isInstanceOf.php index 810a3a7a..b3afe96e 100644 --- a/tests/static-analysis/assert-isInstanceOf.php +++ b/tests/static-analysis/assert-isInstanceOf.php @@ -25,6 +25,8 @@ function nullOrIsInstanceOf(mixed $value): ?Serializable /** * @psalm-pure + * + * @return iterable */ function allIsInstanceOf(mixed $value): iterable { @@ -33,6 +35,8 @@ function allIsInstanceOf(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsInstanceOf(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isIterable.php b/tests/static-analysis/assert-isIterable.php index bbec7866..05ec608f 100644 --- a/tests/static-analysis/assert-isIterable.php +++ b/tests/static-analysis/assert-isIterable.php @@ -24,6 +24,8 @@ function nullOrIsIterable(mixed $value): ?iterable /** * @psalm-pure + * + * @return iterable */ function allIsIterable(mixed $value): iterable { @@ -32,6 +34,8 @@ function allIsIterable(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsIterable(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isList.php b/tests/static-analysis/assert-isList.php index 7c601a96..32d33a98 100644 --- a/tests/static-analysis/assert-isList.php +++ b/tests/static-analysis/assert-isList.php @@ -41,6 +41,8 @@ function nullOrIsList(mixed $value): ?array /** * @psalm-pure + * + * @return iterable> */ function allIsList(mixed $value): iterable { @@ -49,6 +51,8 @@ function allIsList(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|null> */ function allNullOrIsList(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isMap.php b/tests/static-analysis/assert-isMap.php index f1367c73..05966e84 100644 --- a/tests/static-analysis/assert-isMap.php +++ b/tests/static-analysis/assert-isMap.php @@ -57,6 +57,7 @@ function nullOrIsMap(mixed $value): ?array * @psalm-pure * * @param iterable> $value + * @return iterable> */ function allIsMap(iterable $value): iterable { @@ -67,6 +68,7 @@ function allIsMap(iterable $value): iterable * @psalm-pure * * @param iterable> $value + * @return iterable|null> */ function allNullOrIsMap(iterable $value): iterable { diff --git a/tests/static-analysis/assert-isNonEmptyList.php b/tests/static-analysis/assert-isNonEmptyList.php index 5f21141f..ce6ba04d 100644 --- a/tests/static-analysis/assert-isNonEmptyList.php +++ b/tests/static-analysis/assert-isNonEmptyList.php @@ -38,6 +38,8 @@ function nullOrIsNonEmptyList(mixed $value): ?array /** * @psalm-pure + * + * @return iterable> */ function allIsNonEmptyList(mixed $value): iterable { @@ -46,6 +48,8 @@ function allIsNonEmptyList(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|null> */ function allNullOrIsNonEmptyList(mixed $value): iterable { diff --git a/tests/static-analysis/assert-isNonEmptyMap.php b/tests/static-analysis/assert-isNonEmptyMap.php index bb80f8a7..3fd8b832 100644 --- a/tests/static-analysis/assert-isNonEmptyMap.php +++ b/tests/static-analysis/assert-isNonEmptyMap.php @@ -47,6 +47,7 @@ function nullOrIsNonEmptyMap(?array $value): ?array * @psalm-pure * * @param iterable> $value + * @return iterable> */ function allIsNonEmptyMap(iterable $value): iterable { @@ -57,6 +58,7 @@ function allIsNonEmptyMap(iterable $value): iterable * @psalm-pure * * @param iterable|null> $value + * @return iterable> */ function allNullOrIsNonEmptyMap(iterable $value): iterable { diff --git a/tests/static-analysis/assert-isNotA.php b/tests/static-analysis/assert-isNotA.php index 506cd426..8f569c29 100644 --- a/tests/static-analysis/assert-isNotA.php +++ b/tests/static-analysis/assert-isNotA.php @@ -22,6 +22,7 @@ function isNotA(mixed $value): object|string * * @param null|object|string $value * @param class-string $class + * @return null|object|string */ function nullOrIsNotA(mixed $value, $class): object|string|null { @@ -33,6 +34,7 @@ function nullOrIsNotA(mixed $value, $class): object|string|null * * @param iterable $value * @param class-string $class + * @return iterable */ function allIsNotA(mixed $value, $class): iterable { @@ -44,6 +46,7 @@ function allIsNotA(mixed $value, $class): iterable * * @param iterable $value * @param class-string $class + * @return iterable */ function allNullOrIsNotA(mixed $value, $class): iterable { diff --git a/tests/static-analysis/assert-keyExists.php b/tests/static-analysis/assert-keyExists.php index 222ebf40..14afba80 100644 --- a/tests/static-analysis/assert-keyExists.php +++ b/tests/static-analysis/assert-keyExists.php @@ -31,6 +31,7 @@ function nullOrKeyExists(?array $array, $key): ?array * * @param iterable $array * @param array-key $key + * @return iterable */ function allKeyExists(iterable $array, $key): iterable { @@ -42,6 +43,7 @@ function allKeyExists(iterable $array, $key): iterable * * @param iterable $array * @param array-key $key + * @return iterable */ function allNullOrKeyExists(iterable $array, $key): iterable { diff --git a/tests/static-analysis/assert-keyNotExists.php b/tests/static-analysis/assert-keyNotExists.php index 0f5c9eab..6682b0a1 100644 --- a/tests/static-analysis/assert-keyNotExists.php +++ b/tests/static-analysis/assert-keyNotExists.php @@ -31,6 +31,7 @@ function nullOrKeyNotExists(?array $array, $key): ?array * * @param iterable $array * @param array-key $key + * @return iterable */ function allKeyNotExists(iterable $array, $key): iterable { @@ -42,6 +43,7 @@ function allKeyNotExists(iterable $array, $key): iterable * * @param iterable $array * @param array-key $key + * @return iterable */ function allNullOrKeyNotExists(iterable $array, $key): iterable { diff --git a/tests/static-analysis/assert-length.php b/tests/static-analysis/assert-length.php index 7fa32c51..3829c313 100644 --- a/tests/static-analysis/assert-length.php +++ b/tests/static-analysis/assert-length.php @@ -26,6 +26,7 @@ function nullOrLength(?string $value, int $length): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allLength(iterable $value, int $length): iterable { @@ -36,6 +37,7 @@ function allLength(iterable $value, int $length): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrLength(iterable $value, int $length): iterable { diff --git a/tests/static-analysis/assert-lower.php b/tests/static-analysis/assert-lower.php index 4bef1f8e..77e54a79 100644 --- a/tests/static-analysis/assert-lower.php +++ b/tests/static-analysis/assert-lower.php @@ -30,6 +30,7 @@ function nullOrLower(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allLower(iterable $value): iterable { @@ -40,6 +41,7 @@ function allLower(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrLower(iterable $value): iterable { diff --git a/tests/static-analysis/assert-maxCount.php b/tests/static-analysis/assert-maxCount.php index d9702fca..d093dd4e 100644 --- a/tests/static-analysis/assert-maxCount.php +++ b/tests/static-analysis/assert-maxCount.php @@ -10,6 +10,7 @@ /** * @param Countable|array $array * @param int|float $max + * @return Countable|array */ function maxCount(mixed $array, $max): Countable|array { @@ -19,6 +20,7 @@ function maxCount(mixed $array, $max): Countable|array /** * @param null|Countable|array $array * @param int|float $max + * @return null|Countable|array */ function nullOrMaxCount(mixed $array, $max): Countable|array|null { @@ -28,6 +30,7 @@ function nullOrMaxCount(mixed $array, $max): Countable|array|null /** * @param iterable $array * @param int|float $max + * @return iterable */ function allMaxCount(iterable $array, $max): iterable { @@ -37,6 +40,7 @@ function allMaxCount(iterable $array, $max): iterable /** * @param iterable $array * @param int|float $max + * @return iterable */ function allNullOrMaxCount(iterable $array, $max): iterable { diff --git a/tests/static-analysis/assert-methodExists.php b/tests/static-analysis/assert-methodExists.php index 6670a7a3..8dc1ac1d 100644 --- a/tests/static-analysis/assert-methodExists.php +++ b/tests/static-analysis/assert-methodExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $method + * @return class-string|object */ function methodExists(mixed $classOrObject, $method): string|object { @@ -22,6 +23,7 @@ function methodExists(mixed $classOrObject, $method): string|object * * @param null|class-string|object $classOrObject * @param mixed $method + * @return null|class-string|object */ function nullOrMethodExists(mixed $classOrObject, $method): string|object|null { @@ -33,6 +35,7 @@ function nullOrMethodExists(mixed $classOrObject, $method): string|object|null * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allMethodExists(iterable $classOrObject, $method): iterable { @@ -44,6 +47,7 @@ function allMethodExists(iterable $classOrObject, $method): iterable * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allNullOrMethodExists(iterable $classOrObject, $method): iterable { diff --git a/tests/static-analysis/assert-methodNotExists.php b/tests/static-analysis/assert-methodNotExists.php index b51cbfa4..124d1bf8 100644 --- a/tests/static-analysis/assert-methodNotExists.php +++ b/tests/static-analysis/assert-methodNotExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $method + * @return class-string|object */ function methodNotExists(mixed $classOrObject, $method): string|object { @@ -22,6 +23,7 @@ function methodNotExists(mixed $classOrObject, $method): string|object * * @param null|class-string|object $classOrObject * @param mixed $method + * @return null|class-string|object */ function nullOrMethodNotExists(mixed $classOrObject, $method): string|object|null { @@ -33,6 +35,7 @@ function nullOrMethodNotExists(mixed $classOrObject, $method): string|object|nul * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allMethodNotExists(iterable $classOrObject, $method): iterable { @@ -44,6 +47,7 @@ function allMethodNotExists(iterable $classOrObject, $method): iterable * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allNullOrMethodNotExists(iterable $classOrObject, $method): iterable { diff --git a/tests/static-analysis/assert-minCount.php b/tests/static-analysis/assert-minCount.php index d7e323a4..9d4708f5 100644 --- a/tests/static-analysis/assert-minCount.php +++ b/tests/static-analysis/assert-minCount.php @@ -10,6 +10,7 @@ /** * @param Countable|array $array * @param int|float $min + * @return Countable|array */ function minCount(mixed $array, $min): Countable|array { @@ -19,6 +20,7 @@ function minCount(mixed $array, $min): Countable|array /** * @param null|Countable|array $array * @param int|float $min + * @return null|Countable|array */ function nullOrMinCount(mixed $array, $min): Countable|array|null { diff --git a/tests/static-analysis/assert-minLength.php b/tests/static-analysis/assert-minLength.php index 303e9469..615bfc8e 100644 --- a/tests/static-analysis/assert-minLength.php +++ b/tests/static-analysis/assert-minLength.php @@ -31,6 +31,7 @@ function nullOrMinLength(?string $value, $min): ?string * * @param iterable $value * @param int|float $min + * @return iterable */ function allMinLength(iterable $value, $min): iterable { @@ -42,6 +43,7 @@ function allMinLength(iterable $value, $min): iterable * * @param iterable $value * @param int|float $min + * @return iterable */ function allNullOrMinLength(iterable $value, $min): iterable { diff --git a/tests/static-analysis/assert-notContains.php b/tests/static-analysis/assert-notContains.php index ff9afa0d..c68f3374 100644 --- a/tests/static-analysis/assert-notContains.php +++ b/tests/static-analysis/assert-notContains.php @@ -26,6 +26,7 @@ function nullOrNotContains(?string $value, string $subString): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allNotContains(iterable $value, string $subString): iterable { @@ -36,6 +37,7 @@ function allNotContains(iterable $value, string $subString): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrNotContains(iterable $value, string $subString): iterable { diff --git a/tests/static-analysis/assert-notRegex.php b/tests/static-analysis/assert-notRegex.php index 282214c3..ef6c9850 100644 --- a/tests/static-analysis/assert-notRegex.php +++ b/tests/static-analysis/assert-notRegex.php @@ -26,6 +26,7 @@ function nullOrNotRegex(?string $value, string $pattern): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allNotRegex(iterable $value, string $pattern): iterable { @@ -36,6 +37,7 @@ function allNotRegex(iterable $value, string $pattern): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrNotRegex(iterable $value, string $pattern): iterable { diff --git a/tests/static-analysis/assert-notWhitespaceOnly.php b/tests/static-analysis/assert-notWhitespaceOnly.php index a296e0f3..832b501f 100644 --- a/tests/static-analysis/assert-notWhitespaceOnly.php +++ b/tests/static-analysis/assert-notWhitespaceOnly.php @@ -26,6 +26,7 @@ function nullOrNotWhitespaceOnly(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allNotWhitespaceOnly(iterable $value): iterable { @@ -36,6 +37,7 @@ function allNotWhitespaceOnly(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrNotWhitespaceOnly(iterable $value): iterable { diff --git a/tests/static-analysis/assert-null.php b/tests/static-analysis/assert-null.php index 6594f184..e37d9683 100644 --- a/tests/static-analysis/assert-null.php +++ b/tests/static-analysis/assert-null.php @@ -8,6 +8,8 @@ /** * @psalm-pure + * + * @return null */ function null(mixed $value): null { @@ -16,6 +18,8 @@ function null(mixed $value): null /** * @psalm-pure + * + * @return iterable */ function allNull(mixed $value): iterable { diff --git a/tests/static-analysis/assert-numeric.php b/tests/static-analysis/assert-numeric.php index 2461ad51..cc5b4b98 100644 --- a/tests/static-analysis/assert-numeric.php +++ b/tests/static-analysis/assert-numeric.php @@ -28,6 +28,8 @@ function nullOrNumeric(mixed $value) /** * @psalm-pure + * + * @return iterable */ function allNumeric(mixed $value): iterable { @@ -36,6 +38,8 @@ function allNumeric(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrNumeric(mixed $value): iterable { diff --git a/tests/static-analysis/assert-object.php b/tests/static-analysis/assert-object.php index 6bd2af37..d6e42870 100644 --- a/tests/static-analysis/assert-object.php +++ b/tests/static-analysis/assert-object.php @@ -24,6 +24,8 @@ function nullOrObject(mixed $value): ?object /** * @psalm-pure + * + * @return iterable */ function allObject(mixed $value): iterable { @@ -32,6 +34,8 @@ function allObject(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrObject(mixed $value): iterable { diff --git a/tests/static-analysis/assert-positiveInteger.php b/tests/static-analysis/assert-positiveInteger.php index 2085be76..b196372f 100644 --- a/tests/static-analysis/assert-positiveInteger.php +++ b/tests/static-analysis/assert-positiveInteger.php @@ -40,6 +40,8 @@ function nullOrPositiveInteger(mixed $value): ?int /** * @psalm-pure + * + * @return iterable */ function allPositiveInteger(mixed $value): iterable { @@ -48,6 +50,8 @@ function allPositiveInteger(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrPositiveInteger(mixed $value): iterable { diff --git a/tests/static-analysis/assert-propertyExists.php b/tests/static-analysis/assert-propertyExists.php index 0caa41d1..3d611514 100644 --- a/tests/static-analysis/assert-propertyExists.php +++ b/tests/static-analysis/assert-propertyExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $property + * @return class-string|object */ function propertyExists(mixed $classOrObject, $property): string|object { @@ -22,6 +23,7 @@ function propertyExists(mixed $classOrObject, $property): string|object * * @param null|class-string|object $classOrObject * @param mixed $property + * @return null|class-string|object */ function nullOrPropertyExists(mixed $classOrObject, $property): string|object|null { @@ -33,6 +35,7 @@ function nullOrPropertyExists(mixed $classOrObject, $property): string|object|nu * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allPropertyExists(iterable $classOrObject, $property): iterable { @@ -44,6 +47,7 @@ function allPropertyExists(iterable $classOrObject, $property): iterable * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allNullOrPropertyExists(iterable $classOrObject, $property): iterable { diff --git a/tests/static-analysis/assert-propertyNotExists.php b/tests/static-analysis/assert-propertyNotExists.php index 47cb76b8..a84af984 100644 --- a/tests/static-analysis/assert-propertyNotExists.php +++ b/tests/static-analysis/assert-propertyNotExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $property + * @return class-string|object */ function propertyNotExists(mixed $classOrObject, $property): string|object { @@ -22,6 +23,7 @@ function propertyNotExists(mixed $classOrObject, $property): string|object * * @param null|class-string|object $classOrObject * @param mixed $property + * @return null|class-string|object */ function nullOrPropertyNotExists(mixed $classOrObject, $property): string|object|null { @@ -33,6 +35,7 @@ function nullOrPropertyNotExists(mixed $classOrObject, $property): string|object * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allPropertyNotExists(iterable $classOrObject, $property): iterable { @@ -44,6 +47,7 @@ function allPropertyNotExists(iterable $classOrObject, $property): iterable * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allNullOrPropertyNotExists(iterable $classOrObject, $property): iterable { diff --git a/tests/static-analysis/assert-readable.php b/tests/static-analysis/assert-readable.php index 60abe540..206aaf85 100644 --- a/tests/static-analysis/assert-readable.php +++ b/tests/static-analysis/assert-readable.php @@ -18,6 +18,7 @@ function nullOrReadable(?string $value): ?string /** * @param iterable $value + * @return iterable */ function allReadable(iterable $value): iterable { @@ -26,6 +27,7 @@ function allReadable(iterable $value): iterable /** * @param iterable $value + * @return iterable */ function allNullOrReadable(iterable $value): iterable { diff --git a/tests/static-analysis/assert-regex.php b/tests/static-analysis/assert-regex.php index a747ea53..e9878609 100644 --- a/tests/static-analysis/assert-regex.php +++ b/tests/static-analysis/assert-regex.php @@ -26,6 +26,7 @@ function nullOrRegex(?string $value, string $pattern): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allRegex(iterable $value, string $pattern): iterable { @@ -36,6 +37,7 @@ function allRegex(iterable $value, string $pattern): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrRegex(iterable $value, string $pattern): iterable { diff --git a/tests/static-analysis/assert-resource.php b/tests/static-analysis/assert-resource.php index 7daea7eb..364627e2 100644 --- a/tests/static-analysis/assert-resource.php +++ b/tests/static-analysis/assert-resource.php @@ -9,6 +9,7 @@ /** * @psalm-pure * @param null|string $type + * @return resource */ function resource(mixed $value, ?string $type): mixed { @@ -18,6 +19,7 @@ function resource(mixed $value, ?string $type): mixed /** * @psalm-pure * @param null|string $type + * @return null|resource */ function nullOrResource(mixed $value, ?string $type): mixed { @@ -27,6 +29,7 @@ function nullOrResource(mixed $value, ?string $type): mixed /** * @psalm-pure * @param null|string $type + * @return iterable */ function allResource(mixed $value, $type): iterable { @@ -36,6 +39,7 @@ function allResource(mixed $value, $type): iterable /** * @psalm-pure * @param null|string $type + * @return iterable */ function allNullOrResource(mixed $value, $type): iterable { diff --git a/tests/static-analysis/assert-scalar.php b/tests/static-analysis/assert-scalar.php index a75371d7..b1aa4c6a 100644 --- a/tests/static-analysis/assert-scalar.php +++ b/tests/static-analysis/assert-scalar.php @@ -8,6 +8,8 @@ /** * @psalm-pure + * + * @return scalar */ function scalar(mixed $value): int|float|string|bool { @@ -16,6 +18,8 @@ function scalar(mixed $value): int|float|string|bool /** * @psalm-pure + * + * @return null|scalar */ function nullOrScalar(mixed $value): int|float|string|bool|null { @@ -24,6 +28,8 @@ function nullOrScalar(mixed $value): int|float|string|bool|null /** * @psalm-pure + * + * @return iterable */ function allScalar(mixed $value): iterable { @@ -32,6 +38,8 @@ function allScalar(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrScalar(mixed $value): iterable { diff --git a/tests/static-analysis/assert-startsWith.php b/tests/static-analysis/assert-startsWith.php index 65944dfd..a929d44f 100644 --- a/tests/static-analysis/assert-startsWith.php +++ b/tests/static-analysis/assert-startsWith.php @@ -26,6 +26,7 @@ function nullOrStartsWith(?string $value, string $prefix): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allStartsWith(iterable $value, string $prefix): iterable { @@ -36,6 +37,7 @@ function allStartsWith(iterable $value, string $prefix): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrStartsWith(iterable $value, string $prefix): iterable { diff --git a/tests/static-analysis/assert-string.php b/tests/static-analysis/assert-string.php index 4f6e09e8..fd264bb9 100644 --- a/tests/static-analysis/assert-string.php +++ b/tests/static-analysis/assert-string.php @@ -24,6 +24,8 @@ function nullOrString(mixed $value): ?string /** * @psalm-pure + * + * @return iterable */ function allString(mixed $value): iterable { @@ -32,6 +34,8 @@ function allString(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrString(mixed $value): iterable { diff --git a/tests/static-analysis/assert-stringNotEmpty.php b/tests/static-analysis/assert-stringNotEmpty.php index 4407f038..29f8d76c 100644 --- a/tests/static-analysis/assert-stringNotEmpty.php +++ b/tests/static-analysis/assert-stringNotEmpty.php @@ -28,6 +28,8 @@ function nullOrStringNotEmpty(mixed $value): ?string /** * @psalm-pure + * + * @return iterable */ function allStringNotEmpty(mixed $value): iterable { @@ -36,6 +38,8 @@ function allStringNotEmpty(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrStringNotEmpty(mixed $value): iterable { diff --git a/tests/static-analysis/assert-subclassOf.php b/tests/static-analysis/assert-subclassOf.php index 0f2fdb9e..9d137ca6 100644 --- a/tests/static-analysis/assert-subclassOf.php +++ b/tests/static-analysis/assert-subclassOf.php @@ -29,6 +29,8 @@ function nullOrSubclassOf(mixed $value) /** * @psalm-pure + * + * @return iterable|stdClass> */ function allSubclassOf(mixed $value): iterable { @@ -37,6 +39,8 @@ function allSubclassOf(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|stdClass|null> */ function allNullOrSubclassOf(mixed $value): iterable { diff --git a/tests/static-analysis/assert-throws.php b/tests/static-analysis/assert-throws.php index 38383aea..f0d1bdae 100644 --- a/tests/static-analysis/assert-throws.php +++ b/tests/static-analysis/assert-throws.php @@ -27,6 +27,7 @@ function nullOrThrows(?Closure $value, $class): ?Closure /** * @param iterable $value * @param class-string $class + * @return iterable */ function allThrows(iterable $value, $class): iterable { @@ -35,6 +36,7 @@ function allThrows(iterable $value, $class): iterable /** * @param iterable $value * @param class-string $class + * @return iterable */ function allNullOrThrows(iterable $value, $class): iterable { diff --git a/tests/static-analysis/assert-true.php b/tests/static-analysis/assert-true.php index 306c6332..33ebdcd7 100644 --- a/tests/static-analysis/assert-true.php +++ b/tests/static-analysis/assert-true.php @@ -28,6 +28,8 @@ function nullOrTrue(mixed $value): ?bool /** * @psalm-pure + * + * @return iterable */ function allTrue(mixed $value): iterable { @@ -36,6 +38,8 @@ function allTrue(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrTrue(mixed $value): iterable { diff --git a/tests/static-analysis/assert-upper.php b/tests/static-analysis/assert-upper.php index fc4c4380..12337fb8 100644 --- a/tests/static-analysis/assert-upper.php +++ b/tests/static-analysis/assert-upper.php @@ -26,6 +26,7 @@ function nullOrUpper(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allUpper(iterable $value): iterable { @@ -36,6 +37,7 @@ function allUpper(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrUpper(iterable $value): iterable { diff --git a/tests/static-analysis/assert-uuid.php b/tests/static-analysis/assert-uuid.php index 004fd388..0d32a45f 100644 --- a/tests/static-analysis/assert-uuid.php +++ b/tests/static-analysis/assert-uuid.php @@ -26,6 +26,7 @@ function nullOrUuid(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allUuid(iterable $value): iterable { @@ -36,6 +37,7 @@ function allUuid(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrUuid(iterable $value): iterable { diff --git a/tests/static-analysis/assert-validArrayKey.php b/tests/static-analysis/assert-validArrayKey.php index 59e65802..239cbbcf 100644 --- a/tests/static-analysis/assert-validArrayKey.php +++ b/tests/static-analysis/assert-validArrayKey.php @@ -28,6 +28,8 @@ function nullOrValidArrayKey(mixed $value) /** * @psalm-pure + * + * @return iterable */ function allValidArrayKey(mixed $value): iterable { @@ -36,6 +38,8 @@ function allValidArrayKey(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrValidArrayKey(mixed $value): iterable { diff --git a/tests/static-analysis/assert-writable.php b/tests/static-analysis/assert-writable.php index 80959eea..16853e59 100644 --- a/tests/static-analysis/assert-writable.php +++ b/tests/static-analysis/assert-writable.php @@ -18,6 +18,7 @@ function nullOrWritable(?string $value): ?string /** * @param iterable $value + * @return iterable */ function allWritable(iterable $value): iterable { @@ -26,6 +27,7 @@ function allWritable(iterable $value): iterable /** * @param iterable $value + * @return iterable */ function allNullOrWritable(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-alnum.php b/tests/static-analysis/non-return/assert-alnum.php index 5f449812..05804eae 100644 --- a/tests/static-analysis/non-return/assert-alnum.php +++ b/tests/static-analysis/non-return/assert-alnum.php @@ -30,6 +30,7 @@ function nullOrAlnum(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allAlnum(iterable $value): iterable { @@ -42,6 +43,7 @@ function allAlnum(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrAlnum(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-boolean.php b/tests/static-analysis/non-return/assert-boolean.php index 80c7974e..bb6e5c41 100644 --- a/tests/static-analysis/non-return/assert-boolean.php +++ b/tests/static-analysis/non-return/assert-boolean.php @@ -28,6 +28,8 @@ function nullOrBoolean(mixed $value): ?bool /** * @psalm-pure + * + * @return iterable */ function allBoolean(mixed $value): iterable { @@ -38,6 +40,8 @@ function allBoolean(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrBoolean(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-classExists.php b/tests/static-analysis/non-return/assert-classExists.php index bb73ee24..341b5ef6 100644 --- a/tests/static-analysis/non-return/assert-classExists.php +++ b/tests/static-analysis/non-return/assert-classExists.php @@ -26,6 +26,9 @@ function nullOrClassExists(mixed $value): ?string return $value; } +/** + * @return iterable + */ function allClassExists(mixed $value): iterable { Assert::allClassExists($value); @@ -33,6 +36,9 @@ function allClassExists(mixed $value): iterable return $value; } +/** + * @return iterable + */ function allNullOrClassExists(mixed $value): iterable { Assert::allNullOrClassExists($value); diff --git a/tests/static-analysis/non-return/assert-contains.php b/tests/static-analysis/non-return/assert-contains.php index 8df515f3..352cb38a 100644 --- a/tests/static-analysis/non-return/assert-contains.php +++ b/tests/static-analysis/non-return/assert-contains.php @@ -30,6 +30,7 @@ function nullOrContains(?string $value, string $subString): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allContains(iterable $value, string $subString): iterable { @@ -42,6 +43,7 @@ function allContains(iterable $value, string $subString): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrContains(iterable $value, string $subString): iterable { diff --git a/tests/static-analysis/non-return/assert-count.php b/tests/static-analysis/non-return/assert-count.php index eb412df4..8259ef85 100644 --- a/tests/static-analysis/non-return/assert-count.php +++ b/tests/static-analysis/non-return/assert-count.php @@ -9,6 +9,7 @@ /** * @param Countable|array $value + * @return Countable|array */ function count(Countable|array $value, int $number): Countable|array { @@ -19,6 +20,7 @@ function count(Countable|array $value, int $number): Countable|array /** * @param null|Countable|array $value + * @return null|Countable|array */ function nullOrCount(Countable|array|null $value, int $number): Countable|array|null { @@ -29,6 +31,7 @@ function nullOrCount(Countable|array|null $value, int $number): Countable|array| /** * @param iterable $value + * @return iterable */ function allCount(iterable $value, int $number): iterable { @@ -39,6 +42,7 @@ function allCount(iterable $value, int $number): iterable /** * @param iterable $value + * @return iterable */ function allNullOrCount(iterable $value, int $number): iterable { diff --git a/tests/static-analysis/non-return/assert-countBetween.php b/tests/static-analysis/non-return/assert-countBetween.php index 65ba3b3e..06aa019a 100644 --- a/tests/static-analysis/non-return/assert-countBetween.php +++ b/tests/static-analysis/non-return/assert-countBetween.php @@ -11,6 +11,7 @@ * @param Countable|array $value * @param int|float $min * @param int|float $max + * @return Countable|array */ function countBetween(mixed $value, $min, $max): Countable|array { @@ -23,6 +24,7 @@ function countBetween(mixed $value, $min, $max): Countable|array * @param null|Countable|array $value * @param int|float $min * @param int|float $max + * @return null|Countable|array */ function nullOrCountBetween(mixed $value, $min, $max): Countable|array|null { @@ -35,6 +37,7 @@ function nullOrCountBetween(mixed $value, $min, $max): Countable|array|null * @param iterable $value * @param int|float $min * @param int|float $max + * @return iterable */ function allCountBetween(iterable $value, $min, $max): iterable { @@ -47,6 +50,7 @@ function allCountBetween(iterable $value, $min, $max): iterable * @param iterable $value * @param int|float $min * @param int|float $max + * @return iterable */ function allNullOrCountBetween(iterable $value, $min, $max): iterable { diff --git a/tests/static-analysis/non-return/assert-digits.php b/tests/static-analysis/non-return/assert-digits.php index 472ca41d..2995e32b 100644 --- a/tests/static-analysis/non-return/assert-digits.php +++ b/tests/static-analysis/non-return/assert-digits.php @@ -30,6 +30,7 @@ function nullOrDigits(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allDigits(iterable $value): iterable { @@ -42,6 +43,7 @@ function allDigits(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrDigits(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-endsWith.php b/tests/static-analysis/non-return/assert-endsWith.php index 9b8c3416..659edd07 100644 --- a/tests/static-analysis/non-return/assert-endsWith.php +++ b/tests/static-analysis/non-return/assert-endsWith.php @@ -30,6 +30,7 @@ function nullOrEndsWith(?string $value, string $suffix): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allEndsWith(iterable $value, string $suffix): iterable { @@ -42,6 +43,7 @@ function allEndsWith(iterable $value, string $suffix): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrEndsWith(iterable $value, string $suffix): iterable { diff --git a/tests/static-analysis/non-return/assert-false.php b/tests/static-analysis/non-return/assert-false.php index 33808155..5d94a90c 100644 --- a/tests/static-analysis/non-return/assert-false.php +++ b/tests/static-analysis/non-return/assert-false.php @@ -32,6 +32,8 @@ function nullOrFalse(mixed $value): ?bool /** * @psalm-pure + * + * @return iterable */ function allFalse(mixed $value): iterable { @@ -42,6 +44,8 @@ function allFalse(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrFalse(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-float.php b/tests/static-analysis/non-return/assert-float.php index cd298100..1c24f889 100644 --- a/tests/static-analysis/non-return/assert-float.php +++ b/tests/static-analysis/non-return/assert-float.php @@ -28,6 +28,8 @@ function nullOrFloat(mixed $value): ?float /** * @psalm-pure + * + * @return iterable */ function allFloat(mixed $value): iterable { @@ -38,6 +40,8 @@ function allFloat(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrFloat(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-implementsInterface.php b/tests/static-analysis/non-return/assert-implementsInterface.php index 766c934b..57ba8d95 100644 --- a/tests/static-analysis/non-return/assert-implementsInterface.php +++ b/tests/static-analysis/non-return/assert-implementsInterface.php @@ -33,6 +33,8 @@ function nullOrImplementsInterface(mixed $value) /** * @psalm-pure + * + * @return iterable> */ function allImplementsInterface(mixed $value): iterable { @@ -43,6 +45,8 @@ function allImplementsInterface(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|null> */ function allNullOrImplementsInterface(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-integer.php b/tests/static-analysis/non-return/assert-integer.php index 65624922..b02a7860 100644 --- a/tests/static-analysis/non-return/assert-integer.php +++ b/tests/static-analysis/non-return/assert-integer.php @@ -28,6 +28,8 @@ function nullOrInteger(mixed $value): ?int /** * @psalm-pure + * + * @return iterable */ function allInteger(mixed $value): iterable { @@ -38,6 +40,8 @@ function allInteger(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrInteger(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-integerish.php b/tests/static-analysis/non-return/assert-integerish.php index 70b88e04..37b628ad 100644 --- a/tests/static-analysis/non-return/assert-integerish.php +++ b/tests/static-analysis/non-return/assert-integerish.php @@ -32,6 +32,8 @@ function nullOrIntegerish(mixed $value) /** * @psalm-pure + * + * @return iterable */ function allIntegerish(mixed $value): iterable { @@ -42,6 +44,8 @@ function allIntegerish(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIntegerish(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-interfaceExists.php b/tests/static-analysis/non-return/assert-interfaceExists.php index 33c8527a..daf94c64 100644 --- a/tests/static-analysis/non-return/assert-interfaceExists.php +++ b/tests/static-analysis/non-return/assert-interfaceExists.php @@ -26,6 +26,9 @@ function nullOrInterfaceExists(mixed $value): ?string return $value; } +/** + * @return iterable + */ function allInterfaceExists(mixed $value): iterable { Assert::allInterfaceExists($value); @@ -33,6 +36,9 @@ function allInterfaceExists(mixed $value): iterable return $value; } +/** + * @return iterable + */ function allNullOrInterfaceExists(mixed $value): iterable { Assert::allNullOrInterfaceExists($value); diff --git a/tests/static-analysis/non-return/assert-isAnyOf.php b/tests/static-analysis/non-return/assert-isAnyOf.php index 7528522c..e79b99f4 100644 --- a/tests/static-analysis/non-return/assert-isAnyOf.php +++ b/tests/static-analysis/non-return/assert-isAnyOf.php @@ -11,6 +11,7 @@ * * @param object|string $value * @param array $classes + * @return object|string */ function isAnyOf(mixed $value, array $classes): object|string { @@ -24,6 +25,7 @@ function isAnyOf(mixed $value, array $classes): object|string * * @param null|object|string $value * @param array $classes + * @return null|object|string */ function nullOrIsAnyOf(mixed $value, array $classes): object|string|null { @@ -37,6 +39,7 @@ function nullOrIsAnyOf(mixed $value, array $classes): object|string|null * * @param iterable $value * @param array $classes + * @return iterable */ function allIsAnyOf(mixed $value, array $classes): iterable { @@ -50,6 +53,7 @@ function allIsAnyOf(mixed $value, array $classes): iterable * * @param iterable $value * @param array $classes + * @return iterable */ function allNullOrIsAnyOf(mixed $value, array $classes): iterable { diff --git a/tests/static-analysis/non-return/assert-isArray.php b/tests/static-analysis/non-return/assert-isArray.php index d494c2d7..623e991e 100644 --- a/tests/static-analysis/non-return/assert-isArray.php +++ b/tests/static-analysis/non-return/assert-isArray.php @@ -28,6 +28,8 @@ function nullOrIsArray(mixed $value): ?array /** * @psalm-pure + * + * @return iterable */ function allIsArray(mixed $value): iterable { @@ -38,6 +40,8 @@ function allIsArray(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsArray(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isArrayAccessible.php b/tests/static-analysis/non-return/assert-isArrayAccessible.php index defb7445..8a8f9d48 100644 --- a/tests/static-analysis/non-return/assert-isArrayAccessible.php +++ b/tests/static-analysis/non-return/assert-isArrayAccessible.php @@ -9,6 +9,8 @@ /** * @psalm-pure + * + * @return array|ArrayAccess */ function isArrayAccessible(mixed $value): array|ArrayAccess { @@ -19,6 +21,8 @@ function isArrayAccessible(mixed $value): array|ArrayAccess /** * @psalm-pure + * + * @return null|array|ArrayAccess */ function nullOrIsArrayAccessible(mixed $value): array|ArrayAccess|null { @@ -29,6 +33,8 @@ function nullOrIsArrayAccessible(mixed $value): array|ArrayAccess|null /** * @psalm-pure + * + * @return iterable */ function allIsArrayAccessible(mixed $value): iterable { @@ -39,6 +45,8 @@ function allIsArrayAccessible(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsArrayAccessible(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isCallable.php b/tests/static-analysis/non-return/assert-isCallable.php index 8eb8dd68..7ac18461 100644 --- a/tests/static-analysis/non-return/assert-isCallable.php +++ b/tests/static-analysis/non-return/assert-isCallable.php @@ -28,6 +28,8 @@ function nullOrIsCallable(mixed $value): ?callable /** * @psalm-pure + * + * @return iterable */ function allIsCallable(mixed $value): iterable { @@ -38,6 +40,8 @@ function allIsCallable(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsCallable(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isCountable.php b/tests/static-analysis/non-return/assert-isCountable.php index f2a99e22..ebbc9962 100644 --- a/tests/static-analysis/non-return/assert-isCountable.php +++ b/tests/static-analysis/non-return/assert-isCountable.php @@ -9,6 +9,8 @@ /** * @psalm-pure + * + * @return countable */ function isCountable(mixed $value): Countable { @@ -19,6 +21,8 @@ function isCountable(mixed $value): Countable /** * @psalm-pure + * + * @return null|countable */ function nullOrIsCountable(mixed $value): ?Countable { diff --git a/tests/static-analysis/non-return/assert-isEmpty.php b/tests/static-analysis/non-return/assert-isEmpty.php index 31712d38..e87b0372 100644 --- a/tests/static-analysis/non-return/assert-isEmpty.php +++ b/tests/static-analysis/non-return/assert-isEmpty.php @@ -8,6 +8,8 @@ /** * @psalm-pure + * + * @return null */ function isEmptyNullableObject(?object $value): null { @@ -78,6 +80,8 @@ function nullOrIsEmpty(?object $value): null /** * @psalm-pure + * + * @return iterable */ function allIsEmpty(mixed $value): iterable { @@ -88,6 +92,8 @@ function allIsEmpty(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsEmpty(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isInstanceOf.php b/tests/static-analysis/non-return/assert-isInstanceOf.php index e3d5c254..c7e81e95 100644 --- a/tests/static-analysis/non-return/assert-isInstanceOf.php +++ b/tests/static-analysis/non-return/assert-isInstanceOf.php @@ -29,6 +29,8 @@ function nullOrIsInstanceOf(mixed $value): ?Serializable /** * @psalm-pure + * + * @return iterable */ function allIsInstanceOf(mixed $value): iterable { @@ -39,6 +41,8 @@ function allIsInstanceOf(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsInstanceOf(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isIterable.php b/tests/static-analysis/non-return/assert-isIterable.php index 2494e3b9..df1cbbb0 100644 --- a/tests/static-analysis/non-return/assert-isIterable.php +++ b/tests/static-analysis/non-return/assert-isIterable.php @@ -28,6 +28,8 @@ function nullOrIsIterable(mixed $value): ?iterable /** * @psalm-pure + * + * @return iterable */ function allIsIterable(mixed $value): iterable { @@ -38,6 +40,8 @@ function allIsIterable(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrIsIterable(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isList.php b/tests/static-analysis/non-return/assert-isList.php index 787ba81a..bcbe04aa 100644 --- a/tests/static-analysis/non-return/assert-isList.php +++ b/tests/static-analysis/non-return/assert-isList.php @@ -47,6 +47,8 @@ function nullOrIsList(mixed $value): ?array /** * @psalm-pure + * + * @return iterable> */ function allIsList(mixed $value): iterable { @@ -57,6 +59,8 @@ function allIsList(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|null> */ function allNullOrIsList(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isMap.php b/tests/static-analysis/non-return/assert-isMap.php index fb0b1c1b..5c721416 100644 --- a/tests/static-analysis/non-return/assert-isMap.php +++ b/tests/static-analysis/non-return/assert-isMap.php @@ -65,6 +65,7 @@ function nullOrIsMap(mixed $value): ?array * @psalm-pure * * @param iterable> $value + * @return iterable> */ function allIsMap(iterable $value): iterable { @@ -77,6 +78,7 @@ function allIsMap(iterable $value): iterable * @psalm-pure * * @param iterable> $value + * @return iterable|null> */ function allNullOrIsMap(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isNonEmptyList.php b/tests/static-analysis/non-return/assert-isNonEmptyList.php index fff6fb7a..4ee0e2e0 100644 --- a/tests/static-analysis/non-return/assert-isNonEmptyList.php +++ b/tests/static-analysis/non-return/assert-isNonEmptyList.php @@ -44,6 +44,8 @@ function nullOrIsNonEmptyList(mixed $value): ?array /** * @psalm-pure + * + * @return iterable> */ function allIsNonEmptyList(mixed $value): iterable { @@ -54,6 +56,8 @@ function allIsNonEmptyList(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|null> */ function allNullOrIsNonEmptyList(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isNonEmptyMap.php b/tests/static-analysis/non-return/assert-isNonEmptyMap.php index 982171fa..57224bd1 100644 --- a/tests/static-analysis/non-return/assert-isNonEmptyMap.php +++ b/tests/static-analysis/non-return/assert-isNonEmptyMap.php @@ -53,6 +53,7 @@ function nullOrIsNonEmptyMap(?array $value): ?array * @psalm-pure * * @param iterable> $value + * @return iterable> */ function allIsNonEmptyMap(iterable $value): iterable { @@ -65,6 +66,7 @@ function allIsNonEmptyMap(iterable $value): iterable * @psalm-pure * * @param iterable|null> $value + * @return iterable> */ function allNullOrIsNonEmptyMap(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-isNotA.php b/tests/static-analysis/non-return/assert-isNotA.php index 23c23f18..37258a30 100644 --- a/tests/static-analysis/non-return/assert-isNotA.php +++ b/tests/static-analysis/non-return/assert-isNotA.php @@ -24,6 +24,7 @@ function isNotA(mixed $value): object|string * * @param null|object|string $value * @param class-string $class + * @return null|object|string */ function nullOrIsNotA(mixed $value, $class): object|string|null { @@ -37,6 +38,7 @@ function nullOrIsNotA(mixed $value, $class): object|string|null * * @param iterable $value * @param class-string $class + * @return iterable */ function allIsNotA(mixed $value, $class): iterable { @@ -50,6 +52,7 @@ function allIsNotA(mixed $value, $class): iterable * * @param iterable $value * @param class-string $class + * @return iterable */ function allNullOrIsNotA(mixed $value, $class): iterable { diff --git a/tests/static-analysis/non-return/assert-keyExists.php b/tests/static-analysis/non-return/assert-keyExists.php index de681fd7..c09d3ac0 100644 --- a/tests/static-analysis/non-return/assert-keyExists.php +++ b/tests/static-analysis/non-return/assert-keyExists.php @@ -35,6 +35,7 @@ function nullOrKeyExists(?array $array, $key): ?array * * @param iterable $array * @param array-key $key + * @return iterable */ function allKeyExists(iterable $array, $key): iterable { @@ -48,6 +49,7 @@ function allKeyExists(iterable $array, $key): iterable * * @param iterable $array * @param array-key $key + * @return iterable */ function allNullOrKeyExists(iterable $array, $key): iterable { diff --git a/tests/static-analysis/non-return/assert-keyNotExists.php b/tests/static-analysis/non-return/assert-keyNotExists.php index d72fb13d..82bbb807 100644 --- a/tests/static-analysis/non-return/assert-keyNotExists.php +++ b/tests/static-analysis/non-return/assert-keyNotExists.php @@ -35,6 +35,7 @@ function nullOrKeyNotExists(?array $array, $key): ?array * * @param iterable $array * @param array-key $key + * @return iterable */ function allKeyNotExists(iterable $array, $key): iterable { @@ -48,6 +49,7 @@ function allKeyNotExists(iterable $array, $key): iterable * * @param iterable $array * @param array-key $key + * @return iterable */ function allNullOrKeyNotExists(iterable $array, $key): iterable { diff --git a/tests/static-analysis/non-return/assert-length.php b/tests/static-analysis/non-return/assert-length.php index d5479d65..2f04f9ed 100644 --- a/tests/static-analysis/non-return/assert-length.php +++ b/tests/static-analysis/non-return/assert-length.php @@ -30,6 +30,7 @@ function nullOrLength(?string $value, int $length): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allLength(iterable $value, int $length): iterable { @@ -42,6 +43,7 @@ function allLength(iterable $value, int $length): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrLength(iterable $value, int $length): iterable { diff --git a/tests/static-analysis/non-return/assert-lower.php b/tests/static-analysis/non-return/assert-lower.php index 706566cd..9ab9dc91 100644 --- a/tests/static-analysis/non-return/assert-lower.php +++ b/tests/static-analysis/non-return/assert-lower.php @@ -34,6 +34,7 @@ function nullOrLower(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allLower(iterable $value): iterable { @@ -46,6 +47,7 @@ function allLower(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrLower(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-maxCount.php b/tests/static-analysis/non-return/assert-maxCount.php index 3fba3e3d..1617c9f6 100644 --- a/tests/static-analysis/non-return/assert-maxCount.php +++ b/tests/static-analysis/non-return/assert-maxCount.php @@ -10,6 +10,7 @@ /** * @param Countable|array $array * @param int|float $max + * @return Countable|array */ function maxCount(mixed $array, $max): Countable|array { @@ -21,6 +22,7 @@ function maxCount(mixed $array, $max): Countable|array /** * @param null|Countable|array $array * @param int|float $max + * @return null|Countable|array */ function nullOrMaxCount(mixed $array, $max): Countable|array|null { @@ -32,6 +34,7 @@ function nullOrMaxCount(mixed $array, $max): Countable|array|null /** * @param iterable $array * @param int|float $max + * @return iterable */ function allMaxCount(iterable $array, $max): iterable { @@ -43,6 +46,7 @@ function allMaxCount(iterable $array, $max): iterable /** * @param iterable $array * @param int|float $max + * @return iterable */ function allNullOrMaxCount(iterable $array, $max): iterable { diff --git a/tests/static-analysis/non-return/assert-methodExists.php b/tests/static-analysis/non-return/assert-methodExists.php index ca3ca393..e30e3416 100644 --- a/tests/static-analysis/non-return/assert-methodExists.php +++ b/tests/static-analysis/non-return/assert-methodExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $method + * @return class-string|object */ function methodExists(mixed $classOrObject, $method): string|object { @@ -24,6 +25,7 @@ function methodExists(mixed $classOrObject, $method): string|object * * @param null|class-string|object $classOrObject * @param mixed $method + * @return null|class-string|object */ function nullOrMethodExists(mixed $classOrObject, $method): string|object|null { @@ -37,6 +39,7 @@ function nullOrMethodExists(mixed $classOrObject, $method): string|object|null * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allMethodExists(iterable $classOrObject, $method): iterable { @@ -50,6 +53,7 @@ function allMethodExists(iterable $classOrObject, $method): iterable * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allNullOrMethodExists(iterable $classOrObject, $method): iterable { diff --git a/tests/static-analysis/non-return/assert-methodNotExists.php b/tests/static-analysis/non-return/assert-methodNotExists.php index a620b043..65174977 100644 --- a/tests/static-analysis/non-return/assert-methodNotExists.php +++ b/tests/static-analysis/non-return/assert-methodNotExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $method + * @return class-string|object */ function methodNotExists(mixed $classOrObject, $method): string|object { @@ -24,6 +25,7 @@ function methodNotExists(mixed $classOrObject, $method): string|object * * @param null|class-string|object $classOrObject * @param mixed $method + * @return null|class-string|object */ function nullOrMethodNotExists(mixed $classOrObject, $method): string|object|null { @@ -37,6 +39,7 @@ function nullOrMethodNotExists(mixed $classOrObject, $method): string|object|nul * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allMethodNotExists(iterable $classOrObject, $method): iterable { @@ -50,6 +53,7 @@ function allMethodNotExists(iterable $classOrObject, $method): iterable * * @param iterable $classOrObject * @param mixed $method + * @return iterable */ function allNullOrMethodNotExists(iterable $classOrObject, $method): iterable { diff --git a/tests/static-analysis/non-return/assert-minCount.php b/tests/static-analysis/non-return/assert-minCount.php index 8a0edc95..14e0af6e 100644 --- a/tests/static-analysis/non-return/assert-minCount.php +++ b/tests/static-analysis/non-return/assert-minCount.php @@ -10,6 +10,7 @@ /** * @param Countable|array $array * @param int|float $min + * @return Countable|array */ function minCount(mixed $array, $min): Countable|array { @@ -21,6 +22,7 @@ function minCount(mixed $array, $min): Countable|array /** * @param null|Countable|array $array * @param int|float $min + * @return null|Countable|array */ function nullOrMinCount(mixed $array, $min): Countable|array|null { diff --git a/tests/static-analysis/non-return/assert-minLength.php b/tests/static-analysis/non-return/assert-minLength.php index 5124d23d..d89eed1f 100644 --- a/tests/static-analysis/non-return/assert-minLength.php +++ b/tests/static-analysis/non-return/assert-minLength.php @@ -35,6 +35,7 @@ function nullOrMinLength(?string $value, $min): ?string * * @param iterable $value * @param int|float $min + * @return iterable */ function allMinLength(iterable $value, $min): iterable { @@ -48,6 +49,7 @@ function allMinLength(iterable $value, $min): iterable * * @param iterable $value * @param int|float $min + * @return iterable */ function allNullOrMinLength(iterable $value, $min): iterable { diff --git a/tests/static-analysis/non-return/assert-notContains.php b/tests/static-analysis/non-return/assert-notContains.php index 1e48ff5b..d175ecbc 100644 --- a/tests/static-analysis/non-return/assert-notContains.php +++ b/tests/static-analysis/non-return/assert-notContains.php @@ -30,6 +30,7 @@ function nullOrNotContains(?string $value, string $subString): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allNotContains(iterable $value, string $subString): iterable { @@ -42,6 +43,7 @@ function allNotContains(iterable $value, string $subString): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrNotContains(iterable $value, string $subString): iterable { diff --git a/tests/static-analysis/non-return/assert-notRegex.php b/tests/static-analysis/non-return/assert-notRegex.php index a155f2ab..7c821fec 100644 --- a/tests/static-analysis/non-return/assert-notRegex.php +++ b/tests/static-analysis/non-return/assert-notRegex.php @@ -30,6 +30,7 @@ function nullOrNotRegex(?string $value, string $pattern): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allNotRegex(iterable $value, string $pattern): iterable { @@ -42,6 +43,7 @@ function allNotRegex(iterable $value, string $pattern): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrNotRegex(iterable $value, string $pattern): iterable { diff --git a/tests/static-analysis/non-return/assert-notWhitespaceOnly.php b/tests/static-analysis/non-return/assert-notWhitespaceOnly.php index 861d5c72..4f38bfd0 100644 --- a/tests/static-analysis/non-return/assert-notWhitespaceOnly.php +++ b/tests/static-analysis/non-return/assert-notWhitespaceOnly.php @@ -30,6 +30,7 @@ function nullOrNotWhitespaceOnly(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allNotWhitespaceOnly(iterable $value): iterable { @@ -42,6 +43,7 @@ function allNotWhitespaceOnly(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrNotWhitespaceOnly(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-null.php b/tests/static-analysis/non-return/assert-null.php index 8838b9bb..8fdbeb64 100644 --- a/tests/static-analysis/non-return/assert-null.php +++ b/tests/static-analysis/non-return/assert-null.php @@ -8,6 +8,8 @@ /** * @psalm-pure + * + * @return null */ function null(mixed $value): null { @@ -18,6 +20,8 @@ function null(mixed $value): null /** * @psalm-pure + * + * @return iterable */ function allNull(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-numeric.php b/tests/static-analysis/non-return/assert-numeric.php index 36469d02..8739ffe6 100644 --- a/tests/static-analysis/non-return/assert-numeric.php +++ b/tests/static-analysis/non-return/assert-numeric.php @@ -32,6 +32,8 @@ function nullOrNumeric(mixed $value) /** * @psalm-pure + * + * @return iterable */ function allNumeric(mixed $value): iterable { @@ -42,6 +44,8 @@ function allNumeric(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrNumeric(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-object.php b/tests/static-analysis/non-return/assert-object.php index 0c84632c..b2ec278a 100644 --- a/tests/static-analysis/non-return/assert-object.php +++ b/tests/static-analysis/non-return/assert-object.php @@ -28,6 +28,8 @@ function nullOrObject(mixed $value): ?object /** * @psalm-pure + * + * @return iterable */ function allObject(mixed $value): iterable { @@ -38,6 +40,8 @@ function allObject(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrObject(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-positiveInteger.php b/tests/static-analysis/non-return/assert-positiveInteger.php index dcdb4964..ada43614 100644 --- a/tests/static-analysis/non-return/assert-positiveInteger.php +++ b/tests/static-analysis/non-return/assert-positiveInteger.php @@ -46,6 +46,8 @@ function nullOrPositiveInteger(mixed $value): ?int /** * @psalm-pure + * + * @return iterable */ function allPositiveInteger(mixed $value): iterable { @@ -56,6 +58,8 @@ function allPositiveInteger(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrPositiveInteger(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-propertyExists.php b/tests/static-analysis/non-return/assert-propertyExists.php index 7fecd918..a3eaf289 100644 --- a/tests/static-analysis/non-return/assert-propertyExists.php +++ b/tests/static-analysis/non-return/assert-propertyExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $property + * @return class-string|object */ function propertyExists(mixed $classOrObject, $property): string|object { @@ -24,6 +25,7 @@ function propertyExists(mixed $classOrObject, $property): string|object * * @param null|class-string|object $classOrObject * @param mixed $property + * @return null|class-string|object */ function nullOrPropertyExists(mixed $classOrObject, $property): string|object|null { @@ -37,6 +39,7 @@ function nullOrPropertyExists(mixed $classOrObject, $property): string|object|nu * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allPropertyExists(iterable $classOrObject, $property): iterable { @@ -50,6 +53,7 @@ function allPropertyExists(iterable $classOrObject, $property): iterable * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allNullOrPropertyExists(iterable $classOrObject, $property): iterable { diff --git a/tests/static-analysis/non-return/assert-propertyNotExists.php b/tests/static-analysis/non-return/assert-propertyNotExists.php index a5a43414..734799ee 100644 --- a/tests/static-analysis/non-return/assert-propertyNotExists.php +++ b/tests/static-analysis/non-return/assert-propertyNotExists.php @@ -11,6 +11,7 @@ * * @param class-string|object $classOrObject * @param mixed $property + * @return class-string|object */ function propertyNotExists(mixed $classOrObject, $property): string|object { @@ -24,6 +25,7 @@ function propertyNotExists(mixed $classOrObject, $property): string|object * * @param null|class-string|object $classOrObject * @param mixed $property + * @return null|class-string|object */ function nullOrPropertyNotExists(mixed $classOrObject, $property): string|object|null { @@ -37,6 +39,7 @@ function nullOrPropertyNotExists(mixed $classOrObject, $property): string|object * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allPropertyNotExists(iterable $classOrObject, $property): iterable { @@ -50,6 +53,7 @@ function allPropertyNotExists(iterable $classOrObject, $property): iterable * * @param iterable $classOrObject * @param mixed $property + * @return iterable */ function allNullOrPropertyNotExists(iterable $classOrObject, $property): iterable { diff --git a/tests/static-analysis/non-return/assert-readable.php b/tests/static-analysis/non-return/assert-readable.php index dfca9e23..3fc42d00 100644 --- a/tests/static-analysis/non-return/assert-readable.php +++ b/tests/static-analysis/non-return/assert-readable.php @@ -22,6 +22,7 @@ function nullOrReadable(?string $value): ?string /** * @param iterable $value + * @return iterable */ function allReadable(iterable $value): iterable { @@ -32,6 +33,7 @@ function allReadable(iterable $value): iterable /** * @param iterable $value + * @return iterable */ function allNullOrReadable(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-regex.php b/tests/static-analysis/non-return/assert-regex.php index f76358df..f0a3c8ec 100644 --- a/tests/static-analysis/non-return/assert-regex.php +++ b/tests/static-analysis/non-return/assert-regex.php @@ -30,6 +30,7 @@ function nullOrRegex(?string $value, string $pattern): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allRegex(iterable $value, string $pattern): iterable { @@ -42,6 +43,7 @@ function allRegex(iterable $value, string $pattern): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrRegex(iterable $value, string $pattern): iterable { diff --git a/tests/static-analysis/non-return/assert-resource.php b/tests/static-analysis/non-return/assert-resource.php index 4dda5d3d..c968a23c 100644 --- a/tests/static-analysis/non-return/assert-resource.php +++ b/tests/static-analysis/non-return/assert-resource.php @@ -9,6 +9,7 @@ /** * @psalm-pure * @param null|string $type + * @return resource */ function resource(mixed $value, ?string $type): mixed { @@ -20,6 +21,7 @@ function resource(mixed $value, ?string $type): mixed /** * @psalm-pure * @param null|string $type + * @return null|resource */ function nullOrResource(mixed $value, ?string $type): mixed { @@ -31,6 +33,7 @@ function nullOrResource(mixed $value, ?string $type): mixed /** * @psalm-pure * @param null|string $type + * @return iterable */ function allResource(mixed $value, $type): iterable { @@ -42,6 +45,7 @@ function allResource(mixed $value, $type): iterable /** * @psalm-pure * @param null|string $type + * @return iterable */ function allNullOrResource(mixed $value, $type): iterable { diff --git a/tests/static-analysis/non-return/assert-scalar.php b/tests/static-analysis/non-return/assert-scalar.php index 6cc81ebc..3b46bd23 100644 --- a/tests/static-analysis/non-return/assert-scalar.php +++ b/tests/static-analysis/non-return/assert-scalar.php @@ -8,6 +8,8 @@ /** * @psalm-pure + * + * @return scalar */ function scalar(mixed $value): int|float|string|bool { @@ -18,6 +20,8 @@ function scalar(mixed $value): int|float|string|bool /** * @psalm-pure + * + * @return null|scalar */ function nullOrScalar(mixed $value): int|float|string|bool|null { @@ -28,6 +32,8 @@ function nullOrScalar(mixed $value): int|float|string|bool|null /** * @psalm-pure + * + * @return iterable */ function allScalar(mixed $value): iterable { @@ -38,6 +44,8 @@ function allScalar(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrScalar(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-startsWith.php b/tests/static-analysis/non-return/assert-startsWith.php index f406f872..f265cc77 100644 --- a/tests/static-analysis/non-return/assert-startsWith.php +++ b/tests/static-analysis/non-return/assert-startsWith.php @@ -30,6 +30,7 @@ function nullOrStartsWith(?string $value, string $prefix): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allStartsWith(iterable $value, string $prefix): iterable { @@ -42,6 +43,7 @@ function allStartsWith(iterable $value, string $prefix): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrStartsWith(iterable $value, string $prefix): iterable { diff --git a/tests/static-analysis/non-return/assert-string.php b/tests/static-analysis/non-return/assert-string.php index 1a50eaa9..dbaebcb0 100644 --- a/tests/static-analysis/non-return/assert-string.php +++ b/tests/static-analysis/non-return/assert-string.php @@ -28,6 +28,8 @@ function nullOrString(mixed $value): ?string /** * @psalm-pure + * + * @return iterable */ function allString(mixed $value): iterable { @@ -38,6 +40,8 @@ function allString(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrString(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-stringNotEmpty.php b/tests/static-analysis/non-return/assert-stringNotEmpty.php index 7d6d9435..224b18ec 100644 --- a/tests/static-analysis/non-return/assert-stringNotEmpty.php +++ b/tests/static-analysis/non-return/assert-stringNotEmpty.php @@ -32,6 +32,8 @@ function nullOrStringNotEmpty(mixed $value): ?string /** * @psalm-pure + * + * @return iterable */ function allStringNotEmpty(mixed $value): iterable { @@ -42,6 +44,8 @@ function allStringNotEmpty(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrStringNotEmpty(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-subclassOf.php b/tests/static-analysis/non-return/assert-subclassOf.php index 677342c4..51d88c41 100644 --- a/tests/static-analysis/non-return/assert-subclassOf.php +++ b/tests/static-analysis/non-return/assert-subclassOf.php @@ -33,6 +33,8 @@ function nullOrSubclassOf(mixed $value) /** * @psalm-pure + * + * @return iterable|stdClass> */ function allSubclassOf(mixed $value): iterable { @@ -43,6 +45,8 @@ function allSubclassOf(mixed $value): iterable /** * @psalm-pure + * + * @return iterable|stdClass|null> */ function allNullOrSubclassOf(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-throws.php b/tests/static-analysis/non-return/assert-throws.php index c9e5b6d5..57273e21 100644 --- a/tests/static-analysis/non-return/assert-throws.php +++ b/tests/static-analysis/non-return/assert-throws.php @@ -31,6 +31,7 @@ function nullOrThrows(?Closure $value, $class): ?Closure /** * @param iterable $value * @param class-string $class + * @return iterable */ function allThrows(iterable $value, $class): iterable { @@ -41,6 +42,7 @@ function allThrows(iterable $value, $class): iterable /** * @param iterable $value * @param class-string $class + * @return iterable */ function allNullOrThrows(iterable $value, $class): iterable { diff --git a/tests/static-analysis/non-return/assert-true.php b/tests/static-analysis/non-return/assert-true.php index 54662aea..3d7cb7a9 100644 --- a/tests/static-analysis/non-return/assert-true.php +++ b/tests/static-analysis/non-return/assert-true.php @@ -32,6 +32,8 @@ function nullOrTrue(mixed $value): ?bool /** * @psalm-pure + * + * @return iterable */ function allTrue(mixed $value): iterable { @@ -42,6 +44,8 @@ function allTrue(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrTrue(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-upper.php b/tests/static-analysis/non-return/assert-upper.php index 06d30896..60db473d 100644 --- a/tests/static-analysis/non-return/assert-upper.php +++ b/tests/static-analysis/non-return/assert-upper.php @@ -30,6 +30,7 @@ function nullOrUpper(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allUpper(iterable $value): iterable { @@ -42,6 +43,7 @@ function allUpper(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrUpper(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-uuid.php b/tests/static-analysis/non-return/assert-uuid.php index dcc426ff..c40753ea 100644 --- a/tests/static-analysis/non-return/assert-uuid.php +++ b/tests/static-analysis/non-return/assert-uuid.php @@ -30,6 +30,7 @@ function nullOrUuid(?string $value): ?string * @psalm-pure * * @param iterable $value + * @return iterable */ function allUuid(iterable $value): iterable { @@ -42,6 +43,7 @@ function allUuid(iterable $value): iterable * @psalm-pure * * @param iterable $value + * @return iterable */ function allNullOrUuid(iterable $value): iterable { diff --git a/tests/static-analysis/non-return/assert-validArrayKey.php b/tests/static-analysis/non-return/assert-validArrayKey.php index ed043a5d..217c9e40 100644 --- a/tests/static-analysis/non-return/assert-validArrayKey.php +++ b/tests/static-analysis/non-return/assert-validArrayKey.php @@ -32,6 +32,8 @@ function nullOrValidArrayKey(mixed $value) /** * @psalm-pure + * + * @return iterable */ function allValidArrayKey(mixed $value): iterable { @@ -42,6 +44,8 @@ function allValidArrayKey(mixed $value): iterable /** * @psalm-pure + * + * @return iterable */ function allNullOrValidArrayKey(mixed $value): iterable { diff --git a/tests/static-analysis/non-return/assert-writable.php b/tests/static-analysis/non-return/assert-writable.php index d8b07990..c4b92d0a 100644 --- a/tests/static-analysis/non-return/assert-writable.php +++ b/tests/static-analysis/non-return/assert-writable.php @@ -22,6 +22,7 @@ function nullOrWritable(?string $value): ?string /** * @param iterable $value + * @return iterable */ function allWritable(iterable $value): iterable { @@ -32,6 +33,7 @@ function allWritable(iterable $value): iterable /** * @param iterable $value + * @return iterable */ function allNullOrWritable(iterable $value): iterable {