diff --git a/stubs/Contracts/Application.stubphp b/stubs/Foundation/Application.stubphp similarity index 69% rename from stubs/Contracts/Application.stubphp rename to stubs/Foundation/Application.stubphp index 88572c25..cafb08a1 100644 --- a/stubs/Contracts/Application.stubphp +++ b/stubs/Foundation/Application.stubphp @@ -1,16 +1,14 @@ ...$environments * @return string|bool - * @psalm-return ($environments is (string|non-empty-array) ? bool : string) + * @psalm-return ($environments is null ? string : bool) */ public function environment(...$environments) {} diff --git a/tests/Type/tests/Contracts/ApplicationTest.phpt b/tests/Type/tests/Contracts/ApplicationTest.phpt deleted file mode 100644 index f06ab1c0..00000000 --- a/tests/Type/tests/Contracts/ApplicationTest.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---FILE-- -environment($env); -} - -/** @param non-empty-list $envs */ -function returns_bool_for_array_arg(array $envs): bool -{ - return app()->environment($envs); -} - -function returns_string(): string -{ - return app()->environment(); -} -?> ---EXPECTF-- diff --git a/tests/Type/tests/Foundation/ApplicationTest.phpt b/tests/Type/tests/Foundation/ApplicationTest.phpt new file mode 100644 index 00000000..9fca5cb2 --- /dev/null +++ b/tests/Type/tests/Foundation/ApplicationTest.phpt @@ -0,0 +1,22 @@ +--FILE-- +environment($env); +} + +/** @param non-empty-list $envs */ +function returns_bool_for_array_arg(Application $application, array $envs): bool +{ + return $application->environment($envs); +} + +function returns_string(Application $application): string +{ + return $application->environment(); +} +?> +--EXPECTF--