Skip to content

Commit

Permalink
first argument of option() function is required
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Jan 25, 2023
1 parent 63b828d commit 82dd877
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,11 @@ function json()
* 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);

Expand Down
1 change: 0 additions & 1 deletion tests/ServicesTest/OptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public function testGet()
$options = resolve(Option::class);
$options->set('k1', '(null)');
$this->assertNull($options->get('k1'));
$this->assertNull(option()->get('k1'));
}

public function testSet()
Expand Down

0 comments on commit 82dd877

Please sign in to comment.