mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-11-27 05:39:55 +08:00
first argument of option()
function is required
This commit is contained in:
parent
63b828d46b
commit
82dd87703f
@ -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);
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user