update kirby

This commit is contained in:
isUnknown 2024-09-13 17:24:45 +02:00
parent 85869bdb48
commit 4768abeb13
94 changed files with 777 additions and 459 deletions

View file

@ -738,12 +738,18 @@ class A
/**
* Returns a number of random elements from an array,
* either in original or shuffled order
*
* @throws \Exception When $count is larger than array length
*/
public static function random(
array $array,
int $count = 1,
bool $shuffle = false
): array {
if ($count > count($array)) {
throw new InvalidArgumentException('$count is larger than available array items');
}
if ($shuffle === true) {
return array_slice(self::shuffle($array), 0, $count);
}