update kirby to v5 and add refresh cache panel view button

This commit is contained in:
isUnknown 2025-09-10 14:28:38 +02:00
commit 9a86d41254
466 changed files with 19960 additions and 10497 deletions

View file

@ -70,7 +70,7 @@ class Argument
// numeric
if (is_numeric($argument) === true) {
if (strpos($argument, '.') === false) {
if (str_contains($argument, '.') === false) {
return new static((int)$argument);
}

View file

@ -14,6 +14,8 @@ use Kirby\Toolkit\Collection;
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://opensource.org/licenses/MIT
*
* @extends \Kirby\Toolkit\Collection<\Kirby\Query\Argument>
*/
class Arguments extends Collection
{

View file

@ -41,10 +41,10 @@ class Expression
// into actual types and treats all other parts as their own queries
$parts = A::map(
$parts,
fn ($part) =>
in_array($part, ['?', ':', '?:', '??'])
? $part
: Argument::factory($part)
fn ($part) => match ($part) {
'?', ':', '?:', '??' => $part,
default => Argument::factory($part)
}
);
return new static(parts: $parts);
@ -53,7 +53,7 @@ class Expression
/**
* Splits a comparison string into an array
* of expressions and operators
* @internal
* @unstable
*/
public static function parse(string $string): array
{
@ -101,7 +101,9 @@ class Expression
// if `a` isn't false, return `b`, otherwise `c`
if ($part === '?') {
if (($this->parts[$index + 2] ?? null) !== ':') {
throw new LogicException('Query: Incomplete ternary operator (missing matching `? :`)');
throw new LogicException(
message: 'Query: Incomplete ternary operator (missing matching `? :`)'
);
}
if ($base != false) {

View file

@ -80,7 +80,7 @@ class Query
// merge data with default entries
if (is_array($data) === true) {
$data = array_merge(static::$entries, $data);
$data = [...static::$entries, ...$data];
}
// direct data array access via key

View file

@ -28,7 +28,7 @@ class Segment
/**
* Throws an exception for an access to an invalid method
* @internal
* @unstable
*
* @param mixed $data Variable on which the access was tried
* @param string $name Name of the method/property that was accessed
@ -44,7 +44,7 @@ class Segment
$type = 'float';
}
$nonExisting = in_array($type, ['array', 'object']) ? 'non-existing ' : '';
$nonExisting = in_array($type, ['array', 'object'], true) ? 'non-existing ' : '';
$error = 'Access to ' . $nonExisting . $label . ' "' . $name . '" on ' . $type;
@ -145,7 +145,9 @@ class Segment
array_key_exists($this->method, $array) &&
$args !== []
) {
throw new InvalidArgumentException('Cannot access array element "' . $this->method . '" with arguments');
throw new InvalidArgumentException(
message: 'Cannot access array element "' . $this->method . '" with arguments'
);
}
// last, the standard error for trying to access something

View file

@ -14,6 +14,8 @@ use Kirby\Toolkit\Collection;
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://opensource.org/licenses/MIT
*
* @extends \Kirby\Toolkit\Collection<\Kirby\Query\Segment>
*/
class Segments extends Collection
{
@ -37,7 +39,7 @@ class Segments extends Collection
$segments,
function ($segment) use (&$position) {
// leave connectors as they are
if (in_array($segment, ['.', '?.']) === true) {
if (in_array($segment, ['.', '?.'], true) === true) {
return $segment;
}
@ -54,7 +56,7 @@ class Segments extends Collection
/**
* Splits the string of a segment chaing into an
* array of segments as well as conenctors (`.` or `?.`)
* @internal
* @unstable
*/
public static function parse(string $string): array
{