Upgrade to 3.9.0

This commit is contained in:
Bastian Allgeier
2023-01-17 14:50:16 +01:00
parent 0ebe0c7b16
commit 6e5c9d1f48
132 changed files with 1664 additions and 1254 deletions

View File

@@ -15,19 +15,12 @@ namespace Kirby\Toolkit;
*/
class Silo
{
/**
* @var array
*/
public static $data = [];
/**
* Setter for new data.
*
* @param string|array $key
* @param mixed $value
* @return array
* Setter for new data
*/
public static function set($key, $value = null): array
public static function set(string|array $key, $value = null): array
{
if (is_array($key) === true) {
return static::$data = array_merge(static::$data, $key);
@@ -37,12 +30,7 @@ class Silo
return static::$data;
}
/**
* @param string|array $key
* @param mixed $default
* @return mixed
*/
public static function get($key = null, $default = null)
public static function get(string|array $key = null, $default = null)
{
if ($key === null) {
return static::$data;
@@ -53,9 +41,6 @@ class Silo
/**
* Removes an item from the data array
*
* @param string|null $key
* @return array
*/
public static function remove(string $key = null): array
{