Upgrade framework
This commit is contained in:
21
vendor/laravel/framework/src/Illuminate/Config/LICENSE.md
vendored
Normal file
21
vendor/laravel/framework/src/Illuminate/Config/LICENSE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Taylor Otwell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -3,11 +3,14 @@
|
||||
namespace Illuminate\Config;
|
||||
|
||||
use ArrayAccess;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Contracts\Config\Repository as ConfigContract;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
|
||||
class Repository implements ArrayAccess, ConfigContract
|
||||
{
|
||||
use Macroable;
|
||||
|
||||
/**
|
||||
* All of the configuration items.
|
||||
*
|
||||
@@ -40,20 +43,45 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
/**
|
||||
* Get the specified configuration value.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @param array|string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if (is_array($key)) {
|
||||
return $this->getMany($key);
|
||||
}
|
||||
|
||||
return Arr::get($this->items, $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get many configuration values.
|
||||
*
|
||||
* @param array $keys
|
||||
* @return array
|
||||
*/
|
||||
public function getMany($keys)
|
||||
{
|
||||
$config = [];
|
||||
|
||||
foreach ($keys as $key => $default) {
|
||||
if (is_numeric($key)) {
|
||||
[$key, $default] = [$default, null];
|
||||
}
|
||||
|
||||
$config[$key] = Arr::get($this->items, $key, $default);
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a given configuration value.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function set($key, $value = null)
|
||||
@@ -74,7 +102,7 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
*/
|
||||
public function prepend($key, $value)
|
||||
{
|
||||
$array = $this->get($key);
|
||||
$array = $this->get($key, []);
|
||||
|
||||
array_unshift($array, $value);
|
||||
|
||||
@@ -90,7 +118,7 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
*/
|
||||
public function push($key, $value)
|
||||
{
|
||||
$array = $this->get($key);
|
||||
$array = $this->get($key, []);
|
||||
|
||||
$array[] = $value;
|
||||
|
||||
@@ -113,7 +141,7 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($key)
|
||||
public function offsetExists($key): bool
|
||||
{
|
||||
return $this->has($key);
|
||||
}
|
||||
@@ -124,7 +152,7 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($key)
|
||||
public function offsetGet($key): mixed
|
||||
{
|
||||
return $this->get($key);
|
||||
}
|
||||
@@ -136,7 +164,7 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($key, $value)
|
||||
public function offsetSet($key, $value): void
|
||||
{
|
||||
$this->set($key, $value);
|
||||
}
|
||||
@@ -147,7 +175,7 @@ class Repository implements ArrayAccess, ConfigContract
|
||||
* @param string $key
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($key)
|
||||
public function offsetUnset($key): void
|
||||
{
|
||||
$this->set($key, null);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.4",
|
||||
"illuminate/contracts": "5.4.*",
|
||||
"illuminate/support": "5.4.*"
|
||||
"php": "^8.0.2",
|
||||
"illuminate/collections": "^9.0",
|
||||
"illuminate/contracts": "^9.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.4-dev"
|
||||
"dev-master": "9.x-dev"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
|
||||
Reference in New Issue
Block a user