From e11ce9f299a3e4415d60a1d665cf81ff9b7b5e5c Mon Sep 17 00:00:00 2001 From: Fiachra Mcdermott Date: Tue, 21 Jun 2022 14:22:57 -0400 Subject: [PATCH] feature: add basic stub for config helper --- stubs/helpers.stubphp | 11 +++++ tests/acceptance/ConfigTypes.feature | 73 ++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 tests/acceptance/ConfigTypes.feature diff --git a/stubs/helpers.stubphp b/stubs/helpers.stubphp index bee3de5..2658fb9 100644 --- a/stubs/helpers.stubphp +++ b/stubs/helpers.stubphp @@ -116,3 +116,14 @@ function logger($message = null, array $context = []) return app('log')->debug($message, $context); } + +/** + * Get / set the specified configuration value. + * + * If an array is passed as the key, we will assume you want to set an array of values. + * + * @param array|string|null $key + * @param mixed $default + * @return ($key is null ? \Illuminate\Config\Repository : ($key is array ? null : mixed)) + */ +function config($key = null, $default = null) {} diff --git a/tests/acceptance/ConfigTypes.feature b/tests/acceptance/ConfigTypes.feature new file mode 100644 index 0000000..014a27d --- /dev/null +++ b/tests/acceptance/ConfigTypes.feature @@ -0,0 +1,73 @@ +Feature: Config helper + The global config helper will return a strict type + + Background: + Given I have the following config +""" + + + + + + + + + + +""" + And I have the following code preamble +""" + false]); + } + """ + When I run Psalm + Then I see no errors