diff --git a/app/helpers.php b/app/helpers.php index 0f9ba1e5..02e89005 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -52,21 +52,11 @@ if (!function_exists('option')) { * Get / set the specified option value. * * If an array is passed as the key, we will assume you want to set an array of values. - * - * @param array|string $key - * @param mixed $default - * @param bool $raw return raw value without convertion - * - * @return mixed */ - function option($key = null, $default = null, $raw = false) + function option(string|array $key, mixed $default = null, bool $raw = false) { $options = app('options'); - if (is_null($key)) { - return $options; - } - if (is_array($key)) { $options->set($key); diff --git a/tests/ServicesTest/OptionTest.php b/tests/ServicesTest/OptionTest.php index 505cd687..e7af95bc 100644 --- a/tests/ServicesTest/OptionTest.php +++ b/tests/ServicesTest/OptionTest.php @@ -14,7 +14,6 @@ class OptionTest extends TestCase $options = resolve(Option::class); $options->set('k1', '(null)'); $this->assertNull($options->get('k1')); - $this->assertNull(option()->get('k1')); } public function testSet()