1
0

downgrade to kirby v3

This commit is contained in:
Philip Wagner
2024-09-01 10:47:15 +02:00
parent a4b2aece7b
commit af86acb7a1
1085 changed files with 54743 additions and 65042 deletions

View File

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